Tomislav Novak
aaa554a75a
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:28:25 +01:00
..
2022-12-14 11:28:25 +01:00
2020-01-27 14:50:28 +01:00
2020-07-22 09:32:04 +02:00
2019-11-20 18:47:11 +01:00
2018-08-23 13:44:43 -07:00
2022-12-14 11:28:25 +01:00
2022-05-25 09:10:40 +02:00
2019-08-29 08:28:48 +02:00
2022-08-25 11:15:00 +02:00
2022-07-12 16:29:02 +02:00
2022-07-02 16:27:37 +02:00
2022-08-25 11:15:00 +02:00
2022-07-02 16:27:38 +02:00
2022-04-20 09:12:50 +02:00
2022-07-02 16:27:37 +02:00
2021-04-28 13:16:51 +02:00
2022-06-14 16:59:18 +02:00
2021-10-13 10:10:51 +02:00
2020-06-25 15:32:48 +02:00
2019-05-08 07:21:51 +02:00
2019-02-15 08:10:12 +01:00
2021-04-28 13:16:49 +02:00
2019-12-05 09:20:02 +01:00
2022-07-12 16:29:02 +02:00
2022-04-15 14:14:56 +02:00
2022-12-08 11:18:29 +01:00
2020-02-19 19:51:56 +01:00
2022-06-14 16:59:18 +02:00
2022-08-25 11:15:01 +02:00
2019-02-12 19:47:09 +01:00
2018-08-24 08:50:23 -07:00
2020-01-27 14:50:47 +01:00
2022-04-15 14:15:00 +02:00
2020-12-30 11:25:49 +01:00
2021-12-01 09:27:42 +01:00
2020-01-27 14:51:01 +01:00
2020-12-30 11:26:06 +01:00
2019-02-15 08:10:12 +01:00
2020-06-22 09:05:28 +02:00
2018-07-31 19:04:41 -07:00
2022-06-14 16:59:18 +02:00
2022-08-25 11:15:01 +02:00
2022-07-21 21:09:27 +02:00
2021-10-13 10:10:51 +02:00
2019-05-08 07:21:51 +02:00
2019-05-08 07:21:51 +02:00
2020-01-27 14:50:38 +01:00
2020-11-05 11:08:55 +01:00
2022-07-21 21:09:26 +02:00
2018-09-19 10:44:11 +01:00
2020-10-17 10:12:56 +02:00
2019-02-20 10:25:37 +01:00
2022-07-07 17:35:12 +02:00
2022-10-26 13:19:29 +02:00
2022-10-26 13:19:16 +02:00
2021-11-26 11:36:17 +01:00