Tomislav Novak
25260b24cc
ARM: 9251/1: perf: Fix stacktraces for tracepoint events in THUMB2 kernels
...
[ Upstream commit 612695bccfdbd52004551308a55bae410e7cd22f ]
Store the frame address where arm_get_current_stackframe() looks for it
(ARM_r7 instead of ARM_fp if CONFIG_THUMB2_KERNEL=y). Otherwise frame->fp
gets set to 0, causing unwind_frame() to fail.
# bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
Attaching 1 probe...
@[
__schedule+1059
]: 1
A typical first unwind instruction is 0x97 (SP = R7), so after executing
it SP ends up being 0 and -URC_FAILURE is returned.
unwind_frame(pc = ac9da7d7 lr = 00000000 sp = c69bdda0 fp = 00000000)
unwind_find_idx(ac9da7d7)
unwind_exec_insn: insn = 00000097
unwind_exec_insn: fp = 00000000 sp = 00000000 lr = 00000000 pc = 00000000
With this patch:
# bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
Attaching 1 probe...
@[
__schedule+1059
__schedule+1059
schedule+79
schedule_hrtimeout_range_clock+163
schedule_hrtimeout_range+17
ep_poll+471
SyS_epoll_wait+111
sys_epoll_pwait+231
__ret_fast_syscall+1
]: 1
Link: https://lore.kernel.org/r/20220920230728.2617421-1-tnovak@fb.com/
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tomislav Novak <tnovak@fb.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-14 11:24:32 +01:00
..
2022-07-29 17:05:47 +02:00
2022-11-03 23:49:17 +09:00
2022-12-14 11:24:32 +01:00
2022-12-08 11:15:41 +01:00
2021-02-23 13:59:16 +01:00
2021-11-26 11:48:42 +01:00
2022-08-25 11:09:24 +02:00
2022-06-25 11:45:13 +02:00
2020-02-28 15:42:42 +01:00
2022-12-08 11:15:39 +01:00
2022-12-08 11:15:40 +01:00
2022-06-14 16:52:29 +02:00
2022-09-15 12:39:45 +02:00
2022-10-26 13:15:44 +02:00
2022-12-08 11:15:40 +01:00
2022-10-26 13:15:38 +02:00
2022-06-25 11:45:13 +02:00
2020-01-12 11:24:19 +01:00
2022-10-26 13:15:37 +02:00
2022-12-08 11:15:42 +01:00
2022-07-02 16:17:15 +02:00
2018-08-15 18:14:46 +02:00