BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Ihor Solodrai <ihor.solodrai@pm.me>,
	dwarves@vger.kernel.org,  acme@kernel.org
Cc: bpf@vger.kernel.org, alan.maguire@oracle.com, andrii@kernel.org,
	 mykolal@fb.com
Subject: Re: [RFC PATCH 4/9] dwarf_loader: introduce pre_load_module hook to conf_load
Date: Fri, 29 Nov 2024 13:03:10 -0800	[thread overview]
Message-ID: <f1962647c94b3f34ed5a908d1eeaba3a883801f6.camel@gmail.com> (raw)
In-Reply-To: <20241128012341.4081072-5-ihor.solodrai@pm.me>

On Thu, 2024-11-28 at 01:24 +0000, Ihor Solodrai wrote:
> Add a function pointer to conf_load, which is called immediately after
> Elf is extracted from Dwfl_Module in cus__proces_dwflmod.
> 
> This is a preparation for making elf_functions table shared between
> encoders. Shared table can be built as soon as the relevant Elf is
> available.
> 
> Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
> ---
>  dwarf_loader.c | 14 +++++++-------
>  dwarves.h      | 11 +++++++++--
>  2 files changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/dwarf_loader.c b/dwarf_loader.c
> index 598fde4..5d55649 100644
> --- a/dwarf_loader.c
> +++ b/dwarf_loader.c
> @@ -3796,13 +3796,6 @@ static int cus__load_module(struct cus *cus, struct conf_load *conf,
>  	return DWARF_CB_OK;
>  }
>  
> -struct process_dwflmod_parms {
> -	struct cus	 *cus;
> -	struct conf_load *conf;
> -	const char	 *filename;
> -	uint32_t	 nr_dwarf_sections_found;
> -};
> -

This is probably a leftover, moving this structure is not necessary.

>  static int cus__process_dwflmod(Dwfl_Module *dwflmod,
>  				void **userdata __maybe_unused,
>  				const char *name __maybe_unused,
> @@ -3826,11 +3819,18 @@ static int cus__process_dwflmod(Dwfl_Module *dwflmod,
>  	Dwarf *dw = dwfl_module_getdwarf(dwflmod, &dwbias);
>  
>  	int err = DWARF_CB_OK;
> +	if (parms->conf->pre_load_module) {
> +		err = parms->conf->pre_load_module(dwflmod, elf);
> +		if (err)
> +			return DWARF_CB_ABORT;
> +	}
> +
>  	if (dw != NULL) {
>  		++parms->nr_dwarf_sections_found;
>  		err = cus__load_module(cus, parms->conf, dwflmod, dw, elf,
>  				       parms->filename);
>  	}
> +

Nit: useless white space change.

>  	/*
>  	 * XXX We will fall back to try finding other debugging
>  	 * formats (CTF), so no point in telling this to the user

[...]


  reply	other threads:[~2024-11-29 21:03 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
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 [this message]
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=f1962647c94b3f34ed5a908d1eeaba3a883801f6.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --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