aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/uapi/linux
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2018-04-21 12:48:23 -0400
committerDaniel Borkmann <daniel@iogearbox.net>2018-04-23 05:32:01 -0400
commitfbcf93ebcaef7d09881ee308b52cd84f5e43c622 (patch)
treed288b7f6c42edfd624ca2ce9c65594ea91eba15b /tools/include/uapi/linux
parentaaa6452763cf944da72f16e0736554accb364703 (diff)
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 Suggested-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/include/uapi/linux')
-rw-r--r--tools/include/uapi/linux/btf.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi/linux/btf.h
index 74a30b1090df..bcb56ee47014 100644
--- a/tools/include/uapi/linux/btf.h
+++ b/tools/include/uapi/linux/btf.h
@@ -6,9 +6,7 @@
6#include <linux/types.h> 6#include <linux/types.h>
7 7
8#define BTF_MAGIC 0xeB9F 8#define BTF_MAGIC 0xeB9F
9#define BTF_MAGIC_SWAP 0x9FeB
10#define BTF_VERSION 1 9#define BTF_VERSION 1
11#define BTF_FLAGS_COMPR 0x01
12 10
13struct btf_header { 11struct btf_header {
14 __u16 magic; 12 __u16 magic;
@@ -43,7 +41,7 @@ struct btf_header {
43#define BTF_STR_OFFSET(ref) ((ref) & BTF_MAX_NAME_OFFSET) 41#define BTF_STR_OFFSET(ref) ((ref) & BTF_MAX_NAME_OFFSET)
44 42
45struct btf_type { 43struct btf_type {
46 __u32 name; 44 __u32 name_off;
47 /* "info" bits arrangement 45 /* "info" bits arrangement
48 * bits 0-15: vlen (e.g. # of struct's members) 46 * bits 0-15: vlen (e.g. # of struct's members)
49 * bits 16-23: unused 47 * bits 16-23: unused
@@ -105,7 +103,7 @@ struct btf_type {
105 * info in "struct btf_type"). 103 * info in "struct btf_type").
106 */ 104 */
107struct btf_enum { 105struct btf_enum {
108 __u32 name; 106 __u32 name_off;
109 __s32 val; 107 __s32 val;
110}; 108};
111 109
@@ -122,7 +120,7 @@ struct btf_array {
122 * "struct btf_type"). 120 * "struct btf_type").
123 */ 121 */
124struct btf_member { 122struct btf_member {
125 __u32 name; 123 __u32 name_off;
126 __u32 type; 124 __u32 type;
127 __u32 offset; /* offset in bits */ 125 __u32 offset; /* offset in bits */
128}; 126};