PC Profiling – 32-Bit MCUs Only
For PC profiling, every program counter (PC) trace sample is taken from the trace (data) buffer and profiled. This data is displayed in the PC Profiling window, as shown in Figure 2. In this example, the trace buffer contains 21,000 PC sample data points. Of these, 7859 (or 37.42%) were associated with the main() function, 6023 (or 28.68%) with the subrA() function, etc.
Requirements
Currently, to use PC profiling your project must be set up for these supported devices:
- PIC32MX with data capture – To find out if your device has data capture, please see Hardware Tool Debug Features by Device.
- Note: PIC32MZ devices are NOT supported
Profiling Setup
To set up profiling:
- Set up your hardware for PIC32 Instruction trace (see Instruction Trace Connections.)
- Open the Project Properties window (File > Project Properties).
- Click on “REAL ICE” under “Categories” and select “Trace and Profiling” from the “Options categories” drop-down box.
- Under “Data Collection Selection”, select “Instruction Trace/Profiling”.
- Set up your data file in this window. For reference, see Trace and Profiling Options.
- Click OK.
Figure 1: PC Profiling – Selection and Setup
Operation
To generate data:
- Select Window > Debugging > PC Profiling. This will open the PC Profiling window.
- Run your code and then pause/halt.
- View the profiling data in the window. Data is only displayed on halt.
- Right-click in the window to pop up a menu to either clear the data or reload the data.
You may also display this data in the Code Profiling plugin, available for purchase at
http://www.embeddedcodesource.com
Figure 2: PC Profiling Window