- IAR Embedded Workbench for RISC-V 3.40
- C-SPY Debugging
- Profiling
- Reference information on the profiler
Reference information on the profiler
Function Profiler window
What do you want to do?
Learn about:
Learn how to:
Get reference information about the Function Profiler window, see below the line.

The Function Profiler window is available from the C-SPY driver menu.

This window displays function profiling information.
When Trace (flat) is selected, a checkbox appears on each line in the left-side margin of the window. Use these checkboxes to include or exclude lines from the profiling. Excluded lines are dimmed but not removed.
Requirements
One of these alternatives:
The C-SPY simulator
The I-jet driver and a device that supports trace
Toolbar
The toolbar contains:
- Enable/Disable

Enables or disables the profiler.
- Clear

Clears all profiling data.
- Save

Opens a standard Save As dialog box where you can save the contents of the window to a file, with tab-separated columns. Only non-expanded rows are included in the list file.
- Graphical view

Overlays the values in the percentage columns with a graphical bar.
- Progress bar
Displays a backlog of profiling data that is still being processed. If the rate of incoming data is higher than the rate of the profiler processing the data, a backlog is accumulated. The progress bar indicates that the profiler is still processing data, but also approximately how far the profiler has come in the process.
Note that because the profiler consumes data at a certain rate and the target system supplies data at another rate, the amount of data remaining to be processed can both increase and decrease. The progress bar can grow and shrink accordingly.
Display area
The content in the display area depends on which source that is used for the profiling information:
For the Trace (calls) source, the display area contains one line for each function compiled with debug information enabled. When some profiling information has been collected, it is possible to expand rows of functions that have called other functions. The child items for a given function list all the functions that have been called by the parent function and the corresponding statistics.
For the Trace (flat) source, the display area contains one line for each C function of your application, but also lines for sections of code from the runtime library or from other code without debug information, denoted only by the corresponding assembler labels. Each executed
PCaddress from trace data is treated as a separate sample and is associated with the corresponding line in the Profiling window. Each line contains a count of those samples.
For information about which views that are supported in the C-SPY driver you are using, seeRequirements for using the profiler.
More specifically, the display area provides information in these columns:
- Function (All sources)
The name of the profiled C function.
- Calls (Trace (calls))
The number of times the function has been called.
- Flat time (Trace (calls))
The time expressed as the estimated number of executed instructions spent inside the function.
- Flat time (%) (Trace (calls))
Flat time expressed as a percentage of the total time.
- Acc. time (Trace (calls))
The time expressed as the estimated number of executed instructions spent inside the function.
- Acc. time (%) (Trace (calls))
Accumulated time expressed as a percentage of the total time.
- PC Count (Trace (flat))
The number of executed instructions associated with the function.
- PC Count (%) (Trace (flat))
The number of executed instructions associated with the function as a percentage of the total number of executed instructions.
Context menu
This context menu is available:

The contents of this menu depend on the C-SPY driver you are using.
These commands are available:
- Enable
Enables the profiler. The system will also collect information when the window is closed.
- Clear
Clears all profiling data.
- Filtering
Selects which part of your code to profile. Choose between:
Check All—Excludes all lines from the profiling.
Uncheck All—Includes all lines in the profiling.
Load—Reads all excluded lines from a saved file.
Save—Saves all excluded lines to a file. Typically, this can be useful if you are a group of engineers and want to share sets of exclusions.
These commands are only available when using Trace (flat).
- Source
Selects which source to be used for the profiling information. See also Profiling sources.
Note that the available sources depend on the C-SPY driver you are using.
Choose between:
Trace (calls)—the instruction count for instruction profiling is only as complete as the collected trace data.
Trace (flat)—the instruction count for instruction profiling is only as complete as the collected trace data.
- Save to File
Saves all profiling data to a file.
- Show Source
Opens the editor window (if not already opened) and highlights the selected source line.