From: Dmitry V. Levin Date: Mon, 1 Jul 2019 10:41:54 +0000 (+0000) Subject: xlat: update BPF_* constants X-Git-Tag: v5.2~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f02f985e2155f609285b4f3a0e4f5117a39cb133;p=strace xlat: update BPF_* constants * xlat/bpf_attach_type.in (BPF_CGROUP_SYSCTL): New constant introduced by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19. (BPF_CGROUP_UDP4_RECVMSG, BPF_CGROUP_UDP6_RECVMSG): New constants introduced by Linux kernel commit v5.2-rc6~33^2~44^2^2~5. * xlat/bpf_commands.in (BPF_MAP_FREEZE): New constant introduced by Linux kernel commit v5.2-rc1~133^2~193^2~12^2~12. * xlat/bpf_map_flags.in (BPF_F_RDONLY_PROG, BPF_F_WRONLY_PROG): New constants introduced by Linux kernel commit v5.2-rc1~133^2~193^2~12^2~13. * xlat/bpf_map_types.in (BPF_MAP_TYPE_SK_STORAGE): New constant introduced by Linux kernel commit v5.2-rc1~133^2~80^2^2~6. * xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SYSCTL): New constant introduced by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19. (BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE): New constant introduced by Linux kernel commit v5.2-rc1~133^2~80^2~1^2~4. * NEWS: Mention this. * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update. * tests/kernel_version.c (print_bpf_attr): Update. --- diff --git a/NEWS b/NEWS index 06b5db9b..cb1c5450 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,7 @@ Noteworthy changes in release ?.? (????-??-??) * Implemented decoding of open_tree, move_mount, fsopen, fsconfig, fsmount, and fspick syscalls. * Enhanced decoding of clone syscall. - * Updated lists of AT_*, AUDIT_*, CLONE_*, ETH_*, KEY_*, KVM_*, TIPC_*, + * Updated lists of AT_*, AUDIT_*, BPF_*, CLONE_*, ETH_*, KEY_*, KVM_*, TIPC_*, and V4L2_* constants. Noteworthy changes in release 5.1 (2019-05-22) diff --git a/tests/bpf.c b/tests/bpf.c index fd29ab44..8905d737 100644 --- a/tests/bpf.c +++ b/tests/bpf.c @@ -281,21 +281,21 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { }, { /* 2 */ .data = { .BPF_MAP_CREATE_data = { - .map_type = 24, + .map_type = 25, .key_size = 0xface1e55, .value_size = 0xbadc0ded, .max_entries = 0xbeefcafe, - .map_flags = 0xffffff80, + .map_flags = 0xfffffe00, .inner_map_fd = 2718281828, .numa_node = -1, .map_name = "", .map_ifindex = 3141592653, } }, .size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex), - .str = "map_type=0x18 /* BPF_MAP_TYPE_??? */" + .str = "map_type=0x19 /* BPF_MAP_TYPE_??? */" ", key_size=4207812181, value_size=3134983661" ", max_entries=3203386110" - ", map_flags=0xffffff80 /* BPF_F_??? */" + ", map_flags=0xfffffe00 /* BPF_F_??? */" ", inner_map_fd=-1576685468" ", map_name=\"\", map_ifindex=3141592653", @@ -316,7 +316,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { ", max_entries=3203386110" ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" - "|0xc0dede80", + "|BPF_F_RDONLY_PROG|0xc0dede00", }, { /* 4 */ .data = { .BPF_MAP_CREATE_data = { @@ -334,7 +334,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { ", max_entries=3203386110" ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" - "|0xc0dede80" + "|BPF_F_RDONLY_PROG|0xc0dede00" ", inner_map_fd=-1576685468", }, { /* 5 */ @@ -353,7 +353,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { ", max_entries=3203386110" ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" - "|0xc0dede80" + "|BPF_F_RDONLY_PROG|0xc0dede00" ", inner_map_fd=-1576685468" ", numa_node=4294967295 /* NUMA_NO_NODE */", }, @@ -374,7 +374,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { ", max_entries=3203386110" ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" - "|0xc0dede80" + "|BPF_F_RDONLY_PROG|0xc0dede00" ", inner_map_fd=-1576685468" ", numa_node=4294967295 /* NUMA_NO_NODE */" ", map_name=\"fedcba987654321\"...", @@ -396,7 +396,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { ", max_entries=3203386110" ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" - "|0xc0dede80" + "|BPF_F_RDONLY_PROG|0xc0dede00" ", inner_map_fd=-1576685468" ", numa_node=4294967295 /* NUMA_NO_NODE */" ", map_name=\"0123456789abcde\"" @@ -598,7 +598,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = { }, { /* 1 */ .data = { .BPF_PROG_LOAD_data = { - .prog_type = 22, + .prog_type = 24, .insn_cnt = 0xbadc0ded, .insns = 0, .license = 0, @@ -609,7 +609,7 @@ static struct bpf_attr_check BPF_PROG_LOAD_checks[] = { .prog_flags = 0, } }, .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_flags), - .str = "prog_type=0x16 /* BPF_PROG_TYPE_??? */" + .str = "prog_type=0x18 /* BPF_PROG_TYPE_??? */" ", insn_cnt=3134983661, insns=NULL, license=NULL" ", log_level=42, log_size=3141592653, log_buf=NULL" ", kern_version=KERNEL_VERSION(51966, 240, 13)" @@ -1017,7 +1017,7 @@ static struct bpf_attr_check BPF_PROG_QUERY_checks[] = { { /* 2 */ .data = { .BPF_PROG_QUERY_data = { .target_fd = 3141592653U, - .attach_type = 18, + .attach_type = 21, .query_flags = 0xfffffffe, .attach_flags = 0xfffffffc, .prog_ids = 0xffffffffffffffffULL, @@ -1025,7 +1025,7 @@ static struct bpf_attr_check BPF_PROG_QUERY_checks[] = { } }, .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), .str = "query={target_fd=-1153374643" - ", attach_type=0x12 /* BPF_??? */" + ", attach_type=0x15 /* BPF_??? */" ", query_flags=0xfffffffe /* BPF_F_QUERY_??? */" ", attach_flags=0xfffffffc /* BPF_F_??? */" ", prog_ids=" diff --git a/tests/kernel_version.c b/tests/kernel_version.c index 6e1c0eac..6055a299 100644 --- a/tests/kernel_version.c +++ b/tests/kernel_version.c @@ -35,9 +35,9 @@ static void print_bpf_attr(void) { #if XLAT_RAW - printf("{prog_type=0x16" + printf("{prog_type=0x18" #else - printf("{prog_type=0x16 /* BPF_PROG_TYPE_??? */" + printf("{prog_type=0x18 /* BPF_PROG_TYPE_??? */" #endif ", insn_cnt=3134983661" ", insns=NULL" @@ -78,7 +78,7 @@ main(void) { long ret; struct BPF_PROG_LOAD_struct prog = { - .prog_type = 22, + .prog_type = 24, .insn_cnt = 0xbadc0ded, .insns = 0, .license = 0, diff --git a/xlat/bpf_attach_type.in b/xlat/bpf_attach_type.in index 29a58b81..a753b3c1 100644 --- a/xlat/bpf_attach_type.in +++ b/xlat/bpf_attach_type.in @@ -17,3 +17,6 @@ BPF_CGROUP_UDP4_SENDMSG 14 BPF_CGROUP_UDP6_SENDMSG 15 BPF_LIRC_MODE2 16 BPF_FLOW_DISSECTOR 17 +BPF_CGROUP_SYSCTL 18 +BPF_CGROUP_UDP4_RECVMSG 19 +BPF_CGROUP_UDP6_RECVMSG 20 diff --git a/xlat/bpf_commands.in b/xlat/bpf_commands.in index 6dff998d..e607cbfa 100644 --- a/xlat/bpf_commands.in +++ b/xlat/bpf_commands.in @@ -21,3 +21,4 @@ BPF_BTF_LOAD 18 BPF_BTF_GET_FD_BY_ID 19 BPF_TASK_FD_QUERY 20 BPF_MAP_LOOKUP_AND_DELETE_ELEM 21 +BPF_MAP_FREEZE 22 diff --git a/xlat/bpf_map_flags.in b/xlat/bpf_map_flags.in index a2790db6..69e4f40a 100644 --- a/xlat/bpf_map_flags.in +++ b/xlat/bpf_map_flags.in @@ -5,3 +5,5 @@ BPF_F_RDONLY (1U << 3) BPF_F_WRONLY (1U << 4) BPF_F_STACK_BUILD_ID (1U << 5) BPF_F_ZERO_SEED (1U << 6) +BPF_F_RDONLY_PROG (1U << 7) +BPF_F_WRONLY_PROG (1U << 8) diff --git a/xlat/bpf_map_types.in b/xlat/bpf_map_types.in index 8a67d3ed..616b84b2 100644 --- a/xlat/bpf_map_types.in +++ b/xlat/bpf_map_types.in @@ -23,3 +23,4 @@ BPF_MAP_TYPE_REUSEPORT_SOCKARRAY 20 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE 21 BPF_MAP_TYPE_QUEUE 22 BPF_MAP_TYPE_STACK 23 +BPF_MAP_TYPE_SK_STORAGE 24 diff --git a/xlat/bpf_prog_types.in b/xlat/bpf_prog_types.in index dd1b4079..452189ff 100644 --- a/xlat/bpf_prog_types.in +++ b/xlat/bpf_prog_types.in @@ -21,3 +21,5 @@ BPF_PROG_TYPE_LWT_SEG6LOCAL 18 BPF_PROG_TYPE_LIRC_MODE2 19 BPF_PROG_TYPE_SK_REUSEPORT 20 BPF_PROG_TYPE_FLOW_DISSECTOR 21 +BPF_PROG_TYPE_CGROUP_SYSCTL 22 +BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE 23