mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
Merge branch 'bpf/bpftool: add program & link type names'
Milan Landaverde says: ==================== With the addition of the syscall prog type we should now be able to see feature probe info for that prog type: $ bpftool feature probe kernel ... eBPF program_type syscall is available ... eBPF helpers supported for program type syscall: ... - bpf_sys_bpf - bpf_sys_close And for the link types, their names should aid in the output. Before: $ bpftool link show 50: type 7 prog 5042 bpf_cookie 0 pids vfsstat(394433) After: $ bpftool link show 57: perf_event prog 5058 bpf_cookie 0 pids vfsstat(394725) ==================== Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
This commit is contained in:
commit
7224a0737c
@ -567,7 +567,7 @@ probe_prog_type(enum bpf_prog_type prog_type, bool *supported_types,
|
||||
|
||||
res = probe_prog_type_ifindex(prog_type, ifindex);
|
||||
} else {
|
||||
res = libbpf_probe_bpf_prog_type(prog_type, NULL);
|
||||
res = libbpf_probe_bpf_prog_type(prog_type, NULL) > 0;
|
||||
}
|
||||
|
||||
#ifdef USE_LIBCAP
|
||||
|
@ -20,6 +20,9 @@ static const char * const link_type_name[] = {
|
||||
[BPF_LINK_TYPE_CGROUP] = "cgroup",
|
||||
[BPF_LINK_TYPE_ITER] = "iter",
|
||||
[BPF_LINK_TYPE_NETNS] = "netns",
|
||||
[BPF_LINK_TYPE_XDP] = "xdp",
|
||||
[BPF_LINK_TYPE_PERF_EVENT] = "perf_event",
|
||||
[BPF_LINK_TYPE_KPROBE_MULTI] = "kprobe_multi",
|
||||
};
|
||||
|
||||
static struct hashmap *link_table;
|
||||
|
@ -68,6 +68,7 @@ const char * const prog_type_name[] = {
|
||||
[BPF_PROG_TYPE_EXT] = "ext",
|
||||
[BPF_PROG_TYPE_LSM] = "lsm",
|
||||
[BPF_PROG_TYPE_SK_LOOKUP] = "sk_lookup",
|
||||
[BPF_PROG_TYPE_SYSCALL] = "syscall",
|
||||
};
|
||||
|
||||
const size_t prog_type_name_size = ARRAY_SIZE(prog_type_name);
|
||||
|
Loading…
Reference in New Issue
Block a user