Thread (16 messages) flat view 16 messages, 4 authors, 17d ago

Re: [PATCH v3 3/3] module/kallsyms: Filter out local and mapping symbols during module load

From: Tiezhu Yang <yangtiezhu@loongson.cn>
Date: 2026-08-18 13:06:03
Also in: lkml, loongarch

On 2026/8/18 下午7:59, Petr Pavlu wrote:
On 8/12/26 5:28 AM, Tiezhu Yang wrote:
quoted
The compiler toolchains generate local and mapping symbols on certain
architectures like LoongArch for optimizations and relocations.
Nit: "local" -> "local label".
OK, will update the patch subject and commit message in v4.
quoted
While the symbols are already filtered out during runtime lookups via
find_kallsyms_symbol(), they still leak into /proc/kallsyms for loaded
modules because layout_symtab() and add_kallsyms() do not filter them
during load time.

Consequently, tracing tools like bpftrace (which do not perform internal
filtering, unlike perf) resolve identical addresses into confusing local
labels instead of actual clear C function names.

Fix this by integrating the is_local_mapping_symbol() check directly into
the newly introduced is_kept_symbol() helper. This ensures these unneeded
symbols are stripped during module load time, keeping /proc/kallsyms clean
and resulting in accurate call stacks.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Thanks,
Tiezhu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help