@@ -368,7 +368,7 @@ No additional type data follow ``btf_type``.
368
368
* ``info.kind_flag ``: 0
369
369
* ``info.kind ``: BTF_KIND_FUNC
370
370
* ``info.vlen ``: linkage information (BTF_FUNC_STATIC, BTF_FUNC_GLOBAL
371
- or BTF_FUNC_EXTERN)
371
+ or BTF_FUNC_EXTERN - see :ref: ` BTF_Function_Linkage_Constants ` )
372
372
* ``type ``: a BTF_KIND_FUNC_PROTO type
373
373
374
374
No additional type data follow ``btf_type ``.
@@ -424,9 +424,8 @@ following data::
424
424
__u32 linkage;
425
425
};
426
426
427
- ``struct btf_var `` encoding:
428
- * ``linkage ``: currently only static variable 0, or globally allocated
429
- variable in ELF sections 1
427
+ ``btf_var.linkage `` may take the values: BTF_VAR_STATIC, BTF_VAR_GLOBAL_ALLOCATED or BTF_VAR_GLOBAL_EXTERN -
428
+ see :ref: `BTF_Var_Linkage_Constants `.
430
429
431
430
Not all type of global variables are supported by LLVM at this point.
432
431
The following is currently available:
@@ -549,6 +548,38 @@ The ``btf_enum64`` encoding:
549
548
If the original enum value is signed and the size is less than 8,
550
549
that value will be sign extended into 8 bytes.
551
550
551
+ 2.3 Constant Values
552
+ -------------------
553
+
554
+ .. _BTF_Function_Linkage_Constants :
555
+
556
+ 2.3.1 Function Linkage Constant Values
557
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
558
+ .. table :: Function Linkage Values and Meanings
559
+
560
+ =================== ===== ===========
561
+ kind value description
562
+ =================== ===== ===========
563
+ ``BTF_FUNC_STATIC `` 0x0 definition of subprogram not visible outside containing compilation unit
564
+ ``BTF_FUNC_GLOBAL `` 0x1 definition of subprogram visible outside containing compilation unit
565
+ ``BTF_FUNC_EXTERN `` 0x2 declaration of a subprogram whose definition is outside the containing compilation unit
566
+ =================== ===== ===========
567
+
568
+
569
+ .. _BTF_Var_Linkage_Constants :
570
+
571
+ 2.3.2 Variable Linkage Constant Values
572
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
573
+ .. table :: Variable Linkage Values and Meanings
574
+
575
+ ============================ ===== ===========
576
+ kind value description
577
+ ============================ ===== ===========
578
+ ``BTF_VAR_STATIC `` 0x0 definition of global variable not visible outside containing compilation unit
579
+ ``BTF_VAR_GLOBAL_ALLOCATED `` 0x1 definition of global variable visible outside containing compilation unit
580
+ ``BTF_VAR_GLOBAL_EXTERN `` 0x2 declaration of global variable whose definition is outside the containing compilation unit
581
+ ============================ ===== ===========
582
+
552
583
3. BTF Kernel API
553
584
=================
554
585
0 commit comments