Skip to content

x86/fgraph,bpf: Fix ORC stack unwind from return probe

Jiri Olsa bpf linux-trace-kernel 3 versions – Applied

Status from this message: This series was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 4 repliesApplied 4/4
  2. v24 patches 5 repliesSuperseded
  3. v13 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- fix assert condition in test

Patches in v3 All 4 applied

#Subject and filesSizeRepliesApplied
1/4Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()"arch/x86/events/core.c+5 -50 repliesApplied
2/4x86/fgraph,bpf: Fix stack ORC unwind from kprobe_multi return probearch/x86/include/asm/ftrace.h arch/x86/kernel/ftrace_64.S include/linux/ftrace.h+21 -20 repliesApplied
3/4selftests/bpf: Add stacktrace ips test for kprobe_multi/kretprobe_multitools/testing/selftests/bpf/prog_tests/stacktrace_ips.c tools/testing/selftests/bpf/progs/stacktrace_ips.c tools/testing/selftests/bpf/test_kmods/bpf_testmod.c+171 -00 repliesApplied
4/4selftests/bpf: Add stacktrace ips test for raw_tptools/testing/selftests/bpf/prog_tests/stacktrace_ips.c tools/testing/selftests/bpf/progs/stacktrace_ips.c+54 -00 repliesApplied

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSong LiuMasami Hiramatsu (Google)Steven Rostedt (Google)
SeriesA-b
1/4A-b
2/4A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCHv3 0/4] x86/fgraph,bpf: Fix ORC stack unwind from return probe

hi,
sending fix for ORC stack unwind issue reported in here [1], where the ORC unwinder won't go pass the return_to_handler function and we get no stacktrace.

Sending fix for that together with unrelated stacktrace fix (patch 1), so the attached test can work properly.

It's based on:
https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes/for-next

v1: https://lore.kernel.org/bpf/[email protected]/
v2: https://lore.kernel.org/bpf/[email protected]/

v3 changes:
- fix assert condition in test

thanks,
jirka

[1] https://lore.kernel.org/bpf/aObSyt3qOnS_BMcy@krava/
---
Jiri Olsa (4):
Revert "perf/x86: Always store regs->ip in perf_callchain_kernel()" x86/fgraph,bpf: Fix stack ORC unwind from kprobe_multi return probe selftests/bpf: Add stacktrace ips test for kprobe_multi/kretprobe_multi selftests/bpf: Add stacktrace ips test for raw_tp

 arch/x86/events/core.c                                  |  10 +++----
 arch/x86/include/asm/ftrace.h                           |   5 ++++
 arch/x86/kernel/ftrace_64.S                             |   8 +++++-
 include/linux/ftrace.h                                  |  10 ++++++-
 tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/stacktrace_ips.c      |  49 +++++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/test_kmods/bpf_testmod.c    |  26 +++++++++++++++++
 7 files changed, 251 insertions(+), 7 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/stacktrace_ips.c
 create mode 100644 tools/testing/selftests/bpf/progs/stacktrace_ips.c