- IAR Embedded Workbench for RX 5.20
- 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) or Sampling 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.
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.
- Time-interval mode

Toggles between profiling a selected time interval or full profiling. This toolbar button is only available if PC Sampling is supported by the debug probe.
For information about which views that are supported in the C-SPY driver you are using, see Requirements for using the profiler.
- Status field
Displays the range of the selected time interval, in other words, the profiled selection. This field is yellow when Time-interval profiling mode is enabled. This field is only available if PC Sampling is supported by the debug probe.
For information about which views that are supported in the C-SPY driver you are using, see Requirements for using the profiler.
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.
For Sampling source, sections of code from the runtime library or from other code without debug information, denoted only by the corresponding assembler labels, is displayed.
- Calls (Trace (calls))
The number of times the function has been called.
- Flat time (Trace (calls))
The time expressed as the 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 number of executed instructions spent inside the function and everything called by the function.
- Acc. time (%) (Trace (calls))
Accumulated time expressed as a percentage of the total time.
- PC Count (Trace (flat) and Sampling)
The number of executed instructions (Trace) or PC samples (Sampling) associated with the function.
- PC Count (%) (Trace (flat) and Sampling)
The number of executed instructions (Trace) or PC samples (Sampling) associated with the function as a percentage of the total number of executed instructions /PC samples.
- Power Samples (Power Sampling)
The number of power samples associated with that function.
- Energy (%) (Power Sampling)
The accumulated value of all measurements associated with that function, expressed as a percentage of all measurements.
- Avg Current [mA] (Power Sampling)
The average measured value for all samples associated with that function.
- Min Current [mA] (Power Sampling)
The minimum measured value for all samples associated with that function.
- Max Current [mA] (Power Sampling)
The maximum measured value for all samples associated with that function.
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 one of the modes Trace (flat) or Sampling.
- 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:
Sampling—the instruction count for instruction profiling represents the number of samples for each instruction.
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.
- Power Sampling
Toggles power sampling information on or off.
- 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.