summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-10-20 18:13:16 +0000
committerAlexei Starovoitov <ast@kernel.org>2026-10-20 20:54:25 +0000
commitcff94a3d78d8cc12ceaf60aa9272aac422b1dc39 (patch)
tree93af930d3cc6b994ee21a9ef66f95634fa5bb04b /tools/perf/scripts/python/stackcollapse.py
parenta2d274771321de60d100b32d528556fd9eed07b1 (diff)
bpf, x86: Support unwind_goto and unwind_exit
bpf x86 call inner call inner unwind_goto pad w0 = w6 mov eax, ebx r0 = 0 xor eax, eax unwind_exit push rax push rsi mov rdi, [rbp + 8] call bpf_unwind_target mov [rbp + 8], rax pop rsi pop rax leave ret unwind_goto is an extable entry and no code. unwind_exit looks its return address up there and returns to the pad. r0 and r2 are what a subprog returns, so rax and rsi are saved around the lookup. When there is no entry, the kernel called the subprog as an async or an exception callback, and unwind_exit is exit. The caller of the main prog doesn't tell exit from unwind_exit, so there it's exit. An extension is different. freplace is a jump, so its return address is the one of the subprog that it replaced. With private stack r9 is saved around a call, and 'pop r9' has to be done on the way to the pad too. In such progs unwind_goto is: push r9 call foo pop r9 <- exit returns here jmp 1f pop r9 <- unwind_exit returns here jmp pad 1: Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20261020181320.1284798-3-alexei.starovoitov@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions