kallsyms: ignore all local labels prefixed by '.L'
PATCH 1/1 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
--- scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kallsyms.c +1 -1
@@ -108,7 +108,7 @@ static bool is_ignored_symbol(const char *name, char type)/* Symbol names that begin with the following are ignored.*/ static const char *const ignored_prefixes[] = {"$" ,/* local symbols for ARM, MIPS, etc. */ -".LASANPC" ,/* s390 kasan local symbols */ +".L" ,/* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ "__crc_" ,/* modversions */ "__efistub_" ,/* arm64 EFI stub namespace */ "__kvm_nvhe_" ,/* arm64 non-VHE KVM namespace */
Signature · 1 line
2.32.0
Quoted 13 lines · Changbin Du
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/0x6eThe 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.
Quoted 7 lines
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/0x6eSigned-off-by Changbin Du <[email protected]>
Does not seem too unreasonable to me.
Quoted 21 lines
--- scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/kallsyms.c +1
-1@@ -108,7 +108,7 @@ static bool is_ignored_symbol(const char *name, char type)/* Symbol names that begin with the following are ignored.*/ static const char *const ignored_prefixes[] = {"$" ,/* local symbols for ARM, MIPS, etc. */ -".LASANPC" ,/* s390 kasan local symbols */ +".L" ,/* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ "__crc_" ,/* modversions */ "__efistub_" ,/* arm64 EFI stub namespace */ "__kvm_nvhe_" ,/* arm64 non-VHE KVM namespace */ Signature · 1 line
2.32.0
On Mon, Jan 31, 2022 at 5:33 PM Changbin Du <[email protected]> wrote:
Make sure to mark the version of your patches (this is v2, IIUC). git format-patch -v2 HEAD~
Quoted 41 lines
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/0x6eThe 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/0x6eSigned-off-by Changbin Du <[email protected]>--- scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/kallsyms.c +1
-2@@ -108,7 +108,7 @@ static bool is_ignored_symbol(const char *name, char type)/* Symbol names that begin with the following are ignored.*/ static const char *const ignored_prefixes[] = {"$" ,/* local symbols for ARM, MIPS, etc. */ -".LASANPC" ,/* s390 kasan local symbols */ +".L" ,/* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ "__crc_" ,/* modversions */ "__efistub_" ,/* arm64 EFI stub namespace */ "__kvm_nvhe_" ,/* arm64 non-VHE KVM namespace */ --2.32.0
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 5 lines · Nick Desaulniers
On Mon, Jan 31, 2022 at 5:33 PM Changbin Du <[email protected]> wrote:
Make sure to mark the version of your patches (this is v2, IIUC).
git format-patch -v2 HEAD~
Sure, I fogot to add version NO. this time. Thanks for your reminding.
Quoted 48 lines
Reviewed-by Nick Desaulniers <[email protected]>Quoted 41 lines
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/0x6eThe 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/0x6eSigned-off-by Changbin Du <[email protected]>--- scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/kallsyms.c +1
-2@@ -108,7 +108,7 @@ static bool is_ignored_symbol(const char *name, char type)/* Symbol names that begin with the following are ignored.*/ static const char *const ignored_prefixes[] = {"$" ,/* local symbols for ARM, MIPS, etc. */ -".LASANPC" ,/* s390 kasan local symbols */ +".L" ,/* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ "__crc_" ,/* modversions */ "__efistub_" ,/* arm64 EFI stub namespace */ "__kvm_nvhe_" ,/* arm64 non-VHE KVM namespace */ --2.32.0
Signature · 2 lines
Thanks, ~Nick Desaulniers
Signature · 2 lines
Cheers, Changbin Du
Hi, Masahiro,
Could you consider picking up this change if you have no objection?
Quoted 40 lines · Changbin Du
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/0x6eThe 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/0x6eSigned-off-by Changbin Du <[email protected]>--- scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/kallsyms.c +1
-1@@ -108,7 +108,7 @@ static bool is_ignored_symbol(const char *name, char type)/* Symbol names that begin with the following are ignored.*/ static const char *const ignored_prefixes[] = {"$" ,/* local symbols for ARM, MIPS, etc. */ -".LASANPC" ,/* s390 kasan local symbols */ +".L" ,/* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ "__crc_" ,/* modversions */ "__efistub_" ,/* arm64 EFI stub namespace */ "__kvm_nvhe_" ,/* arm64 non-VHE KVM namespace */ Signature · 1 line
2.32.0
Signature · 2 lines
Cheers, Changbin Du
Quoted 25 lines · Changbin Du
Hi, Masahiro,
Could you consider picking up this change if you have no objection?Quoted 20 lines · Changbin Du
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/0x6eThe 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/0x6eSigned-off-by Changbin Du <[email protected]>
Now applied to linux-kbuild. Thanks.
Quoted 24 lines
Quoted 18 lines
--- scripts/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/kallsyms.c +1
-2@@ -108,7 +108,7 @@ static bool is_ignored_symbol(const char *name, char type)/* Symbol names that begin with the following are ignored.*/ static const char *const ignored_prefixes[] = {"$" ,/* local symbols for ARM, MIPS, etc. */ -".LASANPC" ,/* s390 kasan local symbols */ +".L" ,/* local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc. */ "__crc_" ,/* modversions */ "__efistub_" ,/* arm64 EFI stub namespace */ "__kvm_nvhe_" ,/* arm64 non-VHE KVM namespace */ --Quoted 2 lines
2.32.0
--
Cheers,
Changbin Du
Signature · 2 lines
Best Regards Masahiro Yamada