| |||
| Home > Tracing Tutorial > Tracing data accesses to a specific address > Procedure | |||
To trace all data accesses to a specific address:
Remove the tracepoints you set previously:
Right-click on the Load Image+Symbols entry
in the Process Control view to display the context menu.
Select Unload from the context menu. The image is unloaded.
Right-click on the Load Image+Symbols entry
in the Process Control view to display the context menu.
Select Load from the context
menu. The image is reloaded and the PC is reset to the image entry
point (0x8000). The tracepoints are removed.
Enable timestamping:
Select Configure Analyzer Properties... from the Edit menu of the Analysis window to display the Configure ETM dialog box.
Select Enable timestamping.
Click OK. The Configure ETM dialog box closes. RealView Debugger generates a ETM_CONFIG CLI command, which is also displayed in the Cmd tab of the Output view:
etm_config,syncfreq:0,packauto,time
Set a tracepoint to trace data accesses to *output_port (address 0x20000):
Select Debug → Tracepoints → Create Tracepoint... from the Code window main menu to display the Create Tracepoint dialog box. Figure 10.58 shows an example.
Select Trace Instr and Data from the tracepoint type drop-down list.
Select Data Access from the
tracepoint comparison type drop-down list (that is, the on field).
Enter the address to be traced (that is, the when field).
In this case, the address to be traced corresponds to the symbol output_port.
Therefore, enter @trace\\output_port.
Because this is a pointer, you do not have to prefix the variable
name with &.
Click OK. The Create Tracepoint dialog box closes, and the tracepoint is set. RealView Debugger generates a TRACEDATAACCESS CLI command, which is also displayed in the Cmd tab of the Output view:
trcdaccess,hw_out:"Tracepoint Type=Trace Instr and
Data" @trace\\output_port
Click Run on
the Debug toolbar to start execution.
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.
Select Clear Filtering from the Filter menu.
Select Function Boundaries from the Trace Data menu to hide the function boundaries. Figure 10.59 shows an example.
The symbol for the data accesses is output_fifo.
This is because the variable output_port used
in the program is assigned to output_fifo at
line 28 in trace.c.
the following in the RealView Debugger Command Line Reference Guide:
Chapter 2 RealView Debugger Commands for details of the ETM_CONFIG, TRACE, TRACEBUFFER, TRACEDATAACCESS, TRACEDATAREAD, and TRACEDATAWRITTE commands.