Buffered and Unbuffered Profiling (Windows CE 5.0)
The kernel profiler provides buffered and unbuffered data storage options. In buffered mode, symbols are looked up when the kernel profiler stops. In buffered mode, the kernel profiler requires little time to capture a sample, but the kernel profiler can capture only a limited number of samples. Buffered profiling has little effect on the performance of the target device and is therefore less intrusive than unbuffered profiling. If the buffer is full, the sample is discarded. For information about specifying the size of the buffer for the kernel profiler, see Changing the Size of the Buffer for the Kernel Profiler.
In unbuffered mode, the symbol corresponding to a sample is looked up while the kernel profiler captures the sample. The time required to capture a sample in unbuffered mode is therefore much greater than the time required to capture a sample in buffered mode. However, in unbuffered mode, the kernel profiler can capture an unlimited number of samples. Unbuffered profiling can have a noticeable effect on the performance of the target device.
You may want to compare the results of buffered and unbuffered profiling on the same test. By comparing the results of buffered and unbuffered profiling, you may learn whether the overhead associated with unbuffered profiling skews the results reported by the kernel profiler.
The kernel profiler uses the address of each sample to look up the module and function that the sample is within. The table of contents lists all modules in the MODULES section of ROM, and all functions within those modules. When you build a run-time image, for each module Romimage.exe uses the associated .map file from the release directory to create the list of functions for that module in the table of contents. If a module does not have a .map file in the release directory, that module is listed in the table of contents but no functions are listed for it.
For each sample that is not discarded, the kernel profiler increments the following three counters:
A counter of the total samples recorded.
A counter for the module that the sample is inside.
Note The kernel profiler increments a counter for the UNKNOWN module if the module containing the sample is not listed in the table of contents. An example of a module not listed in the table of contents is a module that is not within the MODULES section of ROM.
A counter for the function that the sample was inside.
Note The kernel profiler increments a counter for the UNKNOWN function if the module lists no functions. An example of a module that lists no functions is a module that has no .map file in the release directory. Another example of a module that lists no functions is a module that is not listed in the table of contents.
When the kernel profiler operates in buffered mode, the process of looking up symbols and incrementing counters occurs during the call to the ProfileStop function at the end of profiling. When the kernel profiler operates in unbuffered mode, the process of looking up symbols and incrementing counters occurs during each call to the ProfilerHit function.
In choosing a mode of data storage for the kernel profiler, consider the amount of system memory available, the length of time for which you need to run the profiler, and the performance implications of the mode that you choose.
Note You can insert the data collected by the kernel profiler into a CeLog data stream instead of buffering the data. Microsoft does not recommend inserting profiler data into a CeLog data stream because Windows CE does not currently provide a way to view the data captured with CeLog.
See Also
Controlling the Kernel Profiler | Kernel Profiler Modes
Send Feedback on this topic to the authors