xref: /aosp_15_r20/external/OpenCSD/decoder/docs/test_progs.md (revision 02ca8ccacfba7e0df68f3332a95f3180334d6649)
1*02ca8ccaSAndroid Build Coastguard WorkerTest Programs    {#test_progs}
2*02ca8ccaSAndroid Build Coastguard Worker=============
3*02ca8ccaSAndroid Build Coastguard Worker
4*02ca8ccaSAndroid Build Coastguard Worker@brief A description of the test programs used with the library.
5*02ca8ccaSAndroid Build Coastguard Worker
6*02ca8ccaSAndroid Build Coastguard WorkerThe Programs
7*02ca8ccaSAndroid Build Coastguard Worker------------
8*02ca8ccaSAndroid Build Coastguard Worker
9*02ca8ccaSAndroid Build Coastguard WorkerThere are currently a number test programs built alongside the library.
10*02ca8ccaSAndroid Build Coastguard Worker
11*02ca8ccaSAndroid Build Coastguard Worker__Principle Test Programs__
12*02ca8ccaSAndroid Build Coastguard Worker
13*02ca8ccaSAndroid Build Coastguard Worker- `trc_pkt_lister`:
14*02ca8ccaSAndroid Build Coastguard Worker
15*02ca8ccaSAndroid Build Coastguard WorkerThis tests the C++ library by taking a trace "snapshot" directory as an input and decodes all
16*02ca8ccaSAndroid Build Coastguard Workeror a chosen set of trace sources from within the trace data buffers in the library. Command
17*02ca8ccaSAndroid Build Coastguard Workerline parameters allow the test program to be controlled.
18*02ca8ccaSAndroid Build Coastguard Worker
19*02ca8ccaSAndroid Build Coastguard WorkerUsers may also run this program on their own trace snapshots to investigate or validate trace from their platforms.
20*02ca8ccaSAndroid Build Coastguard Worker
21*02ca8ccaSAndroid Build Coastguard WorkerThe program may be installed alongside the library onto linux systems, using `make install` from the library build
22*02ca8ccaSAndroid Build Coastguard Workerdirectories. This will be installed alongside a `man` file containing relevant user options.
23*02ca8ccaSAndroid Build Coastguard Worker
24*02ca8ccaSAndroid Build Coastguard Worker- `c_api_pkt_print_test`:
25*02ca8ccaSAndroid Build Coastguard Worker
26*02ca8ccaSAndroid Build Coastguard WorkerThis program tests the "C" API functions, using hardcoded tests based on the same "snapshots" used
27*02ca8ccaSAndroid Build Coastguard Workerfor the C++ library. Limited user control for this program.
28*02ca8ccaSAndroid Build Coastguard Worker
29*02ca8ccaSAndroid Build Coastguard WorkerThis can also run tests using the external test decoder library to validate the external decoder API.
30*02ca8ccaSAndroid Build Coastguard WorkerSee [external_custom.md](@ref custom_decoders) for details.
31*02ca8ccaSAndroid Build Coastguard Worker
32*02ca8ccaSAndroid Build Coastguard Worker__Development Utilities__
33*02ca8ccaSAndroid Build Coastguard Worker
34*02ca8ccaSAndroid Build Coastguard WorkerThese are small utilities, primarily used during the development and test of the decoder library.
35*02ca8ccaSAndroid Build Coastguard Worker
36*02ca8ccaSAndroid Build Coastguard Worker- `mem-acc-test`           : tests the memory accessor interfaces.
37*02ca8ccaSAndroid Build Coastguard Worker- `mem-buffer-eg`          : example using a memory buffer input to the library.
38*02ca8ccaSAndroid Build Coastguard Worker- `frame-demux-test`       : tests the library CoreSight Frame demux object.
39*02ca8ccaSAndroid Build Coastguard Worker- `ocsd-perr`              : quickly list the library error codes and descriptions.
40*02ca8ccaSAndroid Build Coastguard Worker
41*02ca8ccaSAndroid Build Coastguard Worker__Build and Install__
42*02ca8ccaSAndroid Build Coastguard Worker
43*02ca8ccaSAndroid Build Coastguard WorkerAll the test programs are built at the same time as the library for the same set of platforms.
44*02ca8ccaSAndroid Build Coastguard WorkerSee [build_libs.md](@ref build_lib) for build details.
45*02ca8ccaSAndroid Build Coastguard Worker
46*02ca8ccaSAndroid Build Coastguard WorkerOnly `trc_pkt_lister` will be installed alongside the library.
47*02ca8ccaSAndroid Build Coastguard Worker
48*02ca8ccaSAndroid Build Coastguard Worker
49*02ca8ccaSAndroid Build Coastguard WorkerTrace "Snapshot" directory.
50*02ca8ccaSAndroid Build Coastguard Worker----------------------------
51*02ca8ccaSAndroid Build Coastguard Worker
52*02ca8ccaSAndroid Build Coastguard WorkerThe `.\tests\snapshots` and `.\tests\snapshots-ete` directories contain a number of trace snapshots
53*02ca8ccaSAndroid Build Coastguard Workerused for testing the library.
54*02ca8ccaSAndroid Build Coastguard Worker
55*02ca8ccaSAndroid Build Coastguard WorkerTrace snapshots are dumps of captured binary trace data, CoreSight component configurations and memory
56*02ca8ccaSAndroid Build Coastguard Workerdumps to allow trace decode.
57*02ca8ccaSAndroid Build Coastguard Worker
58*02ca8ccaSAndroid Build Coastguard WorkerSnapshots are generated on ARM targets and can then be analysed offline.
59*02ca8ccaSAndroid Build Coastguard Worker
60*02ca8ccaSAndroid Build Coastguard Worker__Snapshot Specification__
61*02ca8ccaSAndroid Build Coastguard Worker
62*02ca8ccaSAndroid Build Coastguard WorkerThe principal snapshot format is available in a separate document in
63*02ca8ccaSAndroid Build Coastguard Worker`.\docs\specs\ARM Trace and Debug Snapshot file format 0v2.pdf`.
64*02ca8ccaSAndroid Build Coastguard Worker
65*02ca8ccaSAndroid Build Coastguard WorkerThe programs above use the library's [core name mapper helper class] (@ref CoreArchProfileMap) to map
66*02ca8ccaSAndroid Build Coastguard Workerthe name of the core into a profile / architecture pair that the library can use.
67*02ca8ccaSAndroid Build Coastguard Worker
68*02ca8ccaSAndroid Build Coastguard WorkerThe snapshot definition must use one of the names recognised by this class, or alternatively use an approved
69*02ca8ccaSAndroid Build Coastguard Workerprofile / architecture profile pattern string as defined below.
70*02ca8ccaSAndroid Build Coastguard Worker
71*02ca8ccaSAndroid Build Coastguard WorkerThere are extensions to this specification, reflecting recent architectural changes.
72*02ca8ccaSAndroid Build Coastguard Worker
73*02ca8ccaSAndroid Build Coastguard Worker**Dump File Section Space Format**
74*02ca8ccaSAndroid Build Coastguard Worker
75*02ca8ccaSAndroid Build Coastguard WorkerThe dump file section in device .ini files can define a memory space associated with the file.
76*02ca8ccaSAndroid Build Coastguard WorkerThis is done using the `space` keyword. Omitting this keyword with cause the test programs to assume
77*02ca8ccaSAndroid Build Coastguard Workerthat the file applies to all memory spaces enccountered in the trace stream
78*02ca8ccaSAndroid Build Coastguard Worker
79*02ca8ccaSAndroid Build Coastguard WorkerFor complex systems, the same virtual addresses may have differing contents in differing memory spaces.
80*02ca8ccaSAndroid Build Coastguard WorkerThe library has extended the memory space names defined in the current specification version to include
81*02ca8ccaSAndroid Build Coastguard Workernew names for the Realm and Root memory spaces.
82*02ca8ccaSAndroid Build Coastguard Worker
83*02ca8ccaSAndroid Build Coastguard WorkerMappings of names to spaces is used as follows :
84*02ca8ccaSAndroid Build Coastguard Worker    - `EL1S` : maps file to EL1 / EL0 secure states.
85*02ca8ccaSAndroid Build Coastguard Worker    - `EL2S` : maps file to EL2 secure state.
86*02ca8ccaSAndroid Build Coastguard Worker    - `EL3`  : maps file to EL3 secure state.
87*02ca8ccaSAndroid Build Coastguard Worker    - `EL1N` : maps file to EL1 / EL0 non-secure state.
88*02ca8ccaSAndroid Build Coastguard Worker    - `EL2` or `EL2N` : maps file to EL2 non-secure state.
89*02ca8ccaSAndroid Build Coastguard Worker    - `EL1R` : maps file to EL1 / EL0 Realm state.
90*02ca8ccaSAndroid Build Coastguard Worker    - `EL2R` : maps file to EL2 Realm state.
91*02ca8ccaSAndroid Build Coastguard Worker    - `ROOT` : maps file to Root state.
92*02ca8ccaSAndroid Build Coastguard Worker    - `S` : maps file to all secure states.
93*02ca8ccaSAndroid Build Coastguard Worker    - `N` : maps file to all non-secure states.
94*02ca8ccaSAndroid Build Coastguard Worker    - `R` : maps file to all Realm states.
95*02ca8ccaSAndroid Build Coastguard Worker    - `ANY` : maps file to all security states. This is default if the `space` keyword is omitted.
96*02ca8ccaSAndroid Build Coastguard Worker
97*02ca8ccaSAndroid Build Coastguard Worker
98*02ca8ccaSAndroid Build Coastguard Workere.g. - Dump section examples with differing memory space definitions.
99*02ca8ccaSAndroid Build Coastguard Worker
100*02ca8ccaSAndroid Build Coastguard Worker   - dump 1 & 2 overlap in address but are in different memory spaces.
101*02ca8ccaSAndroid Build Coastguard Worker   - dump 1 & 3 cover the same memory space, but do not overlap in address.
102*02ca8ccaSAndroid Build Coastguard Worker   - dump 4 covers all memory spaces but does not overlap in address with any of the other dumps.
103*02ca8ccaSAndroid Build Coastguard Worker
104*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
105*02ca8ccaSAndroid Build Coastguard Worker[dump1]
106*02ca8ccaSAndroid Build Coastguard Workerfile=bindir_64ns/OTHERS_exec
107*02ca8ccaSAndroid Build Coastguard Workeraddress=0x00060000
108*02ca8ccaSAndroid Build Coastguard Workerlength=0x21388
109*02ca8ccaSAndroid Build Coastguard Workerspace=N
110*02ca8ccaSAndroid Build Coastguard Worker
111*02ca8ccaSAndroid Build Coastguard Worker[dump2]
112*02ca8ccaSAndroid Build Coastguard Workerfile=bindir_64rt/OTHERS_exec
113*02ca8ccaSAndroid Build Coastguard Workeraddress=0x00060000
114*02ca8ccaSAndroid Build Coastguard Workerlength=0x21388
115*02ca8ccaSAndroid Build Coastguard Workerspace=ROOT
116*02ca8ccaSAndroid Build Coastguard Worker
117*02ca8ccaSAndroid Build Coastguard Worker[dump3]
118*02ca8ccaSAndroid Build Coastguard Workerfile=bindir_64ns/VAL_NON_DET_CODE_exec
119*02ca8ccaSAndroid Build Coastguard Workeraddress=0x00010000
120*02ca8ccaSAndroid Build Coastguard Workerlength=0x24bf4
121*02ca8ccaSAndroid Build Coastguard Workerspace=EL1N
122*02ca8ccaSAndroid Build Coastguard Worker
123*02ca8ccaSAndroid Build Coastguard Worker[dump4]
124*02ca8ccaSAndroid Build Coastguard Workerfile=bindir_64ns/TEST_NON_DET_CODE_exec
125*02ca8ccaSAndroid Build Coastguard Workeraddress=0x00050000
126*02ca8ccaSAndroid Build Coastguard Workerlength=0x26c
127*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
128*02ca8ccaSAndroid Build Coastguard Worker
129*02ca8ccaSAndroid Build Coastguard Worker**Profile / Architecture pattern string**
130*02ca8ccaSAndroid Build Coastguard Worker
131*02ca8ccaSAndroid Build Coastguard WorkerWhere a specific core name is not used - then a profile / architecture pattern string may be used.
132*02ca8ccaSAndroid Build Coastguard WorkerThis enables trace generated on cores with names not in the library to be decoded by the test programs.
133*02ca8ccaSAndroid Build Coastguard Worker
134*02ca8ccaSAndroid Build Coastguard WorkerPattern strings can be of the form:
135*02ca8ccaSAndroid Build Coastguard Worker
136*02ca8ccaSAndroid Build Coastguard Worker`ARMvM[.m]-P` :
137*02ca8ccaSAndroid Build Coastguard Worker    - ARMv   : fixed prefix
138*02ca8ccaSAndroid Build Coastguard Worker    - M      : architecture major version number 7-9.
139*02ca8ccaSAndroid Build Coastguard Worker    - .m     : optional minor version number
140*02ca8ccaSAndroid Build Coastguard Worker    - -P     : profile type, one of -A, -R or -M
141*02ca8ccaSAndroid Build Coastguard Worker
142*02ca8ccaSAndroid Build Coastguard Worker
143*02ca8ccaSAndroid Build Coastguard Workere.g. `ARMv8.3-A`  , `ARMv7-M`
144*02ca8ccaSAndroid Build Coastguard Worker
145*02ca8ccaSAndroid Build Coastguard WorkerThis format can be used for any ARMv7 / ARMv8 core - including ARM Cortex cores where the name is
146*02ca8ccaSAndroid Build Coastguard Workernot one of those mapped in the library.
147*02ca8ccaSAndroid Build Coastguard Worker
148*02ca8ccaSAndroid Build Coastguard Worker
149*02ca8ccaSAndroid Build Coastguard Worker`ARM-{aa|AA}64[-P]` :
150*02ca8ccaSAndroid Build Coastguard Worker    - ARM-   : fixed prefix
151*02ca8ccaSAndroid Build Coastguard Worker    - aa64 or AA64 : indicator for aarch64
152*02ca8ccaSAndroid Build Coastguard Worker    - -P : optional profile - one of -R or -M, if missing A profile is assumed.
153*02ca8ccaSAndroid Build Coastguard Worker
154*02ca8ccaSAndroid Build Coastguard Workere.g. `ARM-aa64` , `ARM-AA64-R`
155*02ca8ccaSAndroid Build Coastguard Worker
156*02ca8ccaSAndroid Build Coastguard WorkerThis format can be used for all Arm v9 architecture cores.
157*02ca8ccaSAndroid Build Coastguard Worker
158*02ca8ccaSAndroid Build Coastguard Worker
159*02ca8ccaSAndroid Build Coastguard WorkerThe `trc_pkt_lister` program.
160*02ca8ccaSAndroid Build Coastguard Worker-----------------------------
161*02ca8ccaSAndroid Build Coastguard Worker
162*02ca8ccaSAndroid Build Coastguard WorkerThis will take a snapshot directory as an input, and lists and/or
163*02ca8ccaSAndroid Build Coastguard Workerdecodes all the trace packets from a given trace sink, for any source in
164*02ca8ccaSAndroid Build Coastguard Workerthat sink where the protocol is supported.
165*02ca8ccaSAndroid Build Coastguard Worker
166*02ca8ccaSAndroid Build Coastguard WorkerThe output will be a list of discrete packets, generic output packets and any error messages
167*02ca8ccaSAndroid Build Coastguard Workerto file and/or screen as selected by the input command line options.
168*02ca8ccaSAndroid Build Coastguard Worker
169*02ca8ccaSAndroid Build Coastguard WorkerBy default the program will list packets only (no decode), for the first discovered trace sink
170*02ca8ccaSAndroid Build Coastguard Worker(ETB, ETF, ETR) in the snapshot directory, with all source streams output.
171*02ca8ccaSAndroid Build Coastguard Worker
172*02ca8ccaSAndroid Build Coastguard Worker__Command Line Options__
173*02ca8ccaSAndroid Build Coastguard Worker
174*02ca8ccaSAndroid Build Coastguard Worker*Snapshot selection*
175*02ca8ccaSAndroid Build Coastguard Worker
176*02ca8ccaSAndroid Build Coastguard Worker- `-ss_dir <dir>` : Set the directory path to a trace snapshot.
177*02ca8ccaSAndroid Build Coastguard Worker- `-ss_verbose`   : Verbose output when reading the snapshot.
178*02ca8ccaSAndroid Build Coastguard Worker
179*02ca8ccaSAndroid Build Coastguard Worker*Decode options*
180*02ca8ccaSAndroid Build Coastguard Worker
181*02ca8ccaSAndroid Build Coastguard Worker- `-id <n>`          : Set an ID to list (may be used multiple times) - default if no id set is for all IDs to be printed.
182*02ca8ccaSAndroid Build Coastguard Worker- `-src_name <name>` : List packets from a given snapshot source name - e.g ETB_0. (defaults to first source found).
183*02ca8ccaSAndroid Build Coastguard Worker- `-multi_session`   : Decode all buffers listed in snapshot under `buffers` key in `trace.ini`. Uses config of first
184*02ca8ccaSAndroid Build Coastguard Worker                       buffer to decode all. Ignored if `-src_name` is used.
185*02ca8ccaSAndroid Build Coastguard Worker- `-dstream_format`  : Input is DSTREAM framed.
186*02ca8ccaSAndroid Build Coastguard Worker- `-tpiu`            : Input data is from a TPIU source that has TPIU FSYNC packets present.
187*02ca8ccaSAndroid Build Coastguard Worker- `-tpiu_hsync`      : Input data is from a TPIU source that has both TPIU FSYNC and HSYNC packets present.
188*02ca8ccaSAndroid Build Coastguard Worker- `-decode`          : Full decode of the packets from the trace snapshot (default is to list undecoded packets only.
189*02ca8ccaSAndroid Build Coastguard Worker- `-decode_only`     : Does not list the undecoded packets, just the trace decode.
190*02ca8ccaSAndroid Build Coastguard Worker- `-src_addr_n`      : ETE protocol; Indicate skipped N atoms in source address packet ranges by breaking the decode
191*02ca8ccaSAndroid Build Coastguard Worker                       range into multiple ranges of N atoms.
192*02ca8ccaSAndroid Build Coastguard Worker- `-o_raw_packed`    : Output raw packed trace frames.
193*02ca8ccaSAndroid Build Coastguard Worker- `-o_raw_unpacked`  : Output raw unpacked trace data per ID.
194*02ca8ccaSAndroid Build Coastguard Worker- `-stats`           : Output packet processing statistics (if available).
195*02ca8ccaSAndroid Build Coastguard Worker
196*02ca8ccaSAndroid Build Coastguard Worker*Consistency Checks*
197*02ca8ccaSAndroid Build Coastguard Worker
198*02ca8ccaSAndroid Build Coastguard Worker- `-aa64_opcode_chk` : Check for correct AA64 opcodes (MSW != 0x0000)
199*02ca8ccaSAndroid Build Coastguard Worker- `-direct_br_cond`  : Check for N atoms on unconditional direct branches.
200*02ca8ccaSAndroid Build Coastguard Worker- `-strict_br_cond`  : Check for N atoms on all unconditional branches.
201*02ca8ccaSAndroid Build Coastguard Worker- `-range_cont`      : Check for address consistency between ranges after none taken branches.
202*02ca8ccaSAndroid Build Coastguard Worker- `-halt_err`        : Halt on packet/image errors - default is to reset and attempt to recover.
203*02ca8ccaSAndroid Build Coastguard Worker
204*02ca8ccaSAndroid Build Coastguard Worker*Output options*
205*02ca8ccaSAndroid Build Coastguard Worker
206*02ca8ccaSAndroid Build Coastguard WorkerDefault is to output to file and stdout. Setting any option overrides and limits to only
207*02ca8ccaSAndroid Build Coastguard Workerthe options set.
208*02ca8ccaSAndroid Build Coastguard Worker- `-logstdout`          : output to stdout.
209*02ca8ccaSAndroid Build Coastguard Worker- `-logstderr`          : output to stderr.
210*02ca8ccaSAndroid Build Coastguard Worker- `-logfile`            : output to file using the default log file name.
211*02ca8ccaSAndroid Build Coastguard Worker- `-logfilename <name>` : change the name of the output log file.
212*02ca8ccaSAndroid Build Coastguard Worker
213*02ca8ccaSAndroid Build Coastguard Worker*Library Development options*
214*02ca8ccaSAndroid Build Coastguard Worker
215*02ca8ccaSAndroid Build Coastguard WorkerOptions that are only useful if developing or testing the OpenCSD library.
216*02ca8ccaSAndroid Build Coastguard Worker
217*02ca8ccaSAndroid Build Coastguard Worker- `-test_waits <N>`  : Force wait from packet printer for N packets - test the wait/flush mechanisms for the decoder.
218*02ca8ccaSAndroid Build Coastguard Worker- `-profile`         : Mute logging output while profiling library performance.
219*02ca8ccaSAndroid Build Coastguard Worker- `-macc_cache_disable` : Switch off caching on memory accessor.
220*02ca8ccaSAndroid Build Coastguard Worker- `-macc_cache_p_size`  : Set size of caching pages.
221*02ca8ccaSAndroid Build Coastguard Worker- `-macc_cache_p_num`   : Set number of caching pages.
222*02ca8ccaSAndroid Build Coastguard Worker
223*02ca8ccaSAndroid Build Coastguard Worker__Test output examples__
224*02ca8ccaSAndroid Build Coastguard Worker
225*02ca8ccaSAndroid Build Coastguard WorkerExample command lines with short output excerpts.
226*02ca8ccaSAndroid Build Coastguard Worker
227*02ca8ccaSAndroid Build Coastguard Worker*TC2, ETMv3 packet processor output, raw packet output.*
228*02ca8ccaSAndroid Build Coastguard Worker
229*02ca8ccaSAndroid Build Coastguard WorkerCommand line:-
230*02ca8ccaSAndroid Build Coastguard Worker`trc_pkt_lister -ss_dir ..\..\..\snapshots\TC2 -o_raw_unpacked`
231*02ca8ccaSAndroid Build Coastguard Worker
232*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
233*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index  17958; ID_DATA[0x11]; 16 04 c0 86 42 97 e1 c4
234*02ca8ccaSAndroid Build Coastguard WorkerIdx:17945; ID:11;	I_SYNC : Instruction Packet synchronisation.; (Periodic); Addr=0xc00416e2; S;  ISA=Thumb2;
235*02ca8ccaSAndroid Build Coastguard WorkerIdx:17961; ID:11;	P_HDR : Atom P-header.; WEN; Cycles=1
236*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index  17968; ID_DATA[0x11]; ce af 90 80 80 00 a4 84 a0 84 a4 88
237*02ca8ccaSAndroid Build Coastguard WorkerIdx:17962; ID:11;	TIMESTAMP : Timestamp Value.; TS=0x82f9d13097 (562536984727)
238*02ca8ccaSAndroid Build Coastguard WorkerIdx:17974; ID:11;	P_HDR : Atom P-header.; WW; Cycles=2
239*02ca8ccaSAndroid Build Coastguard WorkerIdx:17975; ID:11;	P_HDR : Atom P-header.; WE; Cycles=1
240*02ca8ccaSAndroid Build Coastguard WorkerIdx:17976; ID:11;	P_HDR : Atom P-header.; W; Cycles=1
241*02ca8ccaSAndroid Build Coastguard WorkerIdx:17977; ID:11;	P_HDR : Atom P-header.; WE; Cycles=1
242*02ca8ccaSAndroid Build Coastguard WorkerIdx:17978; ID:11;	P_HDR : Atom P-header.; WW; Cycles=2
243*02ca8ccaSAndroid Build Coastguard WorkerIdx:17979; ID:11;	P_HDR : Atom P-header.; WEWE; Cycles=2
244*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index  17980; ID_DATA[0x10]; a0 82
245*02ca8ccaSAndroid Build Coastguard WorkerIdx:17980; ID:10;	P_HDR : Atom P-header.; W; Cycles=1
246*02ca8ccaSAndroid Build Coastguard WorkerIdx:17981; ID:10;	P_HDR : Atom P-header.; WEE; Cycles=1
247*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index  17984; ID_DATA[0x10]; b8 84 a4 88 a0 82
248*02ca8ccaSAndroid Build Coastguard WorkerIdx:17984; ID:10;	P_HDR : Atom P-header.; WWWWWWW; Cycles=7
249*02ca8ccaSAndroid Build Coastguard WorkerIdx:17985; ID:10;	P_HDR : Atom P-header.; WE; Cycles=1
250*02ca8ccaSAndroid Build Coastguard WorkerIdx:17986; ID:10;	P_HDR : Atom P-header.; WW; Cycles=2
251*02ca8ccaSAndroid Build Coastguard WorkerIdx:17987; ID:10;	P_HDR : Atom P-header.; WEWE; Cycles=2
252*02ca8ccaSAndroid Build Coastguard WorkerIdx:17988; ID:10;	P_HDR : Atom P-header.; W; Cycles=1
253*02ca8ccaSAndroid Build Coastguard WorkerIdx:17989; ID:10;	P_HDR : Atom P-header.; WEE; Cycles=1
254*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
255*02ca8ccaSAndroid Build Coastguard Worker
256*02ca8ccaSAndroid Build Coastguard Worker*Juno - ETB_1 selected which contains STM source output, raw packet output*
257*02ca8ccaSAndroid Build Coastguard Worker
258*02ca8ccaSAndroid Build Coastguard WorkerCommand line:-
259*02ca8ccaSAndroid Build Coastguard Worker`trc_pkt_lister -ss_dir ..\..\..\snapshots\juno_r1_1 -o_raw_unpacked -src_name ETB_1`
260*02ca8ccaSAndroid Build Coastguard Worker
261*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
262*02ca8ccaSAndroid Build Coastguard WorkerTrace Packet Lister: CS Decode library testing
263*02ca8ccaSAndroid Build Coastguard Worker-----------------------------------------------
264*02ca8ccaSAndroid Build Coastguard Worker
265*02ca8ccaSAndroid Build Coastguard WorkerTrace Packet Lister : reading snapshot from path ..\..\..\snapshots\juno_r1_1
266*02ca8ccaSAndroid Build Coastguard WorkerUsing ETB_1 as trace source
267*02ca8ccaSAndroid Build Coastguard WorkerTrace Packet Lister : STM Protocol on Trace ID 0x20
268*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index      0; ID_DATA[0x20]; ff ff ff ff ff ff ff ff ff ff 0f 0f 30 41
269*02ca8ccaSAndroid Build Coastguard WorkerIdx:0; ID:20;	ASYNC:Alignment synchronisation packet.
270*02ca8ccaSAndroid Build Coastguard WorkerIdx:11; ID:20;	VERSION:Version packet.; Ver=3
271*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index     16; ID_DATA[0x20]; f1 1a 00 00 00 30 10 af 01 00 00 10 03 f2 1a
272*02ca8ccaSAndroid Build Coastguard WorkerIdx:13; ID:20;	M8:Set current master.; Master=0x41
273*02ca8ccaSAndroid Build Coastguard WorkerIdx:17; ID:20;	D32M:32 bit data; with marker.; Data=0x10000000
274*02ca8ccaSAndroid Build Coastguard WorkerIdx:22; ID:20;	C8:Set current channel.; Chan=0x0001
275*02ca8ccaSAndroid Build Coastguard WorkerIdx:23; ID:20;	D32M:32 bit data; with marker.; Data=0x10000001
276*02ca8ccaSAndroid Build Coastguard WorkerIdx:28; ID:20;	C8:Set current channel.; Chan=0x0002
277*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index     32; ID_DATA[0x20]; 00 00 00 32 30 af 01 00 00 30 03 f4 1a 00 00
278*02ca8ccaSAndroid Build Coastguard WorkerIdx:30; ID:20;	D32M:32 bit data; with marker.; Data=0x10000002
279*02ca8ccaSAndroid Build Coastguard WorkerIdx:36; ID:20;	C8:Set current channel.; Chan=0x0003
280*02ca8ccaSAndroid Build Coastguard WorkerIdx:37; ID:20;	D32M:32 bit data; with marker.; Data=0x10000003
281*02ca8ccaSAndroid Build Coastguard WorkerIdx:42; ID:20;	C8:Set current channel.; Chan=0x0004
282*02ca8ccaSAndroid Build Coastguard WorkerFrame Data; Index     48; ID_DATA[0x20]; 00 f4 ff ff ff ff ff ff ff ff ff ff f0 00 13
283*02ca8ccaSAndroid Build Coastguard WorkerIdx:44; ID:20;	D32M:32 bit data; with marker.; Data=0x10000004
284*02ca8ccaSAndroid Build Coastguard WorkerIdx:50; ID:20;	ASYNC:Alignment synchronisation packet.
285*02ca8ccaSAndroid Build Coastguard WorkerIdx:61; ID:20;	VERSION:Version packet.; Ver=3
286*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
287*02ca8ccaSAndroid Build Coastguard Worker
288*02ca8ccaSAndroid Build Coastguard Worker*Juno - ETMv4 full trace decode + packet monitor, source trace ID 0x10 only.*
289*02ca8ccaSAndroid Build Coastguard Worker
290*02ca8ccaSAndroid Build Coastguard WorkerCommand line:-
291*02ca8ccaSAndroid Build Coastguard Worker`trc_pkt_lister -ss_dir ..\..\..\snapshots\juno_r1_1 -decode -id 0x10`
292*02ca8ccaSAndroid Build Coastguard Worker
293*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
294*02ca8ccaSAndroid Build Coastguard Worker
295*02ca8ccaSAndroid Build Coastguard WorkerIdx:17204; ID:10; [0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 ];	I_ASYNC : Alignment Synchronisation.
296*02ca8ccaSAndroid Build Coastguard WorkerIdx:17218; ID:10; [0x01 0x01 0x00 ];	I_TRACE_INFO : Trace Info.; INFO=0x0
297*02ca8ccaSAndroid Build Coastguard WorkerIdx:17221; ID:10; [0x9d 0x00 0x35 0x09 0x00 0xc0 0xff 0xff 0xff ];	I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFFFC000096A00;
298*02ca8ccaSAndroid Build Coastguard WorkerIdx:17230; ID:10; [0x04 ];	I_TRACE_ON : Trace On.
299*02ca8ccaSAndroid Build Coastguard WorkerIdx:17232; ID:10; [0x85 0x00 0x35 0x09 0x00 0xc0 0xff 0xff 0xff 0xf1 0x00 0x00 0x00 0x00 0x00 ];	I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0xFFFFFFC000096A00; Ctxt: AArch64,EL1, NS; CID=0x00000000; VMID=0x0000;
300*02ca8ccaSAndroid Build Coastguard WorkerIdx:17248; ID:10; [0xf7 ];	I_ATOM_F1 : Atom format 1.; E
301*02ca8ccaSAndroid Build Coastguard WorkerIdx:17230; ID:10; OCSD_GEN_TRC_ELEM_TRACE_ON( [begin or filter])
302*02ca8ccaSAndroid Build Coastguard WorkerIdx:17232; ID:10; OCSD_GEN_TRC_ELEM_PE_CONTEXT((ISA=A64) EL1N; 64-bit; VMID=0x0; CTXTID=0x0; )
303*02ca8ccaSAndroid Build Coastguard WorkerIdx:17248; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000096a00:[0xffffffc000096a10] num_i(4) last_sz(4) (ISA=A64) E ISB )
304*02ca8ccaSAndroid Build Coastguard WorkerIdx:17249; ID:10; [0x9d 0x30 0x25 0x59 0x00 0xc0 0xff 0xff 0xff ];	I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFFFC000594AC0;
305*02ca8ccaSAndroid Build Coastguard WorkerIdx:17258; ID:10; [0xf7 ];	I_ATOM_F1 : Atom format 1.; E
306*02ca8ccaSAndroid Build Coastguard WorkerIdx:17258; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000594ac0 )
307*02ca8ccaSAndroid Build Coastguard WorkerIdx:17259; ID:10; [0x95 0xd6 0x95 ];	I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC000592B58 ~[0x12B58]
308*02ca8ccaSAndroid Build Coastguard WorkerIdx:17262; ID:10; [0xf9 ];	I_ATOM_F3 : Atom format 3.; ENN
309*02ca8ccaSAndroid Build Coastguard WorkerIdx:17262; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000592b58 )
310*02ca8ccaSAndroid Build Coastguard WorkerIdx:17264; ID:10; [0xf7 ];	I_ATOM_F1 : Atom format 1.; E
311*02ca8ccaSAndroid Build Coastguard WorkerIdx:17265; ID:10; [0x9a 0x32 0x62 0x5a 0x00 ];	I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC0005AC4C8;
312*02ca8ccaSAndroid Build Coastguard WorkerIdx:17270; ID:10; [0xdb ];	I_ATOM_F2 : Atom format 2.; EE
313*02ca8ccaSAndroid Build Coastguard WorkerIdx:17270; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc0005ac4c8 )
314*02ca8ccaSAndroid Build Coastguard WorkerIdx:17271; ID:10; [0x9a 0x62 0x52 0x0e 0x00 ];	I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC0000EA588;
315*02ca8ccaSAndroid Build Coastguard WorkerIdx:17276; ID:10; [0xfc ];	I_ATOM_F3 : Atom format 3.; NNE
316*02ca8ccaSAndroid Build Coastguard WorkerIdx:17276; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc0000ea588 )
317*02ca8ccaSAndroid Build Coastguard WorkerIdx:17277; ID:10; [0x9a 0x58 0x15 0x59 0x00 ];	I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC000592B60;
318*02ca8ccaSAndroid Build Coastguard WorkerIdx:17283; ID:10; [0x06 0x1d ];	I_EXCEPT : Exception.;  IRQ; Ret Addr Follows;
319*02ca8ccaSAndroid Build Coastguard WorkerIdx:17285; ID:10; [0x95 0x59 ];	I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC000592B64 ~[0x164]
320*02ca8ccaSAndroid Build Coastguard WorkerIdx:17283; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000592b60 )
321*02ca8ccaSAndroid Build Coastguard WorkerIdx:17283; ID:10; OCSD_GEN_TRC_ELEM_EXCEPTION(pref ret addr:0xffffffc000592b64; excep num (0x0e) )
322*02ca8ccaSAndroid Build Coastguard WorkerIdx:17287; ID:10; [0x9a 0x20 0x19 0x08 0x00 ];	I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC000083280;
323*02ca8ccaSAndroid Build Coastguard WorkerIdx:17292; ID:10; [0xfd ];	I_ATOM_F3 : Atom format 3.; ENE
324*02ca8ccaSAndroid Build Coastguard WorkerIdx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083280:[0xffffffc000083284] num_i(1) last_sz(4) (ISA=A64) E BR  )
325*02ca8ccaSAndroid Build Coastguard WorkerIdx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083d40:[0xffffffc000083d9c] num_i(23) last_sz(4) (ISA=A64) N BR   <cond>)
326*02ca8ccaSAndroid Build Coastguard WorkerIdx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083d9c:[0xffffffc000083dac] num_i(4) last_sz(4) (ISA=A64) E iBR b+link )
327*02ca8ccaSAndroid Build Coastguard WorkerIdx:17293; ID:10; [0x95 0xf7 0x09 ];	I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC0000813DC ~[0x13DC]
328*02ca8ccaSAndroid Build Coastguard WorkerIdx:17297; ID:10; [0xdb ];	I_ATOM_F2 : Atom format 2.; EE
329*02ca8ccaSAndroid Build Coastguard WorkerIdx:17297; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc0000813dc:[0xffffffc0000813f0] num_i(5) last_sz(4) (ISA=A64) E BR  b+link )
330*02ca8ccaSAndroid Build Coastguard WorkerIdx:17297; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008f2e0:[0xffffffc00008f2e4] num_i(1) last_sz(4) (ISA=A64) E iBR A64:ret )
331*02ca8ccaSAndroid Build Coastguard WorkerIdx:17298; ID:10; [0x95 0x7e ];	I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC0000813F8 ~[0x1F8]
332*02ca8ccaSAndroid Build Coastguard WorkerIdx:17300; ID:10; [0xe0 ];	I_ATOM_F6 : Atom format 6.; EEEN
333*02ca8ccaSAndroid Build Coastguard WorkerIdx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc0000813f8:[0xffffffc00008140c] num_i(5) last_sz(4) (ISA=A64) E BR  )
334*02ca8ccaSAndroid Build Coastguard WorkerIdx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008141c:[0xffffffc000081434] num_i(6) last_sz(4) (ISA=A64) E BR   <cond>)
335*02ca8ccaSAndroid Build Coastguard WorkerIdx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008140c:[0xffffffc000081414] num_i(2) last_sz(4) (ISA=A64) E BR  b+link )
336*02ca8ccaSAndroid Build Coastguard WorkerIdx:17300; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000117cf0 )
337*02ca8ccaSAndroid Build Coastguard Worker
338*02ca8ccaSAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~
339*02ca8ccaSAndroid Build Coastguard Worker
340*02ca8ccaSAndroid Build Coastguard WorkerThe `c_api_pkt_print_test` program.
341*02ca8ccaSAndroid Build Coastguard Worker-----------------------------------
342*02ca8ccaSAndroid Build Coastguard Worker
343*02ca8ccaSAndroid Build Coastguard WorkerProgram tests the C-API infrastructure, including as an option the external decoder support.
344*02ca8ccaSAndroid Build Coastguard Worker
345*02ca8ccaSAndroid Build Coastguard WorkerLimited to decoding trace from a single CoreSight ID. Uses the same "snapshots" as the C++ test program, but using hardcoded path values.
346*02ca8ccaSAndroid Build Coastguard Worker
347*02ca8ccaSAndroid Build Coastguard Worker__Command Line Options__
348*02ca8ccaSAndroid Build Coastguard Worker
349*02ca8ccaSAndroid Build Coastguard WorkerBy default the program will run the single CoreSight ID of 0x10 in packet processing output mode using the ETMv4 decoder on the Juno snapshot.
350*02ca8ccaSAndroid Build Coastguard Worker
351*02ca8ccaSAndroid Build Coastguard Worker- `-id <n>`          : Change the ID used for the test.
352*02ca8ccaSAndroid Build Coastguard Worker- `-etmv3`           : Test the ETMv3 decoder - uses the TC2 snapshot.
353*02ca8ccaSAndroid Build Coastguard Worker- `-ptm`             : Test the PTM decoder - uses the TC2 snapshot.
354*02ca8ccaSAndroid Build Coastguard Worker- `-stm`             : Test the STM decoder - uses juno STM only snapshot.
355*02ca8ccaSAndroid Build Coastguard Worker- `-extern`          : Use the 'echo_test' external decoder to test the custom decoder API.
356*02ca8ccaSAndroid Build Coastguard Worker- `-decode`          : Output trace protocol packets and full decode generic packets.
357*02ca8ccaSAndroid Build Coastguard Worker- `-decode_only`     : Output full decode generic packets only.
358