RealView® Debugger Trace User Guide

Version 4.0


Table of Contents

Preface
About this book
Intended audience
Using this book
Conventions
Further reading
Feedback
Feedback on this product
Feedback on this book
1. Introduction to Tracing
1.1. About Tracing in RealView Debugger
1.2. Requirements for tracing
1.2.1. Trace hardware
1.2.2. Simulators
1.3. Features for setting up the conditions for trace capture
1.3.1. Capturing data trace
1.3.2. Capturing trace information for profiling
1.4. Tracing with RealView Debugger commands
1.5. Available resources
1.5.1. Trace hardware components
1.5.2. RealView ARMulator ISS
1.6. Using the examples
2. Getting Started with Tracing
2.1. Preparations for tracing
2.2. About the trace hardware setup
2.2.1. ASIC that supports trace
2.2.2. Trace Port Analyzer
2.2.3. JTAG interface unit
2.3. About the Analysis window
2.3.1. Displaying the Analysis window
2.3.2. Equivalent CLI commands for various Analysis window features
2.4. Basic RealView Debugger tracing procedure
2.4.1. Before you start
2.4.2. Basic procedure for hardware that does not support CoreSight
2.4.3. Basic procedure for hardware that supports CoreSight
2.5. Configuring trace from a Cortex-R4 processor and a CoreSight ETM
2.6. Configuring trace from a Cortex-R4 processor and a CoreSight ETB
2.7. Connecting to an analyzer
2.8. Disconnecting from the Analyzer
2.9. Enabling and disabling tracing
2.10. Setting up new trace conditions on a running processor
2.11. Capturing trace output
2.11.1. Displaying captured trace on a stop condition
2.12. Profiling trace information
2.12.1. Profiling with ETM-enabled hardware
2.12.2. Profiling with RVISS
3. Configuring the Conditions for Trace Capture
3.1. Setting up the global conditions for trace capture
3.2. Setting up the conditions for profiling captured trace
3.3. Capturing trace without using tracepoints
3.4. Capturing trace with tracepoints
3.5. Setting tracepoints
3.6. Setting tracepoints on exception vectors
3.7. Configuring common trace options
3.7.1. Configuring analyzer settings for ETM-enabled targets
3.7.2. Setting the size of the trace buffer (RVISS targets only)
3.7.3. Storing only control-flow changes
3.7.4. Configuring the behavior when the trace buffer is full
3.7.5. Configuring how trace information is collected at a trigger
3.7.6. Specifying the type of information to collect for data transfer instructions
3.7.7. Configuring automatic tracing
3.7.8. Setting and Editing Event Triggers
3.7.9. Clearing All Event Triggers
3.7.10. Configuring the address and signal controls of your target processor
4. Configuring the ETM
4.1. About configuring the ETM
4.1.1. ETM with Lock Access implemented causes APB lock up
4.2. Displaying the Configure ETM dialog box
4.2.1. Configure ETM dialog box for ETMv1
4.2.2. Configure ETM dialog box for ETMv3
4.3. Configuring the ETM parameters
4.3.1. Trace data width
4.3.2. Trace port mode (ETMv1)
4.3.3. Trace port mode (ETMv3)
4.3.4. Trace buffer packing
4.3.5. FIFO overflow protection
4.3.6. Trace coproc register transfer
4.3.7. Extended external input selection (ETMv3.1 and later)
4.3.8. Memory map decode
4.3.9. Synchronization frequency (ETMv3)
4.3.10. Enable Timestamping
4.3.11. Cycle accurate tracing
4.3.12. Data only trace (Do not trace instructions) (ETMv3.1 and later)
4.3.13. Suppress data on FIFO full
4.3.14. ETM Pairing
4.4. Equivalent ETM_CONFIG CLI command qualifiers
5. Tracepoints in RealView Debugger
5.1. About tracepoints
5.2. Tracepoint types
5.2.1. Trigger
5.2.2. Trace Start Point and Trace End Point
5.2.3. Trace Range
5.2.4. ExternalOut Points
5.3. Setting trace ranges in conjunction with trace start and end points
6. Setting Unconditional Tracepoints
6.1. About setting unconditional tracepoints
6.2. Capturing instructions and data
6.3. Setting a trigger point
6.4. Setting a trace start and end point
6.5. Setting a trace range
6.6. Setting an ExternalOut Point
6.7. Equivalent CLI commands used by the New Tracepoint dialog box
6.8. Setting a trace range for selected source lines or disassembly
6.8.1. CLI command used for setting an instruction-only trace range
6.9. Setting unconditional tracepoints with the Create Tracepoint dialog box
6.9.1. RVISS targets
6.9.2. ETM-based targets
6.10. Setting tracepoints from your Favorites List
7. Setting Conditional Tracepoints
7.1. About setting conditional tracepoints
7.2. Common parameters for setting conditional tracepoints
7.2.1. Tracepoint types
7.2.2. Tracepoint comparison types
7.2.3. Entering addresses, address ranges, and data address comparisons
7.2.4. Entering data value comparisons
7.2.5. External Conditions
7.3. Setting a tracepoint to trace a specific memory access
7.4. Setting a tracepoint to trace a specific data value
7.5. Setting tracepoints to test for external conditions
7.6. Setting a tracepoint that activates after a number of passes
7.7. Setting tracepoints to trace accesses of a specific size
7.8. Setting tracepoints to trace instruction execution status
7.9. Setting tracepoints to trace accesses on a specific security level
7.10. Setting a Trace on X after Y [and/or Z] tracepoint chain
7.11. Setting a Trace on X after Y executed N times tracepoint chain
7.12. Setting a Trace on X after A==B tracepoint chain
7.13. Setting a Trace if A==B in X tracepoint chain
7.14. Chaining tracepoints
7.14.1. Chaining tracepoints with command qualifiers
8. Managing Tracepoints
8.1. About managing tracepoints
8.2. Editing tracepoints
8.3. Disabling tracepoints
8.4. Deleting tracepoints
8.5. Creating tracepoint favorites
8.6. Finding source code corresponding to a tracepoint
9. Analyzing Trace with the Analysis Window
9.1. About analyzing trace with the Analysis window
9.1.1. Understanding the current state of the trace
9.1.2. Status messages in the captured trace
9.1.3. Profiling in RealView Debugger
9.2. Changing the displayed trace details
9.2.1. Changing the columns displayed in the Trace view
9.2.2. Displaying all trace entries
9.2.3. Displaying instructions for trace entries
9.2.4. Displaying data for trace entries
9.2.5. Displaying instruction boundaries
9.2.6. Displaying function boundaries
9.2.7. Interleaving source with the trace output
9.2.8. Displaying inferred registers
9.2.9. Displaying the captured trace for each processor in a multiprocessor system
9.3. Viewing the captured trace
9.3.1. About the Trace tab
9.3.2. Tracking trace buffer lines in the Code window
9.3.3. Calculating the time between two points
9.3.4. Showing the current position relative to the trigger point
9.3.5. Changing the default format of time information
9.3.6. Specifying the processor speed for cycle/time computations
9.3.7. Automatically updating the trace information in the Analysis window
9.3.8. Updating the captured trace information
9.3.9. Copying trace to the clipboard
9.3.10. Clearing the trace buffer
9.4. Finding information in captured trace
9.4.1. Finding the location of the trigger point
9.4.2. Finding a specific element number in the trace output
9.4.3. Finding a specific timestamp value
9.4.4. Finding a specific address
9.4.5. Finding a specific data value
9.4.6. Finding a specific symbol name
9.4.7. Finding the next instance of the previously searched item
9.4.8. Finding the previous instance of the previously searched item
9.5. Filtering information in captured trace
9.5.1. Filtering for specific element numbers
9.5.2. Filtering for specific timestamp values
9.5.3. Filtering for specific addresses
9.5.4. Filtering for specific data values
9.5.5. Filtering for specific symbol names
9.5.6. Filtering for specific access types
9.5.7. Filtering for specific percentages of execution time
9.5.8. Setting the AND condition for selected filters
9.5.9. Setting the OR condition for selected filters
9.5.10. Inverting the sense of the selected filters
9.5.11. Clearing filters
9.6. Viewing source for the captured trace
9.7. Viewing captured profiling information
9.7.1. Abandoning the profiling operation
9.7.2. Collecting profiling data
9.7.3. Changing the columns displayed in the Profile view
9.7.4. Viewing call-graph data in the Profile view
9.7.5. Interpreting profiling data
9.7.6. Sorting profiling information
9.8. Copying selected text from the trace output
9.9. Saving and loading trace information
9.9.1. Trace file formats
9.9.2. Saving the trace buffer to a file
9.9.3. Saving a filtered trace buffer to a file
9.9.4. Loading the trace buffer from a file
9.9.5. Closing a loaded file
9.10. Changing the current connection
9.11. Attaching the Analysis window to the current connection
9.12. Mapping Analysis window options to CLI commands and qualifiers
9.12.1. File menu options
9.12.2. Edit menu options
9.12.3. View menu options
9.12.4. Find menu options
9.12.5. Filter menu options
10. Tracing Tutorial
10.1. About the tracing tutorial
10.1.1. About the trace hardware
10.1.2. About the sample application
10.2. Preparing to start the tracing tutorial
10.2.1. Procedure
10.3. Running from application reset to a breakpoint
10.3.1. Tracing features used
10.3.2. Procedure
10.3.3. Examining the captured trace
10.4. Running to a second breakpoint
10.4.1. Tracing features used
10.4.2. Procedure
10.4.3. Examining the captured trace
10.4.4. Interleaving source in the Trace view
10.5. Using a trace start point
10.5.1. Tracing features used
10.5.2. Procedure
10.5.3. Examining the captured trace
10.6. Using trace start and end points to trace and time a function
10.6.1. Tracing features used
10.6.2. Procedure
10.6.3. Examining the captured trace
10.6.4. Considerations when performing timing measurements
10.7. Comparing trace start and end points with a trace range
10.7.1. Tracing features used
10.7.2. Tracing with trace start and end points
10.7.3. Examining trace captured with trace start and end points
10.7.4. Tracing with a trace range
10.7.5. Examining trace captured with a trace range
10.8. Excluding a trace range to avoid tracing a function
10.8.1. Tracing features used
10.8.2. Procedure
10.8.3. Examining the captured trace
10.9. Tracing data with auto trace
10.9.1. Tracing features used
10.9.2. Procedure
10.9.3. Examining the captured trace
10.9.4. Displaying instruction boundaries
10.9.5. Displaying function boundaries
10.9.6. Displaying inferred registers
10.10. Tracing data with trace ranges
10.10.1. Tracing features used
10.10.2. Procedure
10.10.3. Examining the captured trace
10.11. Tracing data accesses to a specific address
10.11.1. Tracing features used
10.11.2. Procedure
10.11.3. Examining the captured trace
10.12. Tracing data accesses to addresses in an address range
10.12.1. Tracing features used
10.12.2. Procedure
10.12.3. Examining the captured trace
10.13. Collecting trace on a running target
10.13.1. Tracing features used
10.13.2. Capturing trace by disconnecting and connecting the analyzer
10.13.3. Capturing trace by disabling tracing
10.13.4. Displaying capturing trace with a trigger
10.13.5. Examining trace captured with a trigger
10.14. Using triggers to collect trace around a specific instruction
10.14.1. Tracing features used
10.14.2. Capturing trace before a trigger
10.14.3. Capturing trace around a trigger
10.14.4. Capturing trace after a trigger
10.14.5. Examining the captured trace
10.15. Using triggers to collect trace around a specific data access
10.15.1. Tracing features used
10.15.2. Capturing trace before a trigger
10.15.3. Capturing trace around a trigger
10.15.4. Capturing trace after a trigger
10.15.5. Examining the captured trace
10.16. Capturing profiling information
10.16.1. Tracing features used
10.16.2. Capturing the initial profiling information
10.16.3. Examining the profiling data
10.16.4. Summing profiling data over multiple runs
10.16.5. Profiling results obtained with 4-bit data width and Quad packing
10.17. Setting up a conditional tracepoint
10.17.1. Tracing features used
10.17.2. Procedure
A. Setting up the Trace Hardware
A.1. RealView Trace and RealView ICE
A.2. Embedded Trace Buffer and RealView ICE
B. Setting up the Trace Software
B.1. ETM and RealView Trace
B.1.1. Configuring RealView ICE and RealView Trace to access an ETM
B.2. ETB and RealView ICE
B.2.1. Configuring RealView ICE to access the ETB
B.3. CoreSight ETM and RealView Trace
B.3.1. Configuring your CoreSight development platform
B.4. CoreSight ETB and RealView ICE
B.4.1. Configuring your CoreSight development platform
B.4.2. Configuring RealView ICE to access the CoreSight ETB
C. Status Messages in Captured Trace
C.1. Error messages
C.1.1. Error: Synchronization Lost
C.1.2. Error: ETM FIFO Overflow
C.1.3. Error: Coprocessor data transfer of unknown size
C.1.4. Error: Data synchronization lost following FIFO overflow
C.1.5. Error: Trace branch address does not match instruction’s branch address
C.1.6. Error: Unexpected exception
C.1.7. Error: Instruction not known
C.1.8. Error: Incorrect synchronization address
C.1.9. Error: Instruction data overflowed end of buffer
C.1.10. Error: The next instruction was traced as a branch
C.1.11. Error: The next instruction was not traced as an indirect branch
C.1.12. Error: The next instruction was traced as a memory access instruction
C.1.13. Error: The next instruction should have been executed unconditionally
C.1.14. Error: Corrupt address in trace data
C.1.15. Error: The next instruction was not traced as a branch
C.1.16. Error: The next instruction could not be read
C.2. Warning messages
C.2.1. Warning: Debug State
C.2.2. Warning: Trace Pause
C.2.3. Warning: Instruction address synchronization has been restored
C.2.4. Warning: Unable to trace Jazelle state, trace data ignored
C.2.5. Warning: Data address synchronization restored
C.2.6. Warning: No data in trace buffer
C.2.7. Warning: Data synchronization restored
C.2.8. Warning: Too many checkpoints in XScale trace buffer
C.2.9. Warning: Memory address unknown, insufficient trace data
C.2.10. Warning: Data suppression protected ETM FIFO from overflow

List of Figures

1. Key to event timing diagram conventions
2.1. Trace hardware setup with ETM
2.2. Trace hardware setup with ETB
2.3. Trace hardware setup with CoreSight ETM
2.4. Trace hardware setup with CoreSight ETB
2.5. Analysis window
2.6. Prompt displayed on a running target (tracepoints)
2.7. Prompt displayed on a running target (global trace conditions)
3.1. Setting the size of the trace buffer
4.1. The Configure ETM dialog box for ETMv1
4.2. The Configure ETM dialog box for ETMv3
5.1. Trace start and end points within a trace range
5.2. Trace end point within a trace range
6.1. New Tracepoint dialog box
6.2. New Tracepoint dialog box
6.3. New Tracepoint dialog box
6.4. New Tracepoint dialog box
6.5. Create Tracepoint dialog box (RVISS targets)
6.6. Create Tracepoint dialog box (ETM-based targets)
6.7. Favorites/Chooser Editor dialog box
7.1. Create Tracepoint dialog box
7.2. Create Tracepoint dialog box
7.3. Create Tracepoint dialog box
7.4. Create Tracepoint dialog box
7.5. Create Tracepoint dialog box
7.6. Create Tracepoint dialog box
7.7. Create Tracepoint dialog box
7.8. Trace on X after Y [and/or Z] dialog box
7.9. Trace on X after Y executed N times dialog box
7.10. Trace on X after A==B dialog box
7.11. Trace if A==B in X dialog box
8.1. The Break/Tracepoints view
8.2. Create Tracepoint dialog box
8.3. Favorites/Chooser Editor dialog box
8.4. New/Edit Favorite dialog box
9.1. Example of the Analysis window
9.2. Example of inferred registers
9.3. Connection menu
9.4. Time measurement from selected line dialog box
9.5. Time measurement from trigger dialog box
9.6. Defining processor speed
9.7. Finding a position match
9.8. Finding a time match
9.9. Finding an address expression match
9.10. Finding a data value match
9.11. Finding a symbol name match
9.12. Filtering on a position match
9.13. Filtering on a time match
9.14. Filtering on an address expression match
9.15. Filtering on a data value match
9.16. Filtering on a symbol name match
9.17. Filtering on an access type match
9.18. Filtering on a percent time match
9.19. Profile tab
9.20. Example histogram
9.21. Example of call-graph information
9.22. Example call-graph data (Parent/Child %ages Relative to Whole Time)
9.23. Example call-graph data (Parent/Child %ages Relative to Function B=>E)
9.24. Example call-graph data (Parent/Child %ages Relative to Parent/Child B=>E)
10.1. Memory Map tab
10.2. Image details in the memory map
10.3. Analysis window
10.4. Simple breakpoint set to force display of captured trace
10.5. Captured trace shown in the Analysis window
10.6. Debug state entered
10.7. Tracing stops before the breakpointed instruction
10.8. Execution stopped in Init() function
10.9. Simple breakpoint set to force display of captured trace
10.10. Captured trace shown in the Analysis window
10.11. Select trace sample
10.12. Source line corresponding to select trace sample
10.13. Interleaved source in the Trace view
10.14. Trace Start Point set
10.15. Trace capture from a Trace Start Point
10.16. Trace Start Point set at start of a function
10.17. Trace End Point set at end of a function
10.18. Captured trace
10.19. Trace discontinuity
10.20. Disassembly view
10.21. Trace Start Point set
10.22. Disassembly view
10.23. Trace End Point set
10.24. Captured trace in Analysis window
10.25. Searched function in Trace view
10.26. Source code corresponding to searched function
10.27. Searched address in the Trace view
10.28. Disassembly view
10.29. Start of Trace Range set
10.30. Disassembly view
10.31. End of Trace Range set
10.32. Captured trace in Analysis window
10.33. Captured trace showing function calls only are traced
10.34. Break/Tracepoints view showing a tracepoint
10.35. Disassembly view
10.36. Trace Start Point set
10.37. Start of Excluded Trace Range set at line 142
10.38. End of Excluded Trace Range set at line 151
10.39. Captured trace in Analysis window
10.40. Searched function in Trace view
10.41. Captured trace near the GetData() function
10.42. Captured trace near the GetAverage() function
10.43. Watch view
10.44. Captured trace in Analysis window
10.45. Data/Hex column displayed in the Analysis window
10.46. Searched function in Trace view
10.47. Data trace samples for SendData()
10.48. Corresponding source view
10.49. Write of average to output_port
10.50. Instruction boundaries in the trace view
10.51. Function boundaries in the trace view
10.52. Inferred registers in the Trace tab
10.53. Start of Trace Range set
10.54. End of Trace Range set
10.55. Captured trace in Analysis window
10.56. Captured trace showing discontinuity between runs of SendData()
10.57. Filtered address in the Trace view
10.58. Create Tracepoint dialog box
10.59. Captured trace in Analysis window
10.60. Captured trace of data reads from average
10.61. Disassembly view of the input[] array
10.62. Trace range set in the disassembly view
10.63. Captured trace of data reads from the input[] array
10.64. Source code corresponding to captured trace
10.65. Captured trace from a running target
10.66. Captured trace after disabling trace for a running target
10.67. Prompt to stop tracing when setting a tracepoint
10.68. Trace captured with a trigger
10.69. Trace captured before a trigger
10.70. Captured trace before the trigger point
10.71. Trace captured around a trigger
10.72. Captured trace around the trigger point
10.73. Trace captured after a trigger
10.74. Captured trace after the trigger point
10.75. Captured trace from RealView Trace when stopped at a trigger
10.76. Captured trace after 10 passes
10.77. Create Tracepoint dialog box
10.78. Trace captured before a trigger
10.79. Captured trace before the trigger
10.80. Create Tracepoint dialog box
10.81. Trace captured around a trigger
10.82. Captured trace around the trigger
10.83. Create Tracepoint dialog box
10.84. Trace captured after a trigger
10.85. Captured trace after the trigger
10.86. Captured trace for the port trigger
10.87. Setting a trace start point
10.88. Results displayed in the Profile tab (Normal packing)
10.89. Call-graph data displayed in the Profile tab
10.90. Call-graph data for Func_2
10.91. Summing profiling data over multiple runs
10.92. Results displayed in the Profile tab (Quad packing)
10.93. Trace on X after Y executed N times dialog box
10.94. Completed conditional tracepoint dialog box
10.95. Break/Tracepoints view with conditional tracepoints set
10.96. Trace line for the trigger point
A.1. Connections for RealView ICE and RealView Trace
B.1. RVConfig dialog box
B.2. Device Properties dialog box
B.3. CSETM registers in the Registers view
B.4. CSTPIU registers in the Registers view
B.5. CSETB registers in the Registers view
B.6. RVConfig dialog box
B.7. Device Properties dialog box

Proprietary Notice

Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM Limited in the EU and other countries, except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Unrestricted Access is an ARM internal classification.

Product Status

The information in this document is final, that is for a developed product.

Revision History
Revision AMarch 2006Release v3.0 for RealView Development Suite v3.0
Revision BMarch 2007Release v3.1 for RealView Development Suite v3.1
Revision CSeptember 2008Release v4.0 for RealView Development Suite v4.0
Revision D27 March 2009Release v4.0.1 for RealView Development Suite v4.0
Copyright © 2006-2009 ARM Limited. All rights reserved.ARM DUI 0322D
Non-Confidential