Use the Trace view to display a graphical navigation chart that shows function executions with a navigational timeline. In addition, the disassembly trace shows function calls with associated addresses and if selected, instructions. Clicking on a specific time in the chart synchronizes the Disassembly view.
When a trace has been captured, the debugger extracts the information from the trace stream and decompresses it to provide a full disassembly, with symbols, of the executed code.
The left-hand column of the chart shows the percentages of the total
trace for each function. For example, if a total of 1000 instructions are executed
and 300 of these instructions are associated with
myFunction() then this function is displayed with 30%.
In the navigational timeline, the color coding is a heat map showing the executed instructions and the number of instructions each function executes in each timeline. The darker red color shows more instructions and the lighter yellow color shows fewer instructions. At a scale of 1:1 however, the color scheme changes to display memory access instructions as a darker red color, branch instructions as a medium orange color, and all the other instructions as a lighter green color.
Figure 11-44 Trace view with a scale of 100:1
The Trace view might not be visible by default. To add this view:
Ensure that you are in the DS-5 Debug perspective.
Select Window > Show View > Trace.
The Trace view navigation chart contains several tabs:
Trace tab shows the graphical timeline and disassembly.
Capture Device tab gives information about the trace capture device and the trace buffer, and allows you to configure the trace capture.
Source tab gives information about the trace source.
Ranges tab allows you to limit the trace capture to a specific address range.
The Trace tab also shows:
- Buffer Size
Size of the trace buffer to store trace records. This is determined by the trace capture device. The trace records can be instruction records or non-instruction records.
- Buffer Used
Amount of the trace buffer that is already used for trace records.
- Records in Page
The total number of instruction records and non-instruction records in the current Trace view.
- Records Visible
The number of trace records visible in the disassembly area of the Trace view.
Toolbar and context menu options
The following options are available from the toolbar or context menu:
Links this view to the selected connection in the Debug Control view. This is the default. Alternatively you can link the view to a different connection or processor in a Symmetric MultiProcessing (SMP) connection. If the connection you want is not shown in the drop-down list you might have to select it first in the Debug Control view.
- Updating view when hidden
- Not updating view when hidden
Toggles the updating of the view when it is hidden behind other views. By default the view does not update when it is hidden, which might cause loss of trace data.
- Show Next Match
Moves the focus of the navigation chart and disassembly trace to the next matching occurrence for the selected function or instruction.
- Show Previous Match
Moves the focus of the navigation chart and disassembly trace to the previous matching occurrence for the selected function or instruction.
- Don’t mark other occurrences - click to start marking
- Mark other occurrences - click to stop marking
When function trace is selected, marks all occurrences of the selected function with a shaded highlight. This is disabled when instruction trace is selected.
- Clear Trace
Clears the raw trace data that is currently contained in the trace buffer and the trace view.
- Showing instruction trace - click to switch to functions
- Showing function trace - click to switch to instructions
Toggles the disassembly trace between instructions and functions.
- Export Trace Report
Displays the Export Trace Report dialog box to save the trace data to a file.
Where enabled, moves the trace view to the beginning of the trace buffer. Changes might not be visible if the trace buffer is too small.
- Page Back
Where enabled, moves the trace view back one page. You can change the page size by modifying the Set Maximum Instruction Depth setting.
- Page Forward
Where enabled, moves the trace view forward one page. You can change the page size by modifying the Set Maximum Instruction Depth setting.
Where enabled, moves the trace view to the end of the trace buffer. Changes might not be visible if the trace buffer is too small.
- Switch between navigation resolutions
Changes the timeline resolution in the navigation chart.
- Switch between alternate views
Changes the view to display the navigation chart, disassembly trace or both.
- Focus Here
At the top of the list, displays the function being executed in the selected time slot. The remaining functions are listed in the order in which they are executed after the selected point in time. Any functions that do not appear after that point in time are placed at the bottom and ordered by total time.
- Order By Total Time
Displays the functions ordered by the total time spent within the function. This is the default ordering.
- View Menu
The following View Menu options are available:
- New Trace View
Displays a new instance of the Trace view.
- Set Trace Page Size...
Displays a dialog box in which you can enter the maximum number of instructions to display in the disassembly trace. The number must be within the range of 1,000 to 1,000,000 instructions.
- Find Trace Trigger Event
Enables you to search for trigger events in the trace capture buffer.
- Find Timestamp...
Displays a dialog box in which you can enter either a numeric timestamp as a 64 bit value or in the h:m:s format.
- Find Function...
Enables you to search for a function by name in the trace buffer.
- Find Instruction by Address...
Enables you to search for an instruction by address in the trace buffer.
- Find ETM data access in trace buffer...
- Enables you to search for a data value or range of values in the trace buffer.
- Find Instruction Index...
Enables you to search for an instruction by index. A positive index is relative to the start of the trace buffer and a negative index is relative to the end.
- DTSL Options...
Displays a dialog box in which you can add, edit, or choose a DTSL configuration.
NoteThis clears the trace buffer.
- Open Trace Control View
Opens the Trace Control View.
Discards all the data in the view and rereads it from the current trace buffer.
- Freeze Data
Toggles the freezing of data in the current view.
- Trace Filter Settings...
Displays a dialog box in which you can select the trace record types that you want to see in the Trace view.
When your code hits a Trace stop point, the Trace tab shows:
The number of instructions before the Trace stop point. The index at the Trace stop point is 0. The index for the instruction immediately before that is -1, and so on.
The address in memory of the instruction.
The opcode for the instruction expressed in hexadecimal.
The disassembly of the instruction, trace events, and errors.
The unlabeled column (to the right of the Opcode column) displays symbols that give additional information. For example, an exception, a backward branch, an instruction that was canceled before completion, or an instruction that was not executed. Hover your mouse pointer over one of these symbols to display context-sensitive help.
Figure 11-45 Trace view for Cortex-M3 Thumb instructions