btf_encoder: Simplify function encoding
Currently we have two modes of function encoding; one adds functions
based upon the first instance found and ignores inconsistent
representations. The second saves function representations and later
finds inconsistencies. The mode chosen is determined by
conf_load->skip_encoding_btf_inconsistent_proto.
The knock-on effect is that we need to support two modes in
btf_encoder__add_func(); one for each case. Simplify by using the "save
function" approach for both cases; only difference is that we allow
inconsistent representations if skip_encoding_btf_inconsistent_proto is
not set (it is set by default for upstream kernels and has been for a
while).
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alan Maguire <alan.maguire@oracle.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mykola Lysenko <mykolal@fb.com>
Link: https://lore.kernel.org/dwarves/20241128012341.4081072-2-ihor.solodrai@pm.me/
Link: https://lore.kernel.org/r/20250109185950.653110-2-ihor.solodrai@pm.me
Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 file changed