On 5/23/26 9:14 AM, Jim Cromie wrote:
> recompose struct _ddebug_info, inserting proper sub-structs.
> 
> The struct _ddebug_info has 2 pairs of _vec, num_##_vec fields, for
> descs and classes respectively.  for_subvec() makes walking these
> vectors less cumbersome, now lets move those field pairs into their
> own "vec" structs: _ddebug_descs & _ddebug_class_maps, and re-compose
> struct _ddebug_info to contain them cleanly.  This also lets us get
> rid of for_subvec()'s num_##_vec paste-up.
> 
> Also recompose struct ddebug_table to contain a _ddebug_info.  This
> reinforces its use as a cursor into relevant data for a builtin
> module, and access to the full _ddebug state for modules.
> 
> NOTES:
> 
> Fixup names: Normalize all struct names to "struct _ddebug_*"
> eliminating the minor/stupid variations created in classmaps-v1.
> 
> Invariant: These vectors ref a contiguous subrange of __section memory
> in builtin/DATA or in loadable modules via mod->dyndbg_info; with
> guaranteed life-time for us.
> 
> struct module contains a _ddebug_info field and module/main.c sets it
> up, so that gets adjusted rather obviously.
> 
> Signed-off-by: Jim Cromie <[email protected]>
> Reviewed-by: Louis Chauvet <[email protected]>
> ---
> [...]
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index 46dd8d25a605..c2b6e70f2e77 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -2774,12 +2774,12 @@ static int find_module_sections(struct module *mod, 
> struct load_info *info)
>               pr_warn("%s: Ignoring obsolete parameters\n", mod->name);
>  
>  #ifdef CONFIG_DYNAMIC_DEBUG_CORE
> -     mod->dyndbg_info.descs = section_objs(info, "__dyndbg",
> -                                           sizeof(*mod->dyndbg_info.descs),
> -                                           &mod->dyndbg_info.num_descs);
> -     mod->dyndbg_info.classes = section_objs(info, "__dyndbg_classes",
> -                                             
> sizeof(*mod->dyndbg_info.classes),
> -                                             &mod->dyndbg_info.num_classes);
> +     mod->dyndbg_info.descs.start = section_objs(info, 
> "__dyndbg_descriptors",
> +                                                 
> sizeof(*mod->dyndbg_info.descs.start),
> +                                                 
> &mod->dyndbg_info.descs.len);
> +     mod->dyndbg_info.maps.start = section_objs(info, "__dyndbg_class_maps",
> +                                                
> sizeof(*mod->dyndbg_info.maps.start),
> +                                                &mod->dyndbg_info.maps.len);
>  #endif
>  
>       return 0;

The update changes the names of dyndbg sections that the module loader
looks up. However, the actual rename is not done until patch 24. It
would be good to clean this up to avoid potential bisection issues.

-- 
Thanks,
Petr

Reply via email to