Profiler plugin

Profiling is a performance analysis technique that identifies the areas in an application where the CPU spends most time. Having identified these areas, it is then possible to target optimization efforts on the specific parts of the code that will yield the greatest benefit in terms of improving performance.

When a connection is made to the target using an ST Micro Connect, commands may be issued through GDB to instruct the ST Micro Connect to collect sampling information about a running application. This data is stored in a file and can then be analyzed using a profiling tool (such as STWorkbench or sh4gprof).

The profile plugin provides two different types of profiling

TypeDescription
traceThe profiler samples the PC over a given period, time stamping each sample. This method provides a view of the application's activities over a period of time. See Trace profile output format.
rangeThe profiler accumulates the number of times that a particular region of the application's code is executed (in the manner of gprof; see the GNU gprof documentation for more details). See Range profiler output format.

Profiling operates in one of three modes

ModeDescription
noneIn this mode, the profiler collects samples only when the target stops at a breakpoint or an I/O request.
udiThis mode provides non-intrusive sampling to obtain the current address on the instruction bus.
interrruptThis mode stops the target to read the PC directly before continuing. This mode has a significant impact on the real-time performance of the target, but it has the advantage of being able to read the PC directly.

The ST Micro Connect profiler features are accessible through the GDB profiler command.