linux-stable/arch/loongarch
Huacai Chen 886f9ee3c5 LoongArch: Fix callchain parse error with kernel tracepoint events again
[ Upstream commit d6af2c7639 ]

With commit d3119bc985 ("LoongArch: Fix callchain parse error with
kernel tracepoint events"), perf can parse kernel callchain, but not
complete and sometimes maybe error. The reason is LoongArch's unwinders
(guess, prologue and orc) don't really need fp (i.e., regs[22]), and
they use sp (i.e., regs[3]) as the frame address rather than the current
stack pointer.

Fix that by removing the assignment of regs[22], and instead assign the
__builtin_frame_address(0) to regs[3].

Without fix:

  Children      Self  Command        Shared Object      Symbol
  ........  ........  .............  .................  ................
  33.91%    33.91%    swapper        [kernel.vmlinux]   [k] __schedule
            |
            |--33.04%--__schedule
            |
             --0.87%--__arch_cpu_idle
                       __schedule

With this fix:

  Children      Self  Command        Shared Object      Symbol
  ........  ........  .............  .................  ................
  31.16%    31.16%    swapper        [kernel.vmlinux]   [k] __schedule
            |
            |--20.63%--smpboot_entry
            |          cpu_startup_entry
            |          schedule_idle
            |          __schedule
            |
             --10.53%--start_kernel
                       cpu_startup_entry
                       schedule_idle
                       __schedule

Fixes: d3119bc985 ("LoongArch: Fix callchain parse error with kernel tracepoint events")
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:03:43 +02:00
..
boot loongarch: efi: enable generic EFI compressed boot 2022-09-20 09:50:31 +02:00
configs LoongArch: Update Loongson-3 default config file 2022-10-12 16:36:23 +08:00
include LoongArch: Fix callchain parse error with kernel tracepoint events again 2024-06-12 11:03:43 +02:00
kernel LoongArch: Lately init pmu after smp is online 2024-06-12 11:02:59 +02:00
lib LoongArch: Improve dump_tlb() output messages 2022-09-03 18:01:27 +08:00
mm LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:29:28 +02:00
net LoongArch: BPF: Prevent out-of-bounds memory access 2024-01-25 15:27:50 -08:00
pci LoongArch: Use TLB for ioremap() 2022-10-12 16:36:14 +08:00
vdso LoongArch: Fix build warnings in VDSO 2022-08-25 19:34:59 +08:00
Kbuild LoongArch: Add BPF JIT support 2022-10-12 16:36:20 +08:00
Kconfig LoongArch: Select HAVE_ARCH_SECCOMP to use the common SECCOMP menu 2024-03-01 13:26:30 +01:00
Kconfig.debug LoongArch: Add prologue unwinder support 2022-08-12 13:10:11 +08:00
Makefile LoongArch: Add dependency between vmlinuz.efi and vmlinux.efi 2023-12-20 17:00:23 +01:00