From: Arnd Bergmann <arnd@arndb.de>
To: "David S . Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Alexei Starovoitov <ast@fb.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH, net-next] perf, bpf: fix conditional call to bpf_overflow_handler
Date: Tue, 6 Sep 2016 15:10:22 +0200 [thread overview]
Message-ID: <20160906131033.1784262-1-arnd@arndb.de> (raw)
The newly added bpf_overflow_handler function is only built of both
CONFIG_EVENT_TRACING and CONFIG_BPF_SYSCALL are enabled, but the caller
only checks the latter:
kernel/events/core.c: In function 'perf_event_alloc':
kernel/events/core.c:9106:27: error: 'bpf_overflow_handler' undeclared (first use in this function)
This changes the caller so we also skip this call if CONFIG_EVENT_TRACING
is disabled entirely.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: aa6a5f3cb2b2 ("perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT programs")
---
kernel/events/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
I'm not entirely sure if this is the correct solution, please check before applying
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 73d0c6ddfd5b..d3f6374326d8 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9110,7 +9110,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
if (!overflow_handler && parent_event) {
overflow_handler = parent_event->overflow_handler;
context = parent_event->overflow_handler_context;
-#ifdef CONFIG_BPF_SYSCALL
+#if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_EVENT_TRACING)
if (overflow_handler == bpf_overflow_handler) {
struct bpf_prog *prog = bpf_prog_inc(parent_event->prog);
--
2.9.0
next reply other threads:[~2016-09-06 13:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 13:10 Arnd Bergmann [this message]
2016-09-06 15:33 ` [PATCH, net-next] perf, bpf: fix conditional call to bpf_overflow_handler Alexei Starovoitov
2016-09-08 6:30 ` Ingo Molnar
2016-09-08 6:56 ` Peter Zijlstra
2016-09-08 7:01 ` Ingo Molnar
2016-09-08 8:03 ` Daniel Borkmann
2016-09-08 9:40 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160906131033.1784262-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=ast@fb.com \
--cc=ast@kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).