Re: [PATCH v2 dwarves 1/5] dwarf_loader: introduce pre/post cus__load_module hooks to conf_load

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2024-10-09 at 23:35 +0000, Ihor Solodrai wrote:

[...]

> @@ -106,6 +114,14 @@ struct conf_load {
>  	struct conf_fprintf	*conf_fprintf;
>  	int			(*threads_prepare)(struct conf_load *conf, int nr_threads, void **thr_data);
>  	int			(*threads_collect)(struct conf_load *conf, int nr_threads, void **thr_data, int error);
> +	int			(*pre_cus__load_module)(struct process_dwflmod_parms *parms,
> +							Dwfl_Module *mod,
> +							Dwarf *dw,
> +							Elf *elf);
> +	int			(*post_cus__load_module)(struct process_dwflmod_parms *parms,
> +							 Dwfl_Module *mod,
> +							 Dwarf *dw,
> +							 Elf *elf);
>  };

I'd name these `module_pre_load` and `module_post_load`.
The `post_cus__load_module` does not seem to be used in this
patch-set, so I'd exclude it for now.

I'd also keep the number of parameters to the minimum,
this patch-set defines only btf_encoder__pre_cus__load_module and it
only uses `elf` parameter. But since the hook goal is to operate on
modules I'd pass only Dwfl_Module and use dwfl_module_getelf to get
a link to Elf instance.

>  
>  /** struct conf_fprintf - hints to the __fprintf routines

[...]






[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux