bpftool: recognize BPF_PROG_TYPE_CGROUP_DEVICE programs
authorRoman Gushchin <[email protected]>
Mon, 15 Jan 2018 19:16:15 +0000 (19:16 +0000)
committerDaniel Borkmann <[email protected]>
Tue, 16 Jan 2018 01:49:49 +0000 (02:49 +0100)
commit45e5e1212af4633aa76db387ccaac8b41c8a7b6c
tree4aee8f854e8caa163573cd95d392c40e9b1fd9cd
parente3b073c7ca32c68ccd3827248ad84e16b8fa3d29
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

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]>
Acked-by: Jakub Kicinski <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
tools/bpf/bpftool/prog.c