Project

General

Profile

Trace Format » History » Version 1

Sergey Smolov, 01/20/2020 12:22 PM

1 1 Sergey Smolov
h1. Trace Format
2
3
{{toc}}
4
5
"Trace Matcher":https://forge.ispras.ru/projects/traceutils tool is able to compare traces. Here is the description of the supported trace format.
6
The trace contains _records_ (lines) of the following kinds: _instruction records_ , _memory access records_ , _register write records_ .
7
8
h2. Instruction record
9
10
Appears in the trace when the corresponding instruction from the target program has been executed.
11
The record format is as follows:
12
<pre><code class="text">
13
<time> <scale> <cpu> [IT|IS] (<inst_id>) <addr> <opcode> [A|T|X] <mode>_<security> : <disasm>
14
</code></pre>
15
The record fields are described in the following table:
16
| *Field* | *Description* | *Value* |
17
| <time> | Timestamp | Decimal integer value |
18
| <scale> | Timestamp unit | String (the _clk_ value means, that the timestamp field shows not physical time but the inex of executed instruction) |
19
| <cpu> | Identifier for the processor at which the instruction is executed | Decimal integer value |
20
| [IT<notextile>|</notextile>IS] | Instruction execution flag | IT when "Instruction Taken", IS when "Instruction Skipped" |
21
| <inst_id> | Index of the executed instruction | Decimal integer value |
22
| <addr> | Virtual memory address for the instruction | Hexadecimal value |
23
| <opcode> | 16\32\64-bit code for the instruction | Hexadecimal value |
24
| [A<notextile>|</notextile>T<notextile>|</notextile>X] | Instruction set identifier | TODO |
25
| <mode> | Execution mode | String (one of the following: svc, irq, fiq, usr, mon, sys, abt, und) |
26
| <security> | Flag for the processor security mode | s when "secure", ns when "non-secure" |
27
| <disasm> | Disassembly representation for the instruction | String |
28
29
Example:
30
<pre><code class="text">
31
1 clk 0 IT (1) 00000004 3c080001 A svc : lui t0,0x1
32
</code></pre>
33
34
h2. Memory access record
35
36
Appears in the trace when reading from or writing to memory starts.
37
38
The record format is as follows:
39
<pre><code class="text">
40
<time> <scale> M<rw><sz><attrib> <addr> <data>
41
</code></pre>
42
The record fields are described in the following table:
43
| *Field* | *Description* | *Value* |
44
| <time> | Timestamp | Decimal integer value |
45
| <scale> | Timestamp unit | String (the _clk_ value means, that the timestamp field shows not physical time but the inex of executed instruction) |
46
| <rw> | Type of access | R for reading, W for writing |
47
| <sz> | Size of received\transmitted data in bytes | Decimal integer value |
48
| <attrib> | Access attribute (optional) | X for privileged, T for non-privileged (translated) |
49
| <addr> | Virtual memory address to which an access is made | Hexadecimal value |
50
| <data> | The data to be written (has been read) | Hexadecimal value of the corresponding size |
51
52
Example:
53
<pre><code class="text">
54
10 clk MR8 00103fc4 0010400000000000
55
</code></pre>
56
57
h2. Register write record
58
59
Appears in the trace when writing to register happens.
60
61
The record format is as follows:
62
<pre><code class="text">
63
<time> <scale> R <register> <value>
64
</code></pre>
65
The record fields are described in the following table:
66
| *Field* | *Description* | *Value* |
67
| <time> | Timestamp | Decimal integer value |
68
| <scale> | Timestamp unit | String (the _clk_ value means, that the timestamp field shows not physical time but the inex of executed instruction) |
69
| <register> | Name of register | lowercase string |
70
| <value> | The value to be written in the register | Hexadecimal value |
71
72
Example:
73
<pre><code class="text">
74
14 clk R r8 00000000
75
</code></pre>