![](http://datasheet.mmic.net.cn/370000/ST20-SWC-PC_datasheet_16733502/ST20-SWC-PC_14.png)
ST20–SWC
14/21
4
Three profiling tools are supplied for analyzing the behavior of application programs; the execution
profiler, the utilization monitor, and the test coverage and block profiling tool. The monitoring data is
stored in the target processor’s memory, so the profiling tools have little execution overhead on the
application. After the program has completed execution, the monitoring data is extracted from the
processor and is analyzed to provide displays on the program execution.
The tools provided are the execution profiler, the utilization monitor, and the test coverage and block
profiling tool. The execution profiler estimates the time spent in each function and procedure, the
processor idle time and various other statistics. The utilization monitor displays a Gantt chart of the
CPU activity of the processor as time progresses. The test coverage and block profiling tool counts
how many times each block of code is executed.
Execution analysis tools
4.1
The execution profiler gives an analysis of the total time spent executing each function on each
processor.
It provides the following information on program execution:–
The percentage time spent executing each low priority function.
The percentage time spent executing at high priority.
The percentage idle time of the processor.
The number of low priority calls of each function and where it was called from.
Execution profiler
Processor ”Root”
Idle time 35.3% (19516)
High time 0.1% (37)
Wptr Misses 0
Iptr Misses 0
Resolution 4
-----------------------------------------------------------------------------
Process ”ex” (99.9% processor) (35.666s)
Stack 100.0% (35666) Heap 0.0% (0) Static 0.0% (0)
Function Name | Process | Processor |Samples
-----------------------------------------------------------------------------
libc.lib/getc | 11.4 | 11.4 |4081
cc/pp.c/pp_rdch0 | 10.1 | 10.1 |3605
cc/bind.c/globalize_memo | 6.9 | 6.9 |2467
cc/pp.c/pp_process | 4.3 | 4.3 |1525
cc/pp.c/pp_rdch3 | 4.2 | 4.2 |1497
cc/pp.c/pp_rdch2 | 3.9 | 3.9 |1380
cc/pp.c/pp_rdch1 | 3.8 | 3.8 |1354
cc/pp.c/pp_rdch | 3.5 | 3.5 |1252
cc/pp.c/pp_nextchar | 3.3 | 3.3 |1189
cc/pp.c/pp_checkid | 3.2 | 3.2 |1150
cc/lex.c/next_basic_sym | 2.7 | 2.7 |979
libc.lib/strcmp | 2.3 | 2.3 |812
libc.lib/DummySemWait | 2.2 | 2.2 |784
libc.lib/sub_vfprintf | 1.7 | 1.7 |617
Figure 10
Example output from the execution profiler
The execution of the user program is monitored by a profiling kernel. The presence of the profiler
kernel will slow the execution of the program by less than 5%.
4.2
The utilization monitor shows in graphical form the utilization of the processor over the time of the
program execution. This is displayed by an interactive program that draws a chart of processor
Utilization monitor