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@xxxxxxxxxx> --- 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