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:

Profiling Setup

To set up profiling:

  1. Set up your hardware for PIC32 Instruction trace (seeInstruction Trace Connections.)
  2. Open theProject Properties window (File > Project Properties).
  3. Click on “REAL ICE” under “Categories” and select “Trace and Profiling” from the “Options categories” drop-down box.
  4. Under “Data Collection Selection”, select “Instruction Trace/Profiling”.
  5. Set up your data file in this window. For reference, seeTrace and Profiling Options.
  6. ClickOK.

Figure 1: PC Profiling – Selection and Setup

X_PP_32BitProfiling.gif

Operation

To generate data:

  1. SelectWindow > Debugging > PC Profiling. This will open the PC Profiling window.
  2. Run your code and then pause/halt.
  3. View the profiling data in the window. Data is only displayed on halt.
  4. 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

32Bit_PCProfiling.gif