Skip to contentSkip to conversation

perf, bpf: fix conditional call to bpf_overflow_handler

PATCH In review Arnd Bergmann 5 participants 7 messages Sep 6, 2016 – Sep 8, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf, bpf: fix conditional call to bpf_overflow_handler

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.

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

kernel/events/core.c +1 -1
index 73d0c6ddfd5b..d3f6374326d8 100644
@@ -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);
 
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

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.

Quoted 7 lines
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

Thanks for the fix. Just saw build bot complaining last night and by the morning your fix is already here. Thanks!

#2 lore raw
Quoted 17 lines · Alexei Starovoitov
Quoted 16 lines · Arnd Bergmann

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.

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(-)
Quoted 6 lines
Quoted 1 line

I'm not entirely sure if this is the correct solution, please check before applying

Thanks for the fix. Just saw build bot complaining last night and by the morning your fix is already here. Thanks!

Guys, this is the first time I saw this patch (and presumably there's some other patch as well?) - could you please submit it properly for review and get an Acked-by from one of the perf maintainers before appying it?

Thanks,

Ingo

maintainer
#3 lore raw
Quoted 6 lines · Ingo Molnar
Quoted 2 lines

Thanks for the fix. Just saw build bot complaining last night and by the morning your fix is already here. Thanks!

Guys, this is the first time I saw this patch (and presumably there's some other patch as well?) - could you please submit it properly for review and get an Acked-by from one of the perf maintainers before appying it?

I was involved with the original patch and Ack'ed it.

Ack on this one as well.

#4 lore raw
Quoted 9 lines · Peter Zijlstra
Quoted 6 lines · Ingo Molnar
Quoted 2 lines

Thanks for the fix. Just saw build bot complaining last night and by the morning your fix is already here. Thanks!

Guys, this is the first time I saw this patch (and presumably there's some other patch as well?) - could you please submit it properly for review and get an Acked-by from one of the perf maintainers before appying it?

I was involved with the original patch and Ack'ed it.

Neither the Ack nor the Cc:s were preserved in the net-next commit:

aa6a5f3cb2b2 ("perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT programs")

Quoted 1 line

Ack on this one as well.

Great, thanks!

Ingo

#5 lore raw
Quoted 9 lines · Ingo Molnar
Quoted 8 lines · Peter Zijlstra
Quoted 6 lines · Ingo Molnar
Quoted 2 lines

Thanks for the fix. Just saw build bot complaining last night and by the morning your fix is already here. Thanks!

Guys, this is the first time I saw this patch (and presumably there's some other patch as well?) - could you please submit it properly for review and get an Acked-by from one of the perf maintainers before appying it?

Quoted 5 lines
Quoted 1 line

I was involved with the original patch and Ack'ed it.

Neither the Ack nor the Cc:s were preserved in the net-next commit:

aa6a5f3cb2b2 ("perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT programs")

Afaik patchwork doesn't pick up Acks when they are against the cover letter of a series. For the series that includes mentioned commit, Peter's Ack is here:

    4df20483ab28 ("Merge branch 'bpf-perf-hw-sw-events'")
Quoted 6 lines
Quoted 1 line

Ack on this one as well.

Great, thanks!

Ingo

#6 lore raw
Quoted 10 lines · Daniel Borkmann
Quoted 9 lines · Ingo Molnar
Quoted 8 lines · Peter Zijlstra
Quoted 6 lines · Ingo Molnar
Quoted 2 lines

Thanks for the fix. Just saw build bot complaining last night and by the morning your fix is already here. Thanks!

Guys, this is the first time I saw this patch (and presumably there's some other patch as well?) - could you please submit it properly for review and get an Acked-by from one of the perf maintainers before appying it?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

I was involved with the original patch and Ack'ed it.

Neither the Ack nor the Cc:s were preserved in the net-next commit:

aa6a5f3cb2b2 ("perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT programs")

Afaik patchwork doesn't pick up Acks when they are against the cover letter of a series. [...]

That's unfortunate - I usually add them in manually.

Quoted 3 lines

[...] For the series that includes mentioned commit, Peter's Ack is here:

    4df20483ab28 ("Merge branch 'bpf-perf-hw-sw-events'")

Looks good!

Thanks,

Ingo