BPF List
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Eduard Zingerman <eddyz87@gmail.com>,
	Ihor Solodrai <ihor.solodrai@pm.me>,
	dwarves@vger.kernel.org, acme@kernel.org
Cc: bpf@vger.kernel.org, andrii@kernel.org, mykolal@fb.com
Subject: Re: [RFC PATCH 2/9] btf_encoder: store,use section-relative addresses in ELF function representation
Date: Mon, 2 Dec 2024 14:34:33 +0000	[thread overview]
Message-ID: <d693964a-053d-418f-b34d-d652b8712508@oracle.com> (raw)
In-Reply-To: <60f195235812389d44c009a7fd97a6a12aa48b17.camel@gmail.com>

On 29/11/2024 09:07, Eduard Zingerman wrote:
> On Thu, 2024-11-28 at 01:23 +0000, Ihor Solodrai wrote:
>> From: Alan Maguire <alan.maguire@oracle.com>
>>
>> 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.
>

I've also found the opposite situation; that some functions are not
present after this patch that were before. In your case - where more
were matched - I suspect the extra address hint allowed us to do a
better job of matching ELF and DWARF such that we matched .isra.0
functions that represent actual function boundaries rather than .cold
subfunctions that had different signatures. I'm working on a respin of
the initial patches that ensures we get the same (or more) number of
functions, but it shouldn't change substantially anything that follows
that Ihor has done.

>>
>> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
>> Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
>> ---
>>  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;
>>  };
>>  
> 
> [...]
> 


  reply	other threads:[~2024-12-02 14:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28  1:23 [RFC PATCH 0/9] pahole: shared ELF and faster reproducible BTF encoding Ihor Solodrai
2024-11-28  1:23 ` [RFC PATCH 1/9] btf_encoder: simplify function encoding Ihor Solodrai
2024-11-29  8:16   ` Eduard Zingerman
2024-12-02 13:55   ` Jiri Olsa
2024-11-28  1:23 ` [RFC PATCH 2/9] btf_encoder: store,use section-relative addresses in ELF function representation Ihor Solodrai
2024-11-29  9:07   ` Eduard Zingerman
2024-12-02 14:34     ` Alan Maguire [this message]
2024-11-28  1:23 ` [RFC PATCH 3/9] btf_encoder: separate elf function, saved function representations Ihor Solodrai
2024-11-29 20:37   ` Eduard Zingerman
2024-12-09 21:19     ` Ihor Solodrai
2024-11-28  1:24 ` [RFC PATCH 4/9] dwarf_loader: introduce pre_load_module hook to conf_load Ihor Solodrai
2024-11-29 21:03   ` Eduard Zingerman
2024-11-28  1:24 ` [RFC PATCH 5/9] btf_encoder: introduce elf_functions struct type Ihor Solodrai
2024-11-29 21:50   ` Eduard Zingerman
2024-11-28  1:24 ` [RFC PATCH 6/9] btf_encoder: collect elf_functions in btf_encoder__pre_load_module Ihor Solodrai
2024-11-29 22:27   ` Eduard Zingerman
2024-11-28  1:24 ` [RFC PATCH 7/9] btf_encoder: switch to shared elf_functions table Ihor Solodrai
2024-11-29 22:35   ` Eduard Zingerman
2024-12-09 23:55     ` Ihor Solodrai
2024-11-28  1:24 ` [RFC PATCH 8/9] btf_encoder: introduce btf_encoding_context Ihor Solodrai
2024-11-29 23:12   ` Eduard Zingerman
2024-11-28  1:24 ` [RFC PATCH 9/9] pahole: faster reproducible BTF encoding Ihor Solodrai
2024-11-30  0:17   ` Eduard Zingerman
2024-12-02 13:55 ` [RFC PATCH 0/9] pahole: shared ELF and " Jiri Olsa
2024-12-06 18:19   ` Ihor Solodrai
2024-12-06 18:30     ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d693964a-053d-418f-b34d-d652b8712508@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=acme@kernel.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@pm.me \
    --cc=mykolal@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox