hi, because of gcc bug [1] we can no longer rely on DW_AT_declaration attribute to filter out declarations and end up with just one copy of the function in the BTF data. It seems this bug is not easy to fix, but regardless if the it's coming soon, it's probably good idea not to depend so much only on dwarf data and make some extra checks. Thus for function encoding we are now doing following checks: - argument names are defined for the function - there's symbol and address defined for the function - function address belongs to ftrace locations (new in v2) - function is generated only once v2 changes: - add check ensuring functions belong to ftrace's mcount locations, this way we ensure to have in BTF only functions available for ftrace - patch 2 changelog describes all details - use collect* function names [Andrii] - use conventional size increase in realloc [Andrii] - drop elf_sym__is_function check - drop patch 3, it's not needed, because we follow ftrace locations With v2 patchset I'm getting 38334 BTF functions, which is reasonable subset of ftrace's available_filter_functions. thanks, jirka [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060 --- Jiri Olsa (2): btf_encoder: Move find_all_percpu_vars in generic collect_symbols btf_encoder: Change functions check due to broken dwarf btf_encoder.c | 338 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 283 insertions(+), 55 deletions(-)