On Thu, 2024-11-28 at 01:23 +0000, Ihor Solodrai wrote: > From: Alan Maguire <alan.maguire@xxxxxxxxxx> > > This will help us do more accurate DWARF/ELF matching. It would be good to have a more detailed explanation here. E.g. number of generated functions differs with this patch: # without this patch $ bpftool btf dump file /home/eddy/work/tmp/old.btf | grep "\] FUNC '" | wc -l 48056 # with this patch $ bpftool btf dump file /home/eddy/work/tmp/new.btf | grep "\] FUNC '" | wc -l 48189 It would be helpful to peek one of newly added functions and explain why it was previously excluded. > > Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx> > Signed-off-by: Ihor Solodrai <ihor.solodrai@xxxxx> > --- > btf_encoder.c | 37 +++++++++++++++++++++++++++++++------ > 1 file changed, 31 insertions(+), 6 deletions(-) > > diff --git a/btf_encoder.c b/btf_encoder.c > index 98e4d7d..01d7094 100644 > --- a/btf_encoder.c > +++ b/btf_encoder.c > @@ -88,6 +88,7 @@ struct btf_encoder_func_state { > struct elf_function { > const char *name; > char *alias; > + uint32_t addr; > size_t prefixlen; > struct btf_encoder_func_state state; > }; > @@ -131,6 +132,7 @@ struct btf_encoder { > int allocated; > int cnt; > int suffix_cnt; /* number of .isra, .part etc */ > + uint64_t base_addr; This field is set, but never read. > } functions; > }; > [...]