linux/tools/bpf/bpftool
Kenta Tada 98b303c9bf bpftool: Query only cgroup-related attach types
When CONFIG_NETKIT=y,
bpftool-cgroup shows error even if the cgroup's path is correct:

$ bpftool cgroup tree /sys/fs/cgroup
CgroupPath
ID       AttachType      AttachFlags     Name
Error: can't query bpf programs attached to /sys/fs/cgroup: No such device or address

>From strace and kernel tracing, I found netkit returned ENXIO and this command failed.
I think this AttachType(BPF_NETKIT_PRIMARY) is not relevant to cgroup.

bpftool-cgroup should query just only cgroup-related attach types.

v2->v3:
  - removed an unnecessary check

v1->v2:
  - used an array of cgroup attach types

Signed-off-by: Kenta Tada <tadakentaso@gmail.com>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/r/20240607111704.6716-1-tadakentaso@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2024-06-11 11:39:09 -07:00
..
bash-completion bpftool: Introduce btf c dump sorting 2024-05-18 10:46:16 -07:00
Documentation bpftool: Introduce btf c dump sorting 2024-05-18 10:46:16 -07:00
skeleton bpftool: Fix typo in MAX_NUM_METRICS macro name 2024-06-03 16:58:27 +02:00
.gitignore bpftool: Fix SPDX tag for Makefiles and .gitignore 2021-11-10 09:00:52 -08:00
btf_dumper.c bpftool: Fix printing of pointer value 2023-10-19 16:29:36 +02:00
btf.c bpftool: Introduce btf c dump sorting 2024-05-18 10:46:16 -07:00
cfg.c bpftool: Support printing opcodes and source file references in CFG 2023-04-05 21:27:27 -07:00
cfg.h bpftool: Support printing opcodes and source file references in CFG 2023-04-05 21:27:27 -07:00
cgroup.c bpftool: Query only cgroup-related attach types 2024-06-11 11:39:09 -07:00
common.c bpftool: Un-const bpf_func_info to fix it for llvm 17 and newer 2024-05-21 10:36:28 -07:00
feature.c bpf: improve error message for unsupported helper 2024-03-28 18:30:53 -07:00
gen.c libbpf: Auto-attach struct_ops BPF maps in BPF skeleton 2024-06-06 10:06:05 -07:00
iter.c bpftool: Mount bpffs on provided dir instead of parent dir 2024-04-04 15:37:12 -07:00
jit_disasm.c bpftool: Fix spelling mistake "disasembler" -> "disassembler" 2022-10-26 18:20:22 -07:00
json_writer.c tools: bpftool: json: Fix backslash escape typo in jsonw_puts 2023-03-29 09:48:45 -07:00
json_writer.h tools: bpftool: json: Fix backslash escape typo in jsonw_puts 2023-03-29 09:48:45 -07:00
link.c bpftool: Add link dump support for BPF_LINK_TYPE_SOCKMAP 2024-04-10 19:52:25 -07:00
main.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
main.h bpftool: Mount bpffs on provided dir instead of parent dir 2024-04-04 15:37:12 -07:00
Makefile bpftool: Fix make dependencies for vmlinux.h 2024-05-18 10:46:16 -07:00
map_perf_ring.c bpftool: Fix error message of strerror 2022-09-30 15:40:46 -07:00
map.c bpftool: Recognize arena map type 2024-03-11 15:37:24 -07:00
net.c bpftool: Extend net dump with netkit progs 2023-10-24 16:07:32 -07:00
netlink_dumper.c bpftool: Use consistent include paths for libbpf 2020-01-20 16:37:45 -08:00
netlink_dumper.h bpftool: Extend net dump with tcx progs 2023-07-19 10:07:28 -07:00
perf.c bpftool: fix perf help message 2023-08-11 20:54:29 -07:00
pids.c bpftool: Enable libbpf logs when loading pid_iter in debug mode 2024-03-19 23:12:22 -07:00
prog.c bpftool: Fix typo in error message 2024-04-12 18:19:09 +02:00
struct_ops.c bpftool: Mount bpffs on provided dir instead of parent dir 2024-04-04 15:37:12 -07:00
tracelog.c bpftool, musl compat: Replace sys/fcntl.h by fcntl.h 2022-04-25 23:24:28 +02:00
xlated_dumper.c bpftool: Dump the kernel symbol's module name 2023-07-11 20:07:50 -07:00
xlated_dumper.h bpftool: Dump the kernel symbol's module name 2023-07-11 20:07:50 -07:00