1
0
Fork 0
alistair23-linux/tools/bpf
Taeung Song c76e4c228b libbpf: Show supported ELF section names when failing to guess prog/attach type
We need to let users check their wrong ELF section name with proper
ELF section names when they fail to get a prog/attach type from it.
Because users can't realize libbpf guess prog/attach types from given
ELF section names. For example, when a 'cgroup' section name of a
BPF program is used, show available ELF section names(types).

Before:

    $ bpftool prog load bpf-prog.o /sys/fs/bpf/prog1
    Error: failed to guess program type based on ELF section name cgroup

After:

    libbpf: failed to guess program type based on ELF section name 'cgroup'
    libbpf: supported section(type) names are: socket kprobe/ kretprobe/ classifier action tracepoint/ raw_tracepoint/ xdp perf_event lwt_in lwt_out lwt_xmit lwt_seg6local cgroup_skb/ingress cgroup_skb/egress cgroup/skb cgroup/sock cgroup/post_bind4 cgroup/post_bind6 cgroup/dev sockops sk_skb/stream_parser sk_skb/stream_verdict sk_skb sk_msg lirc_mode2 flow_dissector cgroup/bind4 cgroup/bind6 cgroup/connect4 cgroup/connect6 cgroup/sendmsg4 cgroup/sendmsg6

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Quentin Monnet <quentin.monnet@netronome.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Andrey Ignatov <rdna@fb.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-01-23 12:27:04 +01:00
..
bpftool libbpf: Show supported ELF section names when failing to guess prog/attach type 2019-01-23 12:27:04 +01:00
.gitignore tools/bpftool: ignore build products 2018-07-26 02:50:26 +02:00
Makefile bpf: fix for lex/yacc build error with gcc-5 2018-04-25 23:27:46 +02:00
Makefile.helpers tools: bpf: build and install man page for eBPF helpers from bpftool/ 2018-07-12 18:55:53 +02:00
bpf_asm.c tools: rename tools/net directory to tools/bpf 2017-10-04 21:45:05 -07:00
bpf_dbg.c bpf: fix uninitialized variable in bpf tools 2018-04-26 22:23:02 +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 tools/bpf_jit_disasm: silence a static checker warning 2018-01-18 22:15:37 +01:00