| |||
| Home > Tracing Tutorial > Using trace start and end points to trace and time a function > Procedure | |||
To limit the captured trace to a specific function:
Remove the tracepoint and breakpoint you set previously. To do this, select Debug → Breakpoints → Clear All Break/Tracepoints from the Code window main menu.
Reload the image:
Right-click
on the Load Image+Symbols entry in the Process
Control view to display the context menu.
Select Reload from the context
menu. The image is reloaded and the PC is reset to the image entry
point (0x8000).
Enable cycle accurate tracing for the ETM:
Select Configure Analyzer Properties... from the Edit menu of the Analysis window to display the Configure ETM dialog box.
Select Cycle accurate tracing.
Click OK to close the Configure ETM dialog box. RealView Debugger generates an ETM_CONFIG CLI command, which is also displayed in the Cmd tab of the Output view:
etm_config,syncfreq:0,packauto,cycle
Set a Trace Start Point at the start of GetData():
Click the trace.c tab.
Right-click in the gray margin at line 143 to display the context menu.
Select Insert Tracepoint... from the context menu to display the New Tracepoint dialog box.
Select Trace Start Point from the list of tracepoint types.
Click OK. The dialog box
closes, and the Trace Start Point is set as indicated by the green
arrow
. Figure 10.16 shows an example:
RealView Debugger generates a TRACE CLI command, which is also displayed in the Cmd tab of the Output view:
trace,prompt \TRACE\#143:0
The number at the end of the command is a character position, and depends on the position of the mouse pointer when you displayed the context menu.
Set a Trace End Point at the end of GetData():
Click the trace.c tab.
Right-click in the gray margin at line 150 to display the context menu.
Select Insert Tracepoint... from the context menu to display the New Tracepoint dialog box.
Select Trace End Point from the list of tracepoint types.
Click OK. The dialog box
closes, and the Trace End Point is set as indicated by the green
arrow
. Figure 10.17 shows an example:
RealView Debugger generates a TRACE CLI command, which is also displayed in the Cmd tab of the Output view:
trace,prompt \TRACE\#150:0
The number at the end of the command is a character position, and depends on the position of the mouse pointer when you displayed the context menu.
Click Run on
the Debug toolbar to start execution. Captured trace might be displayed
in the Analysis window before you perform the next step.
After
a short time, click Stop on the Debug toolbar
to stop execution. The captured trace is displayed in the Trace tab
of the Analysis window. Figure 10.18 shows an example:
the following in the RealView Debugger Command Line Reference Guide:
Chapter 2 RealView Debugger Commands for details of the ETM_CONFIG and TRACE commands.