@@ -131,28 +131,6 @@ func parseBTFHeader(r io.Reader, bo binary.ByteOrder) (*btfHeader, error) {
131
131
132
132
var btfTypeLen = binary .Size (btfType {})
133
133
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
134
var btfTypeSize = int (unsafe .Sizeof (btfType {}))
157
135
158
136
func unmarshalBtfType (bt * btfType , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -348,12 +326,6 @@ func (bi *btfInt) SetBits(bits byte) {
348
326
bi .Raw = writeBits (bi .Raw , btfIntBitsLen , btfIntBitsShift , uint32 (bits ))
349
327
}
350
328
351
- type btfArray struct {
352
- Type TypeID
353
- IndexType TypeID
354
- Nelems uint32
355
- }
356
-
357
329
var btfArrayLen = int (unsafe .Sizeof (btfArray {}))
358
330
359
331
func unmarshalBtfArray (ba * btfArray , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -367,12 +339,6 @@ func unmarshalBtfArray(ba *btfArray, b []byte, bo binary.ByteOrder) (int, error)
367
339
return btfArrayLen , nil
368
340
}
369
341
370
- type btfMember struct {
371
- NameOff uint32
372
- Type TypeID
373
- Offset uint32
374
- }
375
-
376
342
var btfMemberLen = int (unsafe .Sizeof (btfMember {}))
377
343
378
344
func unmarshalBtfMembers (members []btfMember , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -392,12 +358,6 @@ func unmarshalBtfMembers(members []btfMember, b []byte, bo binary.ByteOrder) (in
392
358
return off , nil
393
359
}
394
360
395
- type btfVarSecinfo struct {
396
- Type TypeID
397
- Offset uint32
398
- Size uint32
399
- }
400
-
401
361
var btfVarSecinfoLen = int (unsafe .Sizeof (btfVarSecinfo {}))
402
362
403
363
func unmarshalBtfVarSecInfos (secinfos []btfVarSecinfo , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -417,10 +377,6 @@ func unmarshalBtfVarSecInfos(secinfos []btfVarSecinfo, b []byte, bo binary.ByteO
417
377
return off , nil
418
378
}
419
379
420
- type btfVariable struct {
421
- Linkage uint32
422
- }
423
-
424
380
var btfVariableLen = int (unsafe .Sizeof (btfVariable {}))
425
381
426
382
func unmarshalBtfVariable (bv * btfVariable , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -432,11 +388,6 @@ func unmarshalBtfVariable(bv *btfVariable, b []byte, bo binary.ByteOrder) (int,
432
388
return btfVariableLen , nil
433
389
}
434
390
435
- type btfEnum struct {
436
- NameOff uint32
437
- Val uint32
438
- }
439
-
440
391
var btfEnumLen = int (unsafe .Sizeof (btfEnum {}))
441
392
442
393
func unmarshalBtfEnums (enums []btfEnum , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -455,12 +406,6 @@ func unmarshalBtfEnums(enums []btfEnum, b []byte, bo binary.ByteOrder) (int, err
455
406
return off , nil
456
407
}
457
408
458
- type btfEnum64 struct {
459
- NameOff uint32
460
- ValLo32 uint32
461
- ValHi32 uint32
462
- }
463
-
464
409
var btfEnum64Len = int (unsafe .Sizeof (btfEnum64 {}))
465
410
466
411
func unmarshalBtfEnums64 (enums []btfEnum64 , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -480,11 +425,6 @@ func unmarshalBtfEnums64(enums []btfEnum64, b []byte, bo binary.ByteOrder) (int,
480
425
return off , nil
481
426
}
482
427
483
- type btfParam struct {
484
- NameOff uint32
485
- Type TypeID
486
- }
487
-
488
428
var btfParamLen = int (unsafe .Sizeof (btfParam {}))
489
429
490
430
func unmarshalBtfParams (params []btfParam , b []byte , bo binary.ByteOrder ) (int , error ) {
@@ -503,10 +443,6 @@ func unmarshalBtfParams(params []btfParam, b []byte, bo binary.ByteOrder) (int,
503
443
return off , nil
504
444
}
505
445
506
- type btfDeclTag struct {
507
- ComponentIdx uint32
508
- }
509
-
510
446
var btfDeclTagLen = int (unsafe .Sizeof (btfDeclTag {}))
511
447
512
448
func unmarshalBtfDeclTag (bdt * btfDeclTag , b []byte , bo binary.ByteOrder ) (int , error ) {
0 commit comments