]> git.baikalelectronics.ru Git - kernel.git/commit
kallsyms: ignore all local labels prefixed by '.L'
authorChangbin Du <changbin.du@gmail.com>
Tue, 1 Feb 2022 01:32:57 +0000 (09:32 +0800)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 21 Feb 2022 15:44:16 +0000 (00:44 +0900)
commit786273b3757f91201b7ec2aa9e555851268621b5
tree4f21e2ed385c1ebc43953a46b329991b3b9f4455
parent9ea9a825953241fb592ce950ff303470db5e8073
kallsyms: ignore all local labels prefixed by '.L'

The llvm compiler can generate lots of local labels ('.LBB', '.Ltmpxxx',
'.L__unnamed_xx', etc.). These symbols usually are useless for debugging.
And they might overlap with handwritten symbols.

Before this change, a dumpstack shows a local symbol for epc:
[    0.040341][    T0] Hardware name: riscv-virtio,qemu (DT)
[    0.040376][    T0] epc : .LBB6_14+0x22/0x6a
[    0.040452][    T0]  ra : restore_all+0x12/0x6e

The simple solution is that we can ignore all local labels prefixed by '.L'.
For handwritten symbols which need to be preserved should drop the '.L'
prefix.

After this change, the C defined symbol is shown so we can locate the
problematical code immediately:
[    0.035795][    T0] Hardware name: riscv-virtio,qemu (DT)
[    0.036332][    T0] epc : trace_hardirqs_on+0x54/0x13c
[    0.036567][    T0]  ra : restore_all+0x12/0x6e

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kallsyms.c