@@ -74,7 +74,7 @@ sequentially and type id is assigned to each recognized type starting from id
74
74
#define BTF_KIND_ARRAY 3 /* Array */
75
75
#define BTF_KIND_STRUCT 4 /* Struct */
76
76
#define BTF_KIND_UNION 5 /* Union */
77
- #define BTF_KIND_ENUM 6 /* Enumeration */
77
+ #define BTF_KIND_ENUM 6 /* Enumeration for int/unsigned int values */
78
78
#define BTF_KIND_FWD 7 /* Forward */
79
79
#define BTF_KIND_TYPEDEF 8 /* Typedef */
80
80
#define BTF_KIND_VOLATILE 9 /* Volatile */
@@ -87,6 +87,7 @@ sequentially and type id is assigned to each recognized type starting from id
87
87
#define BTF_KIND_FLOAT 16 /* Floating point */
88
88
#define BTF_KIND_DECL_TAG 17 /* Decl Tag */
89
89
#define BTF_KIND_TYPE_TAG 18 /* Type Tag */
90
+ #define BTF_KIND_ENUM64 19 /* Enumeration for long/unsigned long values */
90
91
91
92
Note that the type section encodes debug info, not just pure types.
92
93
``BTF_KIND_FUNC `` is not a type, and it represents a defined subprogram.
@@ -101,10 +102,10 @@ Each type contains the following common data::
101
102
* bits 24-28: kind (e.g. int, ptr, array...etc)
102
103
* bits 29-30: unused
103
104
* bit 31: kind_flag, currently used by
104
- * struct, union and fwd
105
+ * struct, union, fwd, enum and enum64.
105
106
*/
106
107
__u32 info;
107
- /* "size" is used by INT, ENUM, STRUCT and UNION .
108
+ /* "size" is used by INT, ENUM, STRUCT, UNION and ENUM64 .
108
109
* "size" tells the size of the type it is describing.
109
110
*
110
111
* "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
@@ -281,7 +282,7 @@ modes exist:
281
282
282
283
``struct btf_type `` encoding requirement:
283
284
* ``name_off ``: 0 or offset to a valid C identifier
284
- * ``info.kind_flag ``: 0
285
+ * ``info.kind_flag ``: 0 for signed, 1 for unsigned
285
286
* ``info.kind ``: BTF_KIND_ENUM
286
287
* ``info.vlen ``: number of enum values
287
288
* ``size ``: 4
@@ -493,7 +494,7 @@ the attribute is applied to a ``struct``/``union`` member or
493
494
a ``func `` argument, and ``btf_decl_tag.component_idx `` should be a
494
495
valid index (starting from 0) pointing to a member or an argument.
495
496
496
- 2.2.17 BTF_KIND_TYPE_TAG
497
+ 2.2.18 BTF_KIND_TYPE_TAG
497
498
~~~~~~~~~~~~~~~~~~~~~~~~
498
499
499
500
``struct btf_type `` encoding requirement:
@@ -516,6 +517,29 @@ type_tag, then zero or more const/volatile/restrict/typedef
516
517
and finally the base type. The base type is one of
517
518
int, ptr, array, struct, union, enum, func_proto and float types.
518
519
520
+ 2.2.19 BTF_KIND_ENUM64
521
+ ~~~~~~~~~~~~~~~~~~~~~~
522
+
523
+ ``struct btf_type `` encoding requirement:
524
+ * ``name_off ``: 0 or offset to a valid C identifier
525
+ * ``info.kind_flag ``: 0 for signed, 1 for unsigned
526
+ * ``info.kind ``: BTF_KIND_ENUM64
527
+ * ``info.vlen ``: number of enum values
528
+ * ``size ``: 8
529
+
530
+ ``btf_type `` is followed by ``info.vlen `` number of ``struct btf_enum64 ``.::
531
+
532
+ struct btf_enum64 {
533
+ __u32 name_off;
534
+ __u32 hi32;
535
+ __u32 lo32;
536
+ };
537
+
538
+ The ``btf_enum64 `` encoding:
539
+ * ``name_off ``: offset to a valid C identifier
540
+ * ``hi32 ``: high 32-bit value for a 64-bit value
541
+ * ``lo32 ``: lower 32-bit value for a 64-bit value
542
+
519
543
3. BTF Kernel API
520
544
=================
521
545
0 commit comments