@@ -74,18 +74,6 @@ const (
74
74
75
75
var btfHeaderLen = binary .Size (& btfHeader {})
76
76
77
- type btfHeader struct {
78
- Magic uint16
79
- Version uint8
80
- Flags uint8
81
- HdrLen uint32
82
-
83
- TypeOff uint32
84
- TypeLen uint32
85
- StringOff uint32
86
- StringLen uint32
87
- }
88
-
89
77
// typeStart returns the offset from the beginning of the .BTF section
90
78
// to the start of its type entries.
91
79
func (h * btfHeader ) typeStart () int64 {
@@ -131,28 +119,6 @@ func parseBTFHeader(r io.Reader, bo binary.ByteOrder) (*btfHeader, error) {
131
119
132
120
var btfTypeLen = binary .Size (btfType {})
133
121
134
- // btfType is equivalent to struct btf_type in Documentation/bpf/btf.rst.
135
- type btfType struct {
136
- NameOff uint32
137
- /* "info" bits arrangement
138
- * bits 0-15: vlen (e.g. # of struct's members), linkage
139
- * bits 16-23: unused
140
- * bits 24-28: kind (e.g. int, ptr, array...etc)
141
- * bits 29-30: unused
142
- * bit 31: kind_flag, currently used by
143
- * struct, union and fwd
144
- */
145
- Info uint32
146
- /* "size" is used by INT, ENUM, STRUCT and UNION.
147
- * "size" tells the size of the type it is describing.
148
- *
149
- * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
150
- * FUNC and FUNC_PROTO.
151
- * "type" is a type_id referring to another type.
152
- */
153
- SizeType uint32
154
- }
155
-
156
122
var btfTypeSize = int (unsafe .Sizeof (btfType {}))
157
123
158
124
func unmarshalBtfType (bt * btfType , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -348,12 +314,6 @@ func (bi *btfInt) SetBits(bits byte) {
348
314
bi .Raw = writeBits (bi .Raw , btfIntBitsLen , btfIntBitsShift , uint32 (bits ))
349
315
}
350
316
351
- type btfArray struct {
352
- Type TypeID
353
- IndexType TypeID
354
- Nelems uint32
355
- }
356
-
357
317
var btfArrayLen = int (unsafe .Sizeof (btfArray {}))
358
318
359
319
func unmarshalBtfArray (ba * btfArray , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -367,12 +327,6 @@ func unmarshalBtfArray(ba *btfArray, b []byte, bo binary.ByteOrder) (int, error)
367
327
return btfArrayLen , nil
368
328
}
369
329
370
- type btfMember struct {
371
- NameOff uint32
372
- Type TypeID
373
- Offset uint32
374
- }
375
-
376
330
var btfMemberLen = int (unsafe .Sizeof (btfMember {}))
377
331
378
332
func unmarshalBtfMembers (members []btfMember , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -392,12 +346,6 @@ func unmarshalBtfMembers(members []btfMember, b []byte, bo binary.ByteOrder) (in
392
346
return off , nil
393
347
}
394
348
395
- type btfVarSecinfo struct {
396
- Type TypeID
397
- Offset uint32
398
- Size uint32
399
- }
400
-
401
349
var btfVarSecinfoLen = int (unsafe .Sizeof (btfVarSecinfo {}))
402
350
403
351
func unmarshalBtfVarSecInfos (secinfos []btfVarSecinfo , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -417,10 +365,6 @@ func unmarshalBtfVarSecInfos(secinfos []btfVarSecinfo, b []byte, bo binary.ByteO
417
365
return off , nil
418
366
}
419
367
420
- type btfVariable struct {
421
- Linkage uint32
422
- }
423
-
424
368
var btfVariableLen = int (unsafe .Sizeof (btfVariable {}))
425
369
426
370
func unmarshalBtfVariable (bv * btfVariable , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -432,11 +376,6 @@ func unmarshalBtfVariable(bv *btfVariable, b []byte, bo binary.ByteOrder) (int,
432
376
return btfVariableLen , nil
433
377
}
434
378
435
- type btfEnum struct {
436
- NameOff uint32
437
- Val uint32
438
- }
439
-
440
379
var btfEnumLen = int (unsafe .Sizeof (btfEnum {}))
441
380
442
381
func unmarshalBtfEnums (enums []btfEnum , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -455,12 +394,6 @@ func unmarshalBtfEnums(enums []btfEnum, b []byte, bo binary.ByteOrder) (int, err
455
394
return off , nil
456
395
}
457
396
458
- type btfEnum64 struct {
459
- NameOff uint32
460
- ValLo32 uint32
461
- ValHi32 uint32
462
- }
463
-
464
397
var btfEnum64Len = int (unsafe .Sizeof (btfEnum64 {}))
465
398
466
399
func unmarshalBtfEnums64 (enums []btfEnum64 , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -480,11 +413,6 @@ func unmarshalBtfEnums64(enums []btfEnum64, b []byte, bo binary.ByteOrder) (int,
480
413
return off , nil
481
414
}
482
415
483
- type btfParam struct {
484
- NameOff uint32
485
- Type TypeID
486
- }
487
-
488
416
var btfParamLen = int (unsafe .Sizeof (btfParam {}))
489
417
490
418
func unmarshalBtfParams (params []btfParam , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -503,10 +431,6 @@ func unmarshalBtfParams(params []btfParam, b []byte, bo binary.ByteOrder) (int,
503
431
return off , nil
504
432
}
505
433
506
- type btfDeclTag struct {
507
- ComponentIdx uint32
508
- }
509
-
510
434
var btfDeclTagLen = int (unsafe .Sizeof (btfDeclTag {}))
511
435
512
436
func unmarshalBtfDeclTag (bdt * btfDeclTag , b []byte , bo binary.ByteOrder ) (int , error ) {
0 commit comments