LLVM: include/llvm/DebugInfo/BTF/BTF.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48#ifndef LLVM_LIB_TARGET_BPF_BTF_H
49#define LLVM_LIB_TARGET_BPF_BTF_H
50
53
54namespace llvm {
56
58
59
60enum {
76};
77
78
91
94};
95
97#define HANDLE_BTF_KIND(ID, NAME) BTF_KIND_##NAME = ID,
98#include "BTF.def"
99};
100
101
104
105
106
108
110
111
112
113
114
115
116
117
119
120
121
122
123
124
125
126 union {
129 };
130
133};
134
135
136
137
138
139
140
141
142
143
144
149};
150
151
152
153
158
159
160
161
167
168
174
175
176
177
178
179
180
181
182
183
184
190
191
192
193
198
199
204};
205
206
211};
212
213
214
215
221
222
236
237
242
243
248
249
259
260
265
266
273
274
279
280
297
298
299
300
301
302
303
304
305
306#define BTF_DEFINE_TAIL(Type, Accessor) \
307 const Type &Accessor() const { return *getTrailingObjects(); }
308
309
310
311#define BTF_DEFINE_TAIL_ARR(Type, Accessor) \
312 ArrayRef Accessor() const { return getTrailingObjects(getVlen()); }
313
318
320 return V->getKind() == BTF_KIND_ARRAY;
321 }
322};
323
328
330 return V->getKind() == BTF_KIND_STRUCT || V->getKind() == BTF_KIND_UNION;
331 }
332};
333
337
339 return V->getKind() == BTF_KIND_ENUM;
340 }
341};
342
347
349 return V->getKind() == BTF_KIND_ENUM64;
350 }
351};
352
353#undef BTF_DEFINE_TAIL
354#undef BTF_DEFINE_TAIL_ARR
355
356}
357}
358
359#endif
#define BTF_DEFINE_TAIL(Type, Accessor)
Definition BTF.h:306
#define BTF_DEFINE_TAIL_ARR(Type, Accessor)
Definition BTF.h:311
static std::array< T, N > getArray(const MachOObjectFile &O, const void *Ptr)
This header defines support for implementing classes that have some trailing object (or arrays of obj...
TypeKinds
Definition BTF.h:96
@ INT_CHAR
Definition BTF.h:147
@ INT_SIGNED
Definition BTF.h:146
@ INT_BOOL
Definition BTF.h:148
constexpr uint32_t ENUM_SIGNED_FLAG
Definition BTF.h:103
@ VAR_GLOBAL_ALLOCATED
Linkage: ExternalLinkage.
Definition BTF.h:209
@ VAR_STATIC
Linkage: InternalLinkage.
Definition BTF.h:208
@ VAR_GLOBAL_EXTERNAL
Linkage: ExternalLinkage.
Definition BTF.h:210
@ VERSION
Definition BTF.h:57
@ MAGIC
Definition BTF.h:57
@ BTFEnum64Size
Definition BTF.h:66
@ BTFArraySize
Definition BTF.h:64
@ BPFFuncInfoSize
Definition BTF.h:73
@ BTFMemberSize
Definition BTF.h:67
@ BTFEnumSize
Definition BTF.h:65
@ HeaderSize
Definition BTF.h:61
@ ExtHeaderSize
Definition BTF.h:62
@ SecLineInfoSize
Definition BTF.h:71
@ SecFieldRelocSize
Definition BTF.h:72
@ BPFLineInfoSize
Definition BTF.h:74
@ SecFuncInfoSize
Definition BTF.h:70
@ BTFParamSize
Definition BTF.h:68
@ BPFFieldRelocSize
Definition BTF.h:75
@ CommonTypeSize
Definition BTF.h:63
@ BTFDataSecVarSize
Definition BTF.h:69
@ MAX_VLEN
Max # of struct/union/enum members or func args.
Definition BTF.h:93
constexpr uint32_t FWD_UNION_FLAG
Definition BTF.h:102
PatchableRelocKind
CO-RE relocation kind codes used in .BTF.ext section.
Definition BTF.h:281
@ FIELD_RSHIFT_U64
Definition BTF.h:287
@ ENUM_VALUE
Definition BTF.h:293
@ FIELD_SIGNEDNESS
Definition BTF.h:285
@ FIELD_BYTE_OFFSET
Definition BTF.h:282
@ FIELD_BYTE_SIZE
Definition BTF.h:283
@ ENUM_VALUE_EXISTENCE
Definition BTF.h:292
@ MAX_FIELD_RELOC_KIND
Definition BTF.h:295
@ BTF_TYPE_ID_REMOTE
Definition BTF.h:289
@ TYPE_EXISTENCE
Definition BTF.h:290
@ BTF_TYPE_ID_LOCAL
Definition BTF.h:288
@ FIELD_LSHIFT_U64
Definition BTF.h:286
@ TYPE_MATCH
Definition BTF.h:294
@ TYPE_SIZE
Definition BTF.h:291
@ FIELD_EXISTENCE
Definition BTF.h:284
@ FUNC_STATIC
Definition BTF.h:201
@ FUNC_EXTERN
Definition BTF.h:203
@ FUNC_GLOBAL
Definition BTF.h:202
This is an optimization pass for GlobalISel generic memory operations.
static bool classof(const CommonType *V)
Definition BTF.h:319
friend TrailingObjects
Definition BTF.h:316
Specifying one offset relocation.
Definition BTF.h:267
uint32_t InsnOffset
Byte offset in this section.
Definition BTF.h:268
uint32_t OffsetNameOff
The string to traverse types.
Definition BTF.h:270
uint32_t RelocKind
What to patch the instruction.
Definition BTF.h:271
uint32_t TypeID
TypeID for the relocation.
Definition BTF.h:269
Specifying one function info.
Definition BTF.h:238
uint32_t InsnOffset
Byte offset in the section.
Definition BTF.h:239
uint32_t TypeId
Type id referring to .BTF type section.
Definition BTF.h:240
Specifying one line info.
Definition BTF.h:250
uint32_t getLine() const
Definition BTF.h:256
uint32_t LineCol
Line num: line_col >> 10, col num: line_col & 0x3ff.
Definition BTF.h:254
uint32_t getCol() const
Definition BTF.h:257
uint32_t FileNameOff
File name index in the .BTF string table.
Definition BTF.h:252
uint32_t InsnOffset
Byte offset in this section.
Definition BTF.h:251
uint32_t LineOff
Line index in the .BTF string table.
Definition BTF.h:253
BTF_KIND_ARRAY is followed by one "struct BTFArray".
Definition BTF.h:169
uint32_t Nelems
Number of elements for this array.
Definition BTF.h:172
uint32_t IndexType
Index type.
Definition BTF.h:171
uint32_t ElemType
Element type.
Definition BTF.h:170
BTF_KIND_DATASEC are followed by multiple "struct BTFDataSecVar".
Definition BTF.h:216
uint32_t Size
Occupied memory size.
Definition BTF.h:219
uint32_t Type
A BTF_KIND_VAR type.
Definition BTF.h:217
uint32_t Offset
In-section offset.
Definition BTF.h:218
BTF_KIND_ENUM64 is followed by multiple "struct BTFEnum64".
Definition BTF.h:162
uint32_t NameOff
Enum name offset in the string table.
Definition BTF.h:163
uint32_t Val_Hi32
Enum member hi32 value.
Definition BTF.h:165
uint32_t Val_Lo32
Enum member lo32 value.
Definition BTF.h:164
BTF_KIND_ENUM is followed by multiple "struct BTFEnum".
Definition BTF.h:154
int32_t Val
Enum member value.
Definition BTF.h:156
uint32_t NameOff
Enum name offset in the string table.
Definition BTF.h:155
BTF_KIND_STRUCT and BTF_KIND_UNION are followed by multiple "struct BTFMember".
Definition BTF.h:185
uint32_t NameOff
Member name offset in the string table.
Definition BTF.h:186
uint32_t Offset
BitOffset or BitFieldSize+BitOffset.
Definition BTF.h:188
uint32_t Type
Member type.
Definition BTF.h:187
BTF_KIND_FUNC_PROTO are followed by multiple "struct BTFParam".
Definition BTF.h:194
uint32_t Type
Definition BTF.h:196
uint32_t NameOff
Definition BTF.h:195
The BTF common type definition.
Definition BTF.h:107
uint32_t Type
Definition BTF.h:128
uint32_t Size
Definition BTF.h:127
uint32_t NameOff
Type name offset in the string table.
Definition BTF.h:109
uint32_t Info
"Info" bits arrangement: Bits 0-15: vlen (e.g.
Definition BTF.h:118
uint32_t getKind() const
Definition BTF.h:131
uint32_t getVlen() const
Definition BTF.h:132
static bool classof(const CommonType *V)
Definition BTF.h:348
friend TrailingObjects
Definition BTF.h:345
static bool classof(const CommonType *V)
Definition BTF.h:338
friend TrailingObjects
Definition BTF.h:335
Specifying offset relocation's in one section.
Definition BTF.h:275
uint32_t NumFieldReloc
Number of offset reloc's in this section.
Definition BTF.h:277
uint32_t SecNameOff
Section name index in the .BTF string table.
Definition BTF.h:276
Specifying function info's in one section.
Definition BTF.h:244
uint32_t SecNameOff
Section name index in the .BTF string table.
Definition BTF.h:245
uint32_t NumFuncInfo
Number of func info's in this section.
Definition BTF.h:246
Specifying line info's in one section.
Definition BTF.h:261
uint32_t NumLineInfo
Number of line info's in this section.
Definition BTF.h:263
uint32_t SecNameOff
Section name index in the .BTF string table.
Definition BTF.h:262
friend TrailingObjects
Definition BTF.h:326
static bool classof(const CommonType *V)
Definition BTF.h:329