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-12-14 11:24:32 +01:00
2020-01-29 10:24:18 +01:00
2019-10-17 13:42:26 -07:00
2019-05-21 18:49:00 +02:00
2018-12-05 19:42:41 +01:00
2022-12-14 11:24:32 +01:00
2022-05-25 08:39:50 +02:00
2022-04-12 07:52:17 +02:00
2022-08-25 11:09:21 +02:00
2020-08-21 11:01:57 +02:00
2022-07-02 16:17:15 +02:00
2018-03-22 09:17:39 +01:00
2022-07-02 16:17:16 +02:00
2022-04-20 09:06:46 +02:00
2022-07-02 16:17:15 +02:00
2021-02-10 09:09:26 +01:00
2022-06-14 16:52:30 +02:00
2021-10-17 10:05:39 +02:00
2020-06-30 15:38:20 -04:00
2019-05-08 07:19:11 +02:00
2019-02-15 08:07:38 +01:00
2021-04-28 12:07:15 +02:00
2019-12-05 15:34:18 +01:00
2022-04-20 09:06:40 +02:00
2018-10-03 17:01:47 -07:00
2022-12-08 11:15:39 +01:00
2022-06-14 16:52:30 +02:00
2022-05-12 12:14:55 +02:00
2018-05-30 07:50:32 +02:00
2019-02-12 19:44:55 +01:00
2018-09-15 09:43:00 +02:00
2020-01-29 10:24:24 +01:00
2022-04-20 09:06:41 +02:00
2021-12-08 08:45:03 +01:00
2017-10-08 10:26:11 +02:00
2019-02-15 08:07:38 +01:00
2020-06-20 10:24:21 +02:00
2017-01-26 08:24:43 +01:00
2022-06-14 16:52:30 +02:00
2019-10-05 12:30:33 +02:00
2022-07-21 20:40:30 +02:00
2019-08-25 10:51:40 +02:00
2019-05-08 07:19:11 +02:00
2018-05-30 07:50:29 +02:00
2019-05-08 07:19:11 +02:00
2020-01-29 10:24:21 +01:00
2020-11-10 10:24:00 +01:00
2021-11-02 17:39:22 +01:00
2019-05-31 06:48:14 -07:00
2019-02-20 10:18:26 +01:00
2022-07-07 17:30:11 +02:00
2022-10-26 13:15:41 +02:00
2017-10-08 10:26:04 +02:00
2022-10-26 13:15:33 +02:00
2021-11-26 11:48:39 +01:00