[PATCHv2 bpf-next 0/6] x86/fgraph,bpf: Fix ORC stack unwind from kprobe_multi

Jiri Olsa
2026-01-26T21:18:48Z

hi,
Mahe reported missing function from stack trace on top of kprobe multi
program. It turned out the latest fix [1] needs some more fixing.

v2 changes:
- keep the unwind same as for kprobes, attached function
is part of entry probe stacktrace, not kretprobe [Steven]
- several change in trigger bench [Andrii]
- added selftests for standard kprobes and fentry/fexit probes [Andrii]

Note I'll try to add similar stacktrace adjustment for fentry/fexit
in separate patchset to not complicate this change.

thanks,
jirka

[1] https://lore.kernel.org/bpf/20251104215405.168643-1-jolsa@kernel.org/
---
Jiri Olsa (6):
x86/fgraph: Fix return_to_handler regs.rsp value
x86/fgraph,bpf: Switch kprobe_multi program stack unwind to hw_regs path
selftests/bpf: Fix kprobe multi stacktrace_ips test
selftests/bpf: Add stacktrace ips test for kprobe/kretprobe
selftests/bpf: Add stacktrace ips test for fentry/fexit
selftests/bpf: Allow to benchmark trigger with stacktrace

arch/x86/include/asm/ftrace.h | 2 +-
arch/x86/kernel/ftrace_64.S | 5 +++-
tools/testing/selftests/bpf/bench.c | 4 ++++
tools/testing/selftests/bpf/bench.h | 1 +
tools/testing/selftests/bpf/benchs/bench_trigger.c | 1 +
tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
tools/testing/selftests/bpf/progs/stacktrace_ips.c | 27 ++++++++++++++++++++++
tools/testing/selftests/bpf/progs/trigger_bench.c | 46 +++++++++++++++++++++++++++++--------
8 files changed, 190 insertions(+), 16 deletions(-)