1
0
Fork 0
alistair23-linux/tools/bpf
Hechao Li 4783bf08f8 bpf: Print error message for bpftool cgroup show
[ Upstream commit 1162f84403 ]

Currently, when bpftool cgroup show <path> has an error, no error
message is printed. This is confusing because the user may think the
result is empty.

Before the change:

$ bpftool cgroup show /sys/fs/cgroup
ID       AttachType      AttachFlags     Name
$ echo $?
255

After the change:
$ ./bpftool cgroup show /sys/fs/cgroup
Error: can't query bpf programs attached to /sys/fs/cgroup: Operation
not permitted

v2: Rename check_query_cgroup_progs to cgroup_has_attached_progs

Signed-off-by: Hechao Li <hechaol@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191224011742.3714301-1-hechaol@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:36:40 +01:00
..
bpftool bpf: Print error message for bpftool cgroup show 2020-02-24 08:36:40 +01:00
.gitignore tools: bpf: account for generated feature/ and libbpf/ directories 2019-08-31 00:38:16 +02:00
Makefile tools, bpf: Fix build for 'make -s tools/bpf O=<dir>' 2019-12-31 16:45:47 +01:00
Makefile.helpers treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
bpf_asm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 232 2019-06-19 17:09:06 +02:00
bpf_dbg.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 232 2019-06-19 17:09:06 +02:00
bpf_exp.l bpf: fix cbpf parser bug for octal numbers 2018-06-03 07:46:55 -07:00
bpf_exp.y tools: rename tools/net directory to tools/bpf 2017-10-04 21:45:05 -07:00
bpf_jit_disasm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 232 2019-06-19 17:09:06 +02:00