LLVM: lib/XRay/FDRTraceExpander.cpp Source File (original) (raw)
1
2
3
4
5
6
7
9
10using namespace llvm;
12
13void TraceExpander::resetCurrentRecord() {
14 if (BuildingRecord)
15 C(CurrentRecord);
16 BuildingRecord = false;
17 CurrentRecord.CallArgs.clear();
18 CurrentRecord.Data.clear();
19}
20
22 resetCurrentRecord();
24}
25
27
29 CPUId = R.cpuid();
30 BaseTSC = R.tsc();
32}
33
35 BaseTSC = R.tsc();
37}
38
40 resetCurrentRecord();
41 if (!IgnoringRecords) {
42 CurrentRecord.TSC = R.tsc();
43 CurrentRecord.CPU = R.cpu();
44 CurrentRecord.PId = PID;
45 CurrentRecord.TId = TID;
47 CurrentRecord.Data = std::string(R.data());
48 BuildingRecord = true;
49 }
51}
52
54 resetCurrentRecord();
55 if (!IgnoringRecords) {
56 BaseTSC += R.delta();
57 CurrentRecord.TSC = BaseTSC;
58 CurrentRecord.CPU = CPUId;
59 CurrentRecord.PId = PID;
60 CurrentRecord.TId = TID;
62 CurrentRecord.Data = std::string(R.data());
63 BuildingRecord = true;
64 }
66}
67
69 resetCurrentRecord();
70 if (!IgnoringRecords) {
71 BaseTSC += R.delta();
72 CurrentRecord.TSC = BaseTSC;
73 CurrentRecord.CPU = CPUId;
74 CurrentRecord.PId = PID;
75 CurrentRecord.TId = TID;
76 CurrentRecord.RecordType = R.eventType();
78 CurrentRecord.Data = std::string(R.data());
79 BuildingRecord = true;
80 }
82}
83
85 CurrentRecord.CallArgs.push_back(R.arg());
88}
89
94
96 if (IgnoringRecords)
97 IgnoringRecords = false;
98 TID = R.tid();
99 if (LogVersion == 2)
100 PID = R.tid();
102}
103
105 IgnoringRecords = true;
106 resetCurrentRecord();
108}
109
111 resetCurrentRecord();
112 if (!IgnoringRecords) {
113 BaseTSC += R.delta();
114 CurrentRecord.Type = R.recordType();
115 CurrentRecord.FuncId = R.functionId();
116 CurrentRecord.TSC = BaseTSC;
117 CurrentRecord.PId = PID;
118 CurrentRecord.TId = TID;
119 CurrentRecord.CPU = CPUId;
120 BuildingRecord = true;
121 }
123}
124
126 resetCurrentRecord();
128}
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Error flush()
Definition FDRTraceExpander.cpp:125
Error visit(BufferExtents &) override
Definition FDRTraceExpander.cpp:21
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.