Kernel Profiler (Compact 2013)


This tool collects various debugging information that you can use to assess the performance of your OS on a device.

  1. Configure your OS design and your device.

  2. Connect to the device.

  3. To control the kernel profiler, do one of the following:

    • In the Target Control window, use the prof command. For more information, see Target Control Debugging: prof Command.
    • Use the following function keys:

      Toggle between buffered, unbuffered, and CeLog storage modes.


      Run Monte Carlo profiling.


      Run instrumented kernel profiling.


      Run system call profiling.


      Stop profiling.

The kernel profiler is present in all run-time images.

The mode in which the kernel profiler runs determines the specific performance information that the kernel profiler collects. You can use the following modes:

  • Monte Carlo profiling   Periodically samples the program counter for the CPU.
  • System call profiling   Counts calls made to the API for the OS.
  • Instrumented kernel profiling   Tracks the time that the kernel requires to execute calls internal to the kernel.

The keyboard shortcuts that you use to turn profiling on and off are built into the default keyboard layout manager. The Profiler.cpp file at %_WINCEROOT%\Public\Common\OAK\Drivers\Keybd\Laymgr implements the shortcuts. To disable the shortcuts, in the sources file at %_WINCEROOT%\Public\Common\OAK\Drivers\Keybd\Laymgr, under CEDEFINES, remove -DPROFILE=1.

The kernel profiler provides buffered and unbuffered data storage options. In buffered mode, the kernel profiler looks up symbols after the kernel profiler stops, so the kernel profiler requires little time to capture a sample and has little effect on the performance of the device. In buffered mode, the kernel profiler can capture only a limited number of samples.

In unbuffered mode, the kernel profiler looks up symbols corresponding to samples while the kernel profiler captures the sample, therefore the time required to capture a sample is much greater than in buffered mode, and can have a noticeable effect on the performance of the device. In unbuffered mode, the kernel profiler can capture an unlimited number of samples.

By default, when running in buffered mode, the kernel profiler uses a buffer size of approximately half the available system memory. You can specify a larger or smaller size for this buffer in the Config.bib file, by specifying the size of the buffer as a dwProfileBufferMax variable.