Commit f11f10b
perf/bpf: Call BPF handler directly, not through overflow machinery
To ultimately allow BPF programs attached to perf events to completely
suppress all of the effects of a perf event overflow (rather than just the
sample output, as they do today), call bpf_overflow_handler() from
__perf_event_overflow() directly rather than modifying struct perf_event's
overflow_handler. Return the BPF program's return value from
bpf_overflow_handler() so that __perf_event_overflow() knows how to
proceed. Remove the now unnecessary orig_overflow_handler from struct
perf_event.
This patch is solely a refactoring and results in no behavior change.
Suggested-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Kyle Huey <khuey@kylehuey.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20240412015019.7060-5-khuey@kylehuey.com1 parent 14e40a9 commit f11f10b
2 files changed
Lines changed: 12 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | | - | |
813 | 812 | | |
814 | 813 | | |
815 | 814 | | |
| |||
1361 | 1360 | | |
1362 | 1361 | | |
1363 | 1362 | | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
| 1363 | + | |
1368 | 1364 | | |
1369 | 1365 | | |
1370 | 1366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9564 | 9564 | | |
9565 | 9565 | | |
9566 | 9566 | | |
9567 | | - | |
9568 | | - | |
9569 | | - | |
| 9567 | + | |
| 9568 | + | |
| 9569 | + | |
9570 | 9570 | | |
9571 | 9571 | | |
9572 | 9572 | | |
| |||
9587 | 9587 | | |
9588 | 9588 | | |
9589 | 9589 | | |
9590 | | - | |
9591 | | - | |
9592 | 9590 | | |
9593 | | - | |
| 9591 | + | |
9594 | 9592 | | |
9595 | 9593 | | |
9596 | 9594 | | |
| |||
9626 | 9624 | | |
9627 | 9625 | | |
9628 | 9626 | | |
9629 | | - | |
9630 | | - | |
9631 | 9627 | | |
9632 | 9628 | | |
9633 | 9629 | | |
| |||
9638 | 9634 | | |
9639 | 9635 | | |
9640 | 9636 | | |
9641 | | - | |
9642 | 9637 | | |
9643 | 9638 | | |
9644 | 9639 | | |
9645 | 9640 | | |
9646 | | - | |
9647 | | - | |
9648 | | - | |
| 9641 | + | |
| 9642 | + | |
| 9643 | + | |
9649 | 9644 | | |
| 9645 | + | |
9650 | 9646 | | |
9651 | 9647 | | |
9652 | 9648 | | |
| |||
9730 | 9726 | | |
9731 | 9727 | | |
9732 | 9728 | | |
9733 | | - | |
| 9729 | + | |
| 9730 | + | |
9734 | 9731 | | |
9735 | 9732 | | |
9736 | 9733 | | |
| |||
11997 | 11994 | | |
11998 | 11995 | | |
11999 | 11996 | | |
12000 | | - | |
| 11997 | + | |
12001 | 11998 | | |
12002 | 11999 | | |
12003 | 12000 | | |
12004 | 12001 | | |
12005 | | - | |
12006 | | - | |
12007 | 12002 | | |
12008 | 12003 | | |
12009 | 12004 | | |
| |||
0 commit comments