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 thePC 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 themain() function, 6023 (or 28.68%) with thesubrA() 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 seeHardware 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 (seeInstruction Trace Connections.)
- Open theProject 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, seeTrace and Profiling Options.
- ClickOK.
Figure 1: PC Profiling – Selection and Setup
Operation
To generate data:
- SelectWindow > 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



