bpftool: recognize BPF_PROG_TYPE_CGROUP_DEVICE programs
Subsystems (4)
PATCH 1/1 bpftool: recognize BPF_PROG_TYPE_CGROUP_DEVICE programs
Bpftool doesn't recognize BPF_PROG_TYPE_CGROUP_DEVICE programs, so the prog show command prints the numeric type value:
$ bpftool prog show 1: type 15 name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096B
This patch defines the corresponding textual representation:
$ bpftool prog show 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096B
--- tools/bpf/bpftool/prog.c | 1 + 1 file changed, 1 insertion(+)
tools/bpf/bpftool/prog.c +1 -0
@@ -66,6 +66,7 @@ static const char * const prog_type_name[] = { [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit", [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops", [BPF_PROG_TYPE_SK_SKB] = "sk_skb", + [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device", };static void print_boot_time (__u64 nsecs,char *buf,unsigned int size)
Signature · 1 line
2.14.3
2018-01-15 19:16 UTC+0000 ~ Roman Gushchin <[email protected]>
Quoted 29 lines
Bpftool doesn't recognize
BPF_PROG_TYPE_CGROUP_DEVICEprograms, so the prog show command prints the numeric type value:$ bpftool prog show 1: type 15 name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BThis patch defines the corresponding textual representation:
$ bpftool prog show 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BSigned-off-by Roman Gushchin <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Quentin Monnet <[email protected]>Cc Daniel Borkmann <[email protected]>Cc Alexei Starovoitov <[email protected]>--- tools/bpf/bpftool/prog.c | 1 + 1 file changed, 1 insertion(+)tools/bpf/bpftool/prog.c +0
-0
tools/bpf/bpftool/prog.c static const char * const prog_type_name[] = { · line 72
Quoted 7 lines
tools/bpf/bpftool/prog.c +1
-0@@ -66,6 +66,7 @@ static const char * const prog_type_name[] = { [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit", [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops", [BPF_PROG_TYPE_SK_SKB] = "sk_skb", + [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device", };static void print_boot_time (__u64 nsecs,char *buf,unsigned int size)
Looks good, thanks Roman!
Would you mind updating the map names as well? It seems the BPF_MAP_TYPE_CPUMAP is missing from the list in map.c.
Quentin
Quoted 36 lines · Quentin Monnet
2018-01-15 19:16 UTC+0000 ~ Roman Gushchin <[email protected]>
Quoted 35 lines
Bpftool doesn't recognize
BPF_PROG_TYPE_CGROUP_DEVICEprograms, so the prog show command prints the numeric type value:$ bpftool prog show 1: type 15 name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BThis patch defines the corresponding textual representation:
$ bpftool prog show 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BSigned-off-by Roman Gushchin <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Quentin Monnet <[email protected]>Cc Daniel Borkmann <[email protected]>Cc Alexei Starovoitov <[email protected]>--- tools/bpf/bpftool/prog.c | 1 + 1 file changed, 1 insertion(+)tools/bpf/bpftool/prog.c +1
-0@@ -66,6 +66,7 @@ static const char * const prog_type_name[] = { [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit", [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops", [BPF_PROG_TYPE_SK_SKB] = "sk_skb", + [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device", };
Quoted 5 lines
tools/bpf/bpftool/prog.c static const char * const prog_type_name[] = { · line 72
Quoted 1 line
tools/bpf/bpftool/prog.c +0
-0static void print_boot_time (__u64 nsecs,char *buf,unsigned int size)Looks good, thanks Roman!
Would you mind updating the map names as well? It seems theBPF_MAP_TYPE_CPUMAPis missing from the list inmap.c.
Hello, Quentin!
Sure, I'll take a look.
Thanks!
Daniel Borkmann
maintainerQuoted 43 lines · Roman Gushchin
Quoted 36 lines · Quentin Monnet
2018-01-15 19:16 UTC+0000 ~ Roman Gushchin <[email protected]>
Quoted 35 lines
Bpftool doesn't recognize
BPF_PROG_TYPE_CGROUP_DEVICEprograms, so the prog show command prints the numeric type value:$ bpftool prog show 1: type 15 name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BThis patch defines the corresponding textual representation:
$ bpftool prog show 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BSigned-off-by Roman Gushchin <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Quentin Monnet <[email protected]>Cc Daniel Borkmann <[email protected]>Cc Alexei Starovoitov <[email protected]>--- tools/bpf/bpftool/prog.c | 1 + 1 file changed, 1 insertion(+)tools/bpf/bpftool/prog.c +1
-0@@ -66,6 +66,7 @@ static const char * const prog_type_name[] = { [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit", [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops", [BPF_PROG_TYPE_SK_SKB] = "sk_skb", + [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device", };Quoted 5 lines
tools/bpf/bpftool/prog.c static const char * const prog_type_name[] = { · line 72
Quoted 1 line
tools/bpf/bpftool/prog.c +0
-0static void print_boot_time (__u64 nsecs,char *buf,unsigned int size)Looks good, thanks Roman!
Would you mind updating the map names as well? It seems theBPF_MAP_TYPE_CPUMAPis missing from the list inmap.c.
Quoted 3 lines
Hello, Quentin!
Sure, I'll take a look.
Ok, I presume this comes in as a separate one anyway, so I've applied this one into bpf-next already, thanks Roman!
Quoted 36 lines · Quentin Monnet
2018-01-15 19:16 UTC+0000 ~ Roman Gushchin <[email protected]>
Quoted 35 lines
Bpftool doesn't recognize
BPF_PROG_TYPE_CGROUP_DEVICEprograms, so the prog show command prints the numeric type value:$ bpftool prog show 1: type 15 name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BThis patch defines the corresponding textual representation:
$ bpftool prog show 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BSigned-off-by Roman Gushchin <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Quentin Monnet <[email protected]>Cc Daniel Borkmann <[email protected]>Cc Alexei Starovoitov <[email protected]>--- tools/bpf/bpftool/prog.c | 1 + 1 file changed, 1 insertion(+)tools/bpf/bpftool/prog.c +1
-0@@ -66,6 +66,7 @@ static const char * const prog_type_name[] = { [BPF_PROG_TYPE_LWT_XMIT] = "lwt_xmit", [BPF_PROG_TYPE_SOCK_OPS] = "sock_ops", [BPF_PROG_TYPE_SK_SKB] = "sk_skb", + [BPF_PROG_TYPE_CGROUP_DEVICE] = "cgroup_device", };
Quoted 5 lines
tools/bpf/bpftool/prog.c static const char * const prog_type_name[] = { · line 72
Quoted 1 line
tools/bpf/bpftool/prog.c +0
-0static void print_boot_time (__u64 nsecs,char *buf,unsigned int size)Looks good, thanks Roman!
Would you mind updating the map names as well? It seems theBPF_MAP_TYPE_CPUMAPis missing from the list inmap.c.
Hello, Quentin!
Here is the patch.
Thanks!
--
Quoted 1 line
From
16245383a894038a63cc1ad4b77629ba704aaa38Mon Sep 17 00:00:00 2001
From: Roman Gushchin <[email protected]>
Date: Fri, 19 Jan 2018 14:07:38 +0000
Subject: [PATCH bpf-next] bpftool: recognize BPF_MAP_TYPE_CPUMAP maps
Add BPF_MAP_TYPE_CPUMAP map type to the list of map type recognized by bpftool and define corresponding text representation.
--- tools/bpf/bpftool/map.c | 1 + 1 file changed, 1 insertion(+)
tools/bpf/bpftool/map.c +1 -0
@@ -66,6 +66,7 @@ static const char * const map_type_name[] = { [BPF_MAP_TYPE_HASH_OF_MAPS] = "hash_of_maps", [BPF_MAP_TYPE_DEVMAP] = "devmap", [BPF_MAP_TYPE_SOCKMAP] = "sockmap", + [BPF_MAP_TYPE_CPUMAP] = "cpumap", };static unsigned int get_possible_cpus (void )
Signature · 1 line
2.14.3
Quentin Monnet
Acked-by2018-01-19 14:17 UTC+0000 ~ Roman Gushchin <[email protected]>
Quoted 1 line · Quentin Monnet
[...]
Quoted 38 lines
Quoted 3 lines
Looks good, thanks Roman!
Would you mind updating the map names as well? It seems theBPF_MAP_TYPE_CPUMAPis missing from the list inmap.c.Hello, Quentin!
Here is the patch.
Thanks!
--
From
16245383a894038a63cc1ad4b77629ba704aaa38Mon Sep 17 00:00:00 2001
From: Roman Gushchin <[email protected]>
Date: Fri, 19 Jan 2018 14:07:38 +0000
Subject: [PATCH bpf-next] bpftool: recognizeBPF_MAP_TYPE_CPUMAPmapsAdd
BPF_MAP_TYPE_CPUMAPmap type to the list
of map type recognized by bpftool and define
corresponding text representation.Signed-off-by Roman Gushchin <[email protected]>Cc Quentin Monnet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Daniel Borkmann <[email protected]>Cc Alexei Starovoitov <[email protected]>--- tools/bpf/bpftool/map.c | 1 + 1 file changed, 1 insertion(+)tools/bpf/bpftool/map.c +0
-0
tools/bpf/bpftool/map.c static const char * const map_type_name[] = { · line 72
Quoted 7 lines
tools/bpf/bpftool/map.c +1
-0@@ -66,6 +66,7 @@ static const char * const map_type_name[] = { [BPF_MAP_TYPE_HASH_OF_MAPS] = "hash_of_maps", [BPF_MAP_TYPE_DEVMAP] = "devmap", [BPF_MAP_TYPE_SOCKMAP] = "sockmap", + [BPF_MAP_TYPE_CPUMAP] = "cpumap", };static unsigned int get_possible_cpus (void )
Good, thank you!
Quoted 48 lines · Quentin Monnet
2018-01-19 14:17 UTC+0000 ~ Roman Gushchin <[email protected]>
Quoted 1 line · Quentin Monnet
[...]
Quoted 43 lines
Quoted 3 lines
Looks good, thanks Roman!
Would you mind updating the map names as well? It seems theBPF_MAP_TYPE_CPUMAPis missing from the list inmap.c.Hello, Quentin!
Here is the patch.
Thanks!
--
From
16245383a894038a63cc1ad4b77629ba704aaa38Mon Sep 17 00:00:00 2001
From: Roman Gushchin <[email protected]>
Date: Fri, 19 Jan 2018 14:07:38 +0000
Subject: [PATCH bpf-next] bpftool: recognizeBPF_MAP_TYPE_CPUMAPmapsAdd
BPF_MAP_TYPE_CPUMAPmap type to the list
of map type recognized by bpftool and define
corresponding text representation.Signed-off-by Roman Gushchin <[email protected]>Cc Quentin Monnet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Daniel Borkmann <[email protected]>Cc Alexei Starovoitov <[email protected]>--- tools/bpf/bpftool/map.c | 1 + 1 file changed, 1 insertion(+)tools/bpf/bpftool/map.c +1
-0@@ -66,6 +66,7 @@ static const char * const map_type_name[] = { [BPF_MAP_TYPE_HASH_OF_MAPS] = "hash_of_maps", [BPF_MAP_TYPE_DEVMAP] = "devmap", [BPF_MAP_TYPE_SOCKMAP] = "sockmap", + [BPF_MAP_TYPE_CPUMAP] = "cpumap", };
Quoted 6 lines
tools/bpf/bpftool/map.c static const char * const map_type_name[] = { · line 72
Quoted 2 lines
tools/bpf/bpftool/map.c +0
-0static unsigned int get_possible_cpus (void )Good, thank you!
Acked-by Quentin Monnet <[email protected]>
Applied to bpf-next, thanks for following up Roman!
Quoted 7 lines · Roman Gushchin
Quoted 3 lines
Looks good, thanks Roman!
Would you mind updating the map names as well? It seems theBPF_MAP_TYPE_CPUMAPis missing from the list inmap.c.Hello, Quentin!
Here is the patch.
Thank you for following up, would you also be abble to find time to look into bash completions for cgroups before 4.16-rc1? It would be cool to have the completions... complete ;)
Quoted 15 lines · Roman Gushchin
Bpftool doesn't recognize
BPF_PROG_TYPE_CGROUP_DEVICEprograms, so the prog show command prints the numeric type value:$ bpftool prog show 1: type 15 name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096BThis patch defines the corresponding textual representation:
$ bpftool prog show 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 loaded_at Jan 15/07:58 uid 0 xlated 96B jited 105B memlock 4096B
Quoted 5 lines
Signed-off-by Roman Gushchin <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Quentin Monnet <[email protected]>Cc Daniel Borkmann <[email protected]>Cc Alexei Starovoitov <[email protected]>
Thanks!