]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/tracing: fix kernel/events/core.c compilation error
authorYonghong Song <yhs@fb.com>
Wed, 13 Dec 2017 18:35:37 +0000 (10:35 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 13 Dec 2017 21:44:10 +0000 (22:44 +0100)
commit2a2815b3c7a9e066f3f71e67c84aa9ce851f1a47
treefd3dc43e1d9c9c9b14784fd0c3639e2cac7cea04
parent3adf5c99681f639c173ed8e6f82df21db4e5d1dd
bpf/tracing: fix kernel/events/core.c compilation error

Commit 638ab5ac5515 ("bpf/tracing: allow user space to
query prog array on the same tp") introduced a perf
ioctl command to query prog array attached to the
same perf tracepoint. The commit introduced a
compilation error under certain config conditions, e.g.,
  (1). CONFIG_BPF_SYSCALL is not defined, or
  (2). CONFIG_TRACING is defined but neither CONFIG_UPROBE_EVENTS
       nor CONFIG_KPROBE_EVENTS is defined.

Error message:
  kernel/events/core.o: In function `perf_ioctl':
  core.c:(.text+0x98c4): undefined reference to `bpf_event_query_prog_array'

This patch fixed this error by guarding the real definition under
CONFIG_BPF_EVENTS and provided static inline dummy function
if CONFIG_BPF_EVENTS was not defined.
It renamed the function from bpf_event_query_prog_array to
perf_event_query_prog_array and moved the definition from linux/bpf.h
to linux/trace_events.h so the definition is in proximity to
other prog_array related functions.

Fixes: 638ab5ac5515 ("bpf/tracing: allow user space to query prog array on the same tp")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf.h
include/linux/trace_events.h
kernel/events/core.c
kernel/trace/bpf_trace.c