Commit a31d82d8 authored by Steven Rostedt's avatar Steven Rostedt Committed by David S. Miller

bpf_trace: Make dependent on PERF_EVENTS

Arnd Bergmann reported:

  In my ARM randconfig tests, I'm getting a build error for
  newly added code in bpf_perf_event_read and bpf_perf_event_output
  whenever CONFIG_PERF_EVENTS is disabled:

  kernel/trace/bpf_trace.c: In function 'bpf_perf_event_read':
  kernel/trace/bpf_trace.c:203:11: error: 'struct perf_event' has no member named 'oncpu'
  if (event->oncpu != smp_processor_id() ||
           ^
  kernel/trace/bpf_trace.c:204:11: error: 'struct perf_event' has no member named 'pmu'
        event->pmu->count)

  This can happen when UPROBE_EVENT is enabled but KPROBE_EVENT
  is disabled. I'm not sure if that is a configuration we care
  about, otherwise we could prevent this case from occuring by
  adding Kconfig dependencies.

Looking at this further, it's really that UPROBE_EVENT enables PERF_EVENTS.
By just having BPF_EVENTS depend on PERF_EVENTS, then all is fine.

Link: http://lkml.kernel.org/r/4525348.Aq9YoXkChv@wuerfelReported-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4bdb96cb
...@@ -434,7 +434,7 @@ config UPROBE_EVENT ...@@ -434,7 +434,7 @@ config UPROBE_EVENT
config BPF_EVENTS config BPF_EVENTS
depends on BPF_SYSCALL depends on BPF_SYSCALL
depends on KPROBE_EVENT || UPROBE_EVENT depends on (KPROBE_EVENT || UPROBE_EVENT) && PERF_EVENTS
bool bool
default y default y
help help
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment