History

bpf: btf: Clean up btf.h in uapi

This patch cleans up btf.h in uapi: 1) Rename "name" to "name_off" to better reflect it is an offset to the string section instead of a char array. 2) Remove unused value BTF_FLAGS_COMPR and BTF_MAGIC_SWAP

Martin KaFai Lau committed 8 years ago

Commit fbcf93e1 parent aaa64524 files · +17 −21Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/btf.h+3−5
@@ -6,9 +6,7 @@ · 5 unmodified lines
66 #include <linux/types.h>
77
88 #define BTF_MAGIC 0xeB9F
9−#define BTF_MAGIC_SWAP 0x9FeB
109 #define BTF_VERSION 1
11−#define BTF_FLAGS_COMPR 0x01
1210
1311 struct btf_header {
1412 __u16 magic;
@@ -43,7 +41,7 @@ struct btf_header { · 28 unmodified lines
4341 #define BTF_STR_OFFSET(ref) ((ref) & BTF_MAX_NAME_OFFSET)
4442
4543 struct btf_type {
46− __u32 name;
44+ __u32 name_off;
4745 /* "info" bits arrangement
4846 * bits 0-15: vlen (e.g. # of struct's members)
4947 * bits 16-23: unused
@@ -105,7 +103,7 @@ struct btf_type { · 55 unmodified lines
105103 * info in "struct btf_type").
106104 */
107105 struct btf_enum {
108− __u32 name;
106+ __u32 name_off;
109107 __s32 val;
110108 };
111109
@@ -122,7 +120,7 @@ struct btf_array { · 10 unmodified lines
122120 * "struct btf_type").
123121 */
124122 struct btf_member {
125− __u32 name;
123+ __u32 name_off;
126124 __u32 type;
127125 __u32 offset; /* offset in bits */
128126 };