real time trace & real time profilling configure trace32 to record trace information in a...
TRANSCRIPT
Able.zhou
Real Time Trace & Real Time Profilling
Trace Streaming Real Time Profiling
2012/8/23 Thursday Lauterbach Academy Confidential Documents 1
Trace Streaming
2012/8/23 Thursday Lauterbach Academy Confidential Documents 2
Introduction
System Background
Streaming File
Streaming in Use
Introduction
The term Trace Streaming : means the recording, processing, and optional storage of streams of
trace data, while the target system is running and emitting new trace data.
Trace display and analysis is performed after the recording stopped
2012/8/23 Thursday Lauterbach Academy Confidential Documents 3
Introduction
Trace Streaming is one method to deal with Streamed data
2012/8/23 Thursday Lauterbach Academy Confidential Documents 4
Why do we need Trace Streaming
2012/8/23 Thursday Lauterbach Academy Confidential Documents 5
For our customer the trace memory is never big enough
System Background
A PowerTrace-II with AutoFocus-II preprocessor An Gbit Ethernet interface A fast host PC, especially for the cycle accurate analysis and
for nested analysis. A 64bit executable and OS are required for handling traces >
2G Frames target with ETMv3, Coresight,Nexus or PTM
2012/8/23 Thursday Lauterbach Academy Confidential Documents 6
System Background
Technical requirement
1. Compact raw data 2. Flexibility with respect to the time stamp 3. A good data compression before streaming 4. A good data compression before saving on the drive
2012/8/23 Thursday Lauterbach Academy Confidential Documents 7
The average data rate at the trace port should not exceed the maximum transmission rate between the trace memory of the tool and the host
System Background
Compact raw data (reduce information to be recorded)
1. Switch data-trace off 2. Configure the trace logic to generate trace information in a compact way e.g. Branch History Messaging for NEXUS on MPC5xxx/SPC56x Caveats: compact raw data reduce the accuracy of the TRACE32
hardware time-stamp 3. Configure TRACE32 to record trace information in a compact way e.g. ETM.PortFilter PACK for all ETMs Caveats: compact raw data reduce the accuracy of the TRACE32
hardware time-stamp
2012/8/23 Thursday Lauterbach Academy Confidential Documents 8
System Background
Flexibility with respect to the time stamp
Default 128 bit frames if no time stamp information is required the amount of
streaming data can be reduced. eg. ETM.PortFilter MAX for all ETMv3 and higher Smaller 64 bit frames (8x8 4x16 2x32) 2012/8/23 Thursday Lauterbach Academy Confidential Documents 9
96 bit trace raw data 32 bit time stamp
64 bit trace raw data
System Background
Good data compression (reduce information to be streamed) 1. PowerTrace II provides a FPGA-based hardware compression for the
trace information for the ETMv3 and higher (factor 6) 2. Otherwise software compression is used (factor 3)
Trace.STREAMCompression LOW | MID | HIGH 3. Trace.STREAMCompression MID | HIGH (on host: decompress –
compress - zip)
Max transmission rate: Trace memory of tool → host The command IFTEST /Warp provides an estimate of the transmission rate
2012/8/23 Thursday Lauterbach Academy Confidential Documents 10
System Background
Transmission rates 1. Max transmission rates for trace memory in CombiProbe
• Power Debug USB 2 about 14 MByte/s • Power Debug Ethernet about 10 MByte/s • PowerDebug II about 62 MByte/s
2. Max transmission rates for trace memory in PowerTrace • PowerTrace Ethernet /USB 2.0: about 14 MByte/s • PowerTrace Ethernet: about 10 MByte/s
3. Max transmission rates for trace memory in PowerTrace II • PowerDebug II & PowerTrace II/USB 2.0 about 14 MByte/s • PowerDebug II & PowerTrace II about 60 MByte/s
2012/8/23 Thursday Lauterbach Academy Confidential Documents 11
Streaming File
Default location
1. TRACE32 temp directory (OS.PTD()) • e.g. C:\Users\amartin\AppData\Local\Temp\
Default file name
1. <TRACE32_instance_ID>streama.t32 • e.g. andT32_1000004streama.t32
Default size limitation 1. less the 1 GByte free memory left on drive
2012/8/23 Thursday Lauterbach Academy Confidential Documents 12
Streaming File
User-defined location/file name
1. Trace.STREAMFILE <file> • e.g. Trace.STREAMFILE d:/temp/mystream.t32
User-defined size limitation 1. Trace.STREAMFileLimit <limit in bytes>
• e.g. Trace.STREAMFileLimit 5000000000 // 5 Gbyte as max.size • e.g. Trace.STREAMFileLimit -5000000000 // less then 5 Gbyte free memory left on the drive
2012/8/23 Thursday Lauterbach Academy Confidential Documents 13
Streaming in Use
Trace32 Configuration(Trace.Mode STREAM)
2012/8/23 Thursday Lauterbach Academy Confidential Documents 14
Streaming in Use
TRACE32 Configuration (ETMv3 – Code Coverage) ... ETM.DataTrace OFF ETM.PortFilter MAX Trace.STREAMCompression HIGH Trace.STREAMFileLimit 10000000000. Trace.STREAMFILE d:/temp/mystream.t32 Trace.Mode STREAM Trace.AutoInit ON ...
2012/8/23 Thursday Lauterbach Academy Confidential Documents 15
Streaming in Use
TRACE32 Configuration (NEXUS Power Architecture - extended)
... NEXUS.HTM ON Trace.STREAMFileLimit 10000000000. Trace.STREAMFILE d:/temp/mystream.t32 Trace.Mode STREAM ...
2012/8/23 Thursday Lauterbach Academy Confidential Documents 16
Streaming in Use
2012/8/23 Thursday Lauterbach Academy Confidential Documents 17
Streaming in Use
2012/8/23 Thursday Lauterbach Academy Confidential Documents 18
Streaming in Use
2012/8/23 Thursday Lauterbach Academy Confidential Documents 19
Streaming in Use
When the technical requirement are fulfilled, Trace STREAMing is useful: • Whenever the customer wants to extend his trace memory size • For Trace-based Code-Coverage in one measurement step
2012/8/23 Thursday Lauterbach Academy Confidential Documents 20
Real Time Profilings
2012/8/23 Thursday Lauterbach Academy Confidential Documents 21
Distinction streaming and Profiling
Requirements for Real-Time Profiling
RTP Explanation with Demos
Feature outlook
Distinction between Streaming and Real-Time Profiling Streaming (of raw trace data to disk)
Real-time Profiling(live update of changing results)
2012/8/23 Thursday Lauterbach Academy Confidential Documents 22
Real Time Profiling
Real-time Profiling: 1. live processing 2. live update of changing results 3. live writing to disk
2012/8/23 Thursday Lauterbach Academy Confidential Documents 23
Requirements for Real-Time Profiling
PowerTrace II with Autofocus I or CombiProbe Gbit Ethernet interface (USB is too slow) A fast host machine A host with 64bit OS is for large data sets >2G Frames An ARM target with ETMv3, Coresight or PTM
2012/8/23 Thursday Lauterbach Academy Confidential Documents 24
Requirements for Real-Time Profiling (Setup)
Working system setup for conventional tracing (No flow errors!) and enabling
Analyzer.ACCESS VM:
Copy all executed program code to the debugger's VM: 1. including interrupt and exception handlers and vectors 2. Necessary to decode the trace data stream without accessing the
target
All symbol information (“.elf files”) need to be loaded 1. required for decoding the trace data (RTS.ON) 2. required for interpreting the RTP file (RTS.LOAD)
2012/8/23 Thursday Lauterbach Academy Confidential Documents 25
Real-Time Profiling Setup
Copy all code to the debugger's VM:. 1. Copy ALL executed code to the VM: 2. Copy REALLY ALL executed code to the VM:. (including exception vectors, break & interrupts handlers, …) 3. Copy all code to the VM:
e.g. using Data.Load somefile.elf /plusVM Data.COPY P:0x8000++0x2000 VM:0x8000
2012/8/23 Thursday Lauterbach Academy Confidential Documents 26
RTP Explanation
RTP Operation modes Overview
2012/8/23 Thursday Lauterbach Academy Confidential Documents 27
Operation modes RTS.OFF, RTS.ON
RTS.OFF : no recording, no processing RTS.ON : recording and processing of data
live display of constantly updated results (RTS.STAT.*) live display of recorded trace data (RTS.LIST)
processing options: RTS.NestingMode.Flat : flat processing RTS.NestingMode.Tree : nested processing (call tree)
timing options : RTS.TImeMode.OFF : no real-time information RTS.TImeMode.Sampling : low-res ticks from preprocessor RTS.TImeMode.CycleAccurate : ETM-cycle accurate mode
2012/8/23 Thursday Lauterbach Academy Confidential Documents 28
Demo
Debugger Setup RTS.ON RTS.ISTATistics RTS.STATistics RTS.LIST
2012/8/23 Thursday Lauterbach Academy Confidential Documents 29
Operation mode RTS.LOAD
RTS.LOAD Accesses all information available in the RTS file that was recorded in the session with RTS.ON. Utilizes identical display commands RTS.ISTAT, RTS.STAT, RTS.LIST
RTS.FILE select streaming file name (used in RTS.ON, RTS.LOAD)
RTS.ON supports the following file options: RTS.FileMode.OFF : nothing is written, no RTS file is used RTS.FileMode.Summary : writes processing results RTS.FileMode.Tasks : additionally, writes task switch information RTS.FileMode.Full : additionally, writes full trace data
2012/8/23 Thursday Lauterbach Academy Confidential Documents 30
RTS.FileMode : supported commands by file mode
2012/8/23 Thursday Lauterbach Academy Confidential Documents 31
The Secret Revelations on RTS.ON
RTS.ON overwrites an existing streaming file. Any change in options (RTS.File, RTS. ModeTImMode, …)
resets RTS. If RTS was ON, it performs RTS.OFF / RTS.ON, see above.
2012/8/23 Thursday Lauterbach Academy Confidential Documents 32
2012/8/23 Thursday Lauterbach Academy Confidential Documents 33
Feature Outlook
Profiling for multi-core targets
2012/8/23 Thursday Lauterbach Academy Confidential Documents 34
Thank You!
Q & A
www.lauterbach.com www.lauterbach.cn
2012/8/23 Thursday Lauterbach Academy Confidential Documents 35