aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/uapi/linux/bpf.h13
-rw-r--r--tools/include/uapi/linux/btf.h20
2 files changed, 30 insertions, 3 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index aa582cd5bfcf..91c43884f295 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -133,6 +133,14 @@ enum bpf_map_type {
133 BPF_MAP_TYPE_STACK, 133 BPF_MAP_TYPE_STACK,
134}; 134};
135 135
136/* Note that tracing related programs such as
137 * BPF_PROG_TYPE_{KPROBE,TRACEPOINT,PERF_EVENT,RAW_TRACEPOINT}
138 * are not subject to a stable API since kernel internal data
139 * structures can change from release to release and may
140 * therefore break existing tracing BPF programs. Tracing BPF
141 * programs correspond to /a/ specific kernel which is to be
142 * analyzed, and not /a/ specific kernel /and/ all future ones.
143 */
136enum bpf_prog_type { 144enum bpf_prog_type {
137 BPF_PROG_TYPE_UNSPEC, 145 BPF_PROG_TYPE_UNSPEC,
138 BPF_PROG_TYPE_SOCKET_FILTER, 146 BPF_PROG_TYPE_SOCKET_FILTER,
@@ -343,7 +351,7 @@ union bpf_attr {
343 __u32 log_level; /* verbosity level of verifier */ 351 __u32 log_level; /* verbosity level of verifier */
344 __u32 log_size; /* size of user buffer */ 352 __u32 log_size; /* size of user buffer */
345 __aligned_u64 log_buf; /* user supplied buffer */ 353 __aligned_u64 log_buf; /* user supplied buffer */
346 __u32 kern_version; /* checked when prog_type=kprobe */ 354 __u32 kern_version; /* not used */
347 __u32 prog_flags; 355 __u32 prog_flags;
348 char prog_name[BPF_OBJ_NAME_LEN]; 356 char prog_name[BPF_OBJ_NAME_LEN];
349 __u32 prog_ifindex; /* ifindex of netdev to prep for */ 357 __u32 prog_ifindex; /* ifindex of netdev to prep for */
@@ -2657,6 +2665,7 @@ struct sk_msg_md {
2657 __u32 local_ip6[4]; /* Stored in network byte order */ 2665 __u32 local_ip6[4]; /* Stored in network byte order */
2658 __u32 remote_port; /* Stored in network byte order */ 2666 __u32 remote_port; /* Stored in network byte order */
2659 __u32 local_port; /* stored in host byte order */ 2667 __u32 local_port; /* stored in host byte order */
2668 __u32 size; /* Total size of sk_msg */
2660}; 2669};
2661 2670
2662struct sk_reuseport_md { 2671struct sk_reuseport_md {
@@ -2717,6 +2726,8 @@ struct bpf_prog_info {
2717 __u32 nr_jited_line_info; 2726 __u32 nr_jited_line_info;
2718 __u32 line_info_rec_size; 2727 __u32 line_info_rec_size;
2719 __u32 jited_line_info_rec_size; 2728 __u32 jited_line_info_rec_size;
2729 __u32 nr_prog_tags;
2730 __aligned_u64 prog_tags;
2720} __attribute__((aligned(8))); 2731} __attribute__((aligned(8)));
2721 2732
2722struct bpf_map_info { 2733struct bpf_map_info {
diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi/linux/btf.h
index 14f66948fc95..7b7475ef2f17 100644
--- a/tools/include/uapi/linux/btf.h
+++ b/tools/include/uapi/linux/btf.h
@@ -34,7 +34,9 @@ struct btf_type {
34 * bits 0-15: vlen (e.g. # of struct's members) 34 * bits 0-15: vlen (e.g. # of struct's members)
35 * bits 16-23: unused 35 * bits 16-23: unused
36 * bits 24-27: kind (e.g. int, ptr, array...etc) 36 * bits 24-27: kind (e.g. int, ptr, array...etc)
37 * bits 28-31: unused 37 * bits 28-30: unused
38 * bit 31: kind_flag, currently used by
39 * struct, union and fwd
38 */ 40 */
39 __u32 info; 41 __u32 info;
40 /* "size" is used by INT, ENUM, STRUCT and UNION. 42 /* "size" is used by INT, ENUM, STRUCT and UNION.
@@ -52,6 +54,7 @@ struct btf_type {
52 54
53#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f) 55#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f)
54#define BTF_INFO_VLEN(info) ((info) & 0xffff) 56#define BTF_INFO_VLEN(info) ((info) & 0xffff)
57#define BTF_INFO_KFLAG(info) ((info) >> 31)
55 58
56#define BTF_KIND_UNKN 0 /* Unknown */ 59#define BTF_KIND_UNKN 0 /* Unknown */
57#define BTF_KIND_INT 1 /* Integer */ 60#define BTF_KIND_INT 1 /* Integer */
@@ -110,9 +113,22 @@ struct btf_array {
110struct btf_member { 113struct btf_member {
111 __u32 name_off; 114 __u32 name_off;
112 __u32 type; 115 __u32 type;
113 __u32 offset; /* offset in bits */ 116 /* If the type info kind_flag is set, the btf_member offset
117 * contains both member bitfield size and bit offset. The
118 * bitfield size is set for bitfield members. If the type
119 * info kind_flag is not set, the offset contains only bit
120 * offset.
121 */
122 __u32 offset;
114}; 123};
115 124
125/* If the struct/union type info kind_flag is set, the
126 * following two macros are used to access bitfield_size
127 * and bit_offset from btf_member.offset.
128 */
129#define BTF_MEMBER_BITFIELD_SIZE(val) ((val) >> 24)
130#define BTF_MEMBER_BIT_OFFSET(val) ((val) & 0xffffff)
131
116/* BTF_KIND_FUNC_PROTO is followed by multiple "struct btf_param". 132/* 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 133 * The exact number of btf_param is stored in the vlen (of the
118 * info in "struct btf_type"). 134 * info in "struct btf_type").