Skip to content

Commit 781e775

Browse files
iamkafaiAlexei Starovoitov
authored andcommitted
tools/bpf: Sync kernel btf.h header
The kernel uapi btf.h is synced to the tools directory. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 2667a26 commit 781e775

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

  • tools/include/uapi/linux

‎tools/include/uapi/linux/btf.h‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ struct btf_type {
4040
/* "size" is used by INT, ENUM, STRUCT and UNION.
4141
* "size" tells the size of the type it is describing.
4242
*
43-
* "type" is used by PTR, TYPEDEF, VOLATILE, CONST and RESTRICT.
43+
* "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
44+
* FUNC and FUNC_PROTO.
4445
* "type" is a type_id referring to another type.
4546
*/
4647
union {
@@ -64,8 +65,10 @@ struct btf_type {
6465
#define BTF_KIND_VOLATILE 9 /* Volatile */
6566
#define BTF_KIND_CONST 10 /* Const */
6667
#define BTF_KIND_RESTRICT 11 /* Restrict */
67-
#define BTF_KIND_MAX 11
68-
#define NR_BTF_KINDS 12
68+
#define BTF_KIND_FUNC 12 /* Function */
69+
#define BTF_KIND_FUNC_PROTO 13 /* Function Proto */
70+
#define BTF_KIND_MAX 13
71+
#define NR_BTF_KINDS 14
6972

7073
/* For some specific BTF_KIND, "struct btf_type" is immediately
7174
* followed by extra data.
@@ -110,4 +113,13 @@ struct btf_member {
110113
__u32 offset; /* offset in bits */
111114
};
112115

116+
/* BTF_KIND_FUNC_PROTO is followed by multiple "struct btf_param".
117+
* The exact number of btf_param is stored in the vlen (of the
118+
* info in "struct btf_type").
119+
*/
120+
struct btf_param {
121+
__u32 name_off;
122+
__u32 type;
123+
};
124+
113125
#endif /* _UAPI__LINUX_BTF_H__ */

0 commit comments

Comments
 (0)