libbpf: Print hint when PERF_EVENT_IOC_SET_BPF returns -EPROTO
authorSong Liu <songliubraving@fb.com>
Thu, 23 Jul 2020 18:06:46 +0000 (11:06 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Jul 2020 03:16:35 +0000 (20:16 -0700)
commitd4b4dd6ce7709c2d2fe56dcfc15074ee18505bcb
tree4f13bbdfc94518efcf3f275b3fb6650f5bf52cdc
parent5d99cb2c86775b4780c02a339a9578bf9471ead9
libbpf: Print hint when PERF_EVENT_IOC_SET_BPF returns -EPROTO

The kernel prevents potential unwinder warnings and crashes by blocking
BPF program with bpf_get_[stack|stackid] on perf_event without
PERF_SAMPLE_CALLCHAIN, or with exclude_callchain_[kernel|user]. Print a
hint message in libbpf to help the user debug such issues.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200723180648.1429892-4-songliubraving@fb.com
tools/lib/bpf/libbpf.c