Datasheet
Specific Debug Functions: 32-Bit Devices
2013 Microchip Technology Inc. DS52085A-page 75
7.4 INSTRUMENTED TRACE
For some PIC32 devices, instrumented trace is available (see Chapter 2. “Device and
Feature Support”).
For information on this trace, see Section 6.3 “Instrumented Trace”.
7.5 PC PROFILING
PC profiling is a method for examining C code to determine how much time is spent in
each function. This information can show you where your program time is being spent
so you may work to optimize your code.
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 7-6. In this example, the trace buffer contains 21,000 PC sample data points.
Of these, 7859 (or 37.42%) where associated with the main() function, 6023 (or
28.68%) with the subrA() function, etc.
PC profiling is similar to PC sampling. For details see Section 6.4 “PC Sampling”.
To perform profiling:
1. Set up your hardware for PIC32 Instruction trace (see Section 7.3 “PIC32
Instruction Trace”.)
1. Open the Project properties window (File>Project Properties
).
2. Click on “REAL ICE” under “Categories” and select “Trace and Profiling” from the
“Options categories” drop-down box.
3. Under “Data Collection Selection”, select “Instruction Trace/Profiling”.
4. Set up your data file in this window. For reference, see Section 11.3.1 “Trace
and Profiling”. Then click OK.
5. Select Window>Debugging>PC Profiling
. This will open the PC Profiling window.
6. Run your code and then pause/halt.
7. View the profiling data in the window. Data is only displayed on halt.
8. Right click in the window to pop up a menu to either clear the data or reload the
data.