Huacai Chen
d3119bc985
LoongArch: Fix callchain parse error with kernel tracepoint events
In order to fix perf's callchain parse error for LoongArch, we implement
perf_arch_fetch_caller_regs() which fills several necessary registers
used for callchain unwinding, including sp, fp, and era. This is similar
to the following commits.
commit b3eac0265b:
("arm: perf: Fix callchain parse error with kernel tracepoint events")
commit 5b09a094f2:
("arm64: perf: Fix callchain parse error with kernel tracepoint events")
commit 9a7e8ec0d4:
("riscv: perf: Fix callchain parse error with kernel tracepoint events")
Test with commands:
perf record -e sched:sched_switch -g --call-graph dwarf
perf report
Without this patch:
Children Self Command Shared Object Symbol
........ ........ ............. ................. ....................
43.41% 43.41% swapper [unknown] [k] 0000000000000000
10.94% 10.94% loong-container [unknown] [k] 0000000000000000
|
|--5.98%--0x12006ba38
|
|--2.56%--0x12006bb84
|
--2.40%--0x12006b6b8
With this patch, callchain can be parsed correctly:
Children Self Command Shared Object Symbol
........ ........ ............. ................. ....................
47.57% 47.57% swapper [kernel.vmlinux] [k] __schedule
|
---__schedule
26.76% 26.76% loong-container [kernel.vmlinux] [k] __schedule
|
|--13.78%--0x12006ba38
| |
| |--9.19%--__schedule
| |
| --4.59%--handle_syscall
| do_syscall
| sys_futex
| do_futex
| futex_wait
| futex_wait_queue_me
| hrtimer_start_range_ns
| __schedule
|
|--8.38%--0x12006bb84
| handle_syscall
| do_syscall
| sys_epoll_pwait
| do_epoll_wait
| schedule_hrtimeout_range_clock
| hrtimer_start_range_ns
| __schedule
|
--4.59%--0x12006b6b8
handle_syscall
do_syscall
sys_nanosleep
hrtimer_nanosleep
do_nanosleep
hrtimer_start_range_ns
__schedule
Cc: stable@vger.kernel.org
Fixes: b37042b2bb ("LoongArch: Add perf events support")
Reported-by: Youling Tang <tangyouling@kylinos.cn>
Suggested-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2024-04-24 12:36:07 +08:00
..
2023-06-29 20:58:43 +08:00
2022-06-03 20:09:28 +08:00
2024-02-06 12:32:05 +08:00
2024-04-10 21:08:51 +08:00
2022-12-14 08:36:11 +08:00
2022-12-14 08:36:11 +08:00
2022-12-14 08:36:11 +08:00
2022-06-03 20:09:28 +08:00
2023-09-06 22:53:55 +08:00
2023-02-25 22:12:17 +08:00
2023-11-21 15:03:25 +08:00
2023-11-08 14:12:15 +08:00
2023-06-29 20:58:44 +08:00
2022-06-03 20:09:28 +08:00
2022-06-03 20:09:28 +08:00
2024-01-17 12:43:08 +08:00
2022-06-25 18:06:07 +08:00
2024-03-11 22:23:47 +08:00
2022-06-03 20:09:28 +08:00
2024-03-19 15:50:34 +08:00
2022-10-12 16:36:14 +08:00
2023-05-01 17:19:43 +08:00
2022-06-03 20:09:28 +08:00
2023-04-29 09:08:44 +02:00
2023-06-29 20:58:44 +08:00
2023-06-29 20:58:43 +08:00
2023-06-29 20:58:44 +08:00
2022-06-03 20:09:28 +08:00
2024-04-24 12:36:07 +08:00
2022-06-03 20:09:28 +08:00
2022-06-03 20:09:29 +08:00
2022-08-12 13:10:11 +08:00
2022-06-03 20:09:28 +08:00
2023-12-19 11:16:37 +01:00
2024-01-17 12:43:08 +08:00
2022-06-03 20:09:28 +08:00
2024-03-11 22:23:47 +08:00
2022-06-03 20:09:28 +08:00
2022-12-14 08:36:11 +08:00
2023-05-18 11:07:54 +02:00
2022-10-12 16:36:14 +08:00
2023-06-29 20:58:43 +08:00
2023-08-26 22:21:57 +08:00
2024-01-17 12:43:08 +08:00
2022-12-14 08:36:11 +08:00
2023-06-29 20:58:43 +08:00
2022-06-08 11:00:40 +08:00
2022-06-03 20:09:28 +08:00
2023-02-25 22:12:17 +08:00
2022-06-03 20:09:28 +08:00
2022-06-03 20:09:28 +08:00
2023-11-12 10:58:08 -08:00
2024-04-10 21:08:51 +08:00
2022-06-03 20:09:28 +08:00
2023-08-18 10:19:00 -07:00
2022-07-29 18:22:32 +08:00
2024-02-09 15:57:48 -08:00
2023-09-20 14:26:29 +08:00
2024-03-19 15:50:34 +08:00
2023-06-29 20:58:44 +08:00
2022-10-12 16:36:19 +08:00
2024-04-10 21:08:51 +08:00
2023-09-06 22:53:55 +08:00
2023-06-29 20:58:44 +08:00
2023-10-02 10:01:27 +08:00
2024-01-02 13:16:29 -05:00
2023-10-02 10:01:28 +08:00
2023-10-02 10:01:20 +08:00
2024-01-26 16:22:07 +08:00
2023-09-06 22:53:55 +08:00
2023-10-18 08:42:52 +08:00
2023-10-04 11:38:11 +02:00
2023-12-09 15:49:15 +08:00
2022-12-14 08:41:53 +08:00
2022-06-03 20:09:28 +08:00
2022-06-03 20:09:28 +08:00
2023-09-06 22:53:10 +08:00
2024-03-11 22:23:47 +08:00
2023-04-18 19:38:58 +08:00
2022-06-03 20:09:29 +08:00
2024-03-11 22:23:47 +08:00
2024-03-11 22:23:47 +08:00
2024-03-11 22:23:47 +08:00
2024-04-10 21:08:51 +08:00
2022-08-12 13:10:11 +08:00
2024-03-19 15:50:34 +08:00
2024-04-24 12:36:07 +08:00
2023-10-06 14:44:10 -07:00
2023-10-18 08:42:52 +08:00
2024-03-19 15:50:34 +08:00
2022-06-03 20:09:28 +08:00
2023-09-06 22:53:55 +08:00
2023-08-25 23:40:26 +08:00
2022-06-03 20:09:28 +08:00
2022-06-03 20:09:28 +08:00
2023-11-21 15:03:25 +08:00
2023-09-20 14:26:28 +08:00
2022-12-11 18:12:12 -08:00
2022-10-12 16:36:14 +08:00
2022-10-12 16:36:14 +08:00
2024-03-11 22:23:47 +08:00
2022-12-14 08:41:53 +08:00
2022-08-12 13:10:11 +08:00
2023-09-06 22:54:16 +08:00
2023-06-29 20:58:44 +08:00
2023-09-06 22:53:55 +08:00
2022-06-03 20:09:28 +08:00
2024-03-11 22:23:47 +08:00
2022-12-14 08:41:53 +08:00
2022-06-08 11:00:40 +08:00
2024-04-24 12:36:07 +08:00
2022-06-03 20:09:29 +08:00
2022-06-03 20:09:29 +08:00
2022-06-03 20:09:28 +08:00
2023-02-25 22:12:16 +08:00
2022-06-03 20:09:28 +08:00
2024-03-11 22:23:47 +08:00
2024-03-11 22:23:47 +08:00
2023-06-29 20:58:44 +08:00
2022-08-12 13:10:11 +08:00
2022-06-03 20:09:28 +08:00
2022-06-03 20:09:28 +08:00
2023-09-06 22:53:55 +08:00
2023-09-06 22:53:55 +08:00