public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH dwarves] btf_encoder: Filter out __gendwarfksyms_ptr_
@ 2025-03-17 22:24 Sami Tolvanen
  2025-03-18  9:52 ` Jiri Olsa
  2025-03-24  8:16 ` Alan Maguire
  0 siblings, 2 replies; 6+ messages in thread
From: Sami Tolvanen @ 2025-03-17 22:24 UTC (permalink / raw)
  To: dwarves
  Cc: acme, yonghong.song, ast, andrii, bpf, daniel, song, eddyz87,
	olsajiri, stephen.s.brennan, laura.nao, ubizjak, alan.maguire,
	xiyou.wangcong, Sami Tolvanen

With CONFIG_GENDWARFKSYMS, __gendwarfksyms_ptr_<symbol>
variables are added to the kernel in EXPORT_SYMBOL() to ensure
DWARF type information is available for exported symbols in the
TUs where they're actually exported. These symbols are dropped
when linking vmlinux, but dangling references to them remain
in DWARF, which results in thousands of 0 address variables
that pahole needs to validate (since commit 9810758003ce
("btf_encoder: Verify 0 address DWARF variables are in ELF
section")).

Filter out symbols with the __gendwarfksyms_ptr_ name prefix in
filter_variable_name() instead of calling variable_in_sec()
for all of them. This reduces the time it takes to process
.tmp_vmlinux1 by ~77% on my test system:

Before: 35.775 +- 0.121  seconds time elapsed  ( +-  0.34% )
 After: 8.3516 +- 0.0407 seconds time elapsed  ( +-  0.49% )

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
 btf_encoder.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/btf_encoder.c b/btf_encoder.c
index 1bde310..2bf7c59 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -2239,6 +2239,7 @@ static bool filter_variable_name(const char *name)
 		X("__UNIQUE_ID"),
 		X("__tpstrtab_"),
 		X("__exitcall_"),
+		X("__gendwarfksyms_ptr_"),
 		X("__func_stack_frame_non_standard_")
 		#undef X
 	};

base-commit: a0be596ae76c720d21eef257dec1cf2462130da1
-- 
2.49.0.rc1.451.g8f38331e32-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-24  8:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 22:24 [PATCH dwarves] btf_encoder: Filter out __gendwarfksyms_ptr_ Sami Tolvanen
2025-03-18  9:52 ` Jiri Olsa
2025-03-18 16:14   ` Sami Tolvanen
2025-03-20  9:54     ` Alan Maguire
2025-03-20 11:59       ` Jiri Olsa
2025-03-24  8:16 ` Alan Maguire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox