Re: [PATCH v11 20/38] dyndbg,module: make proper substructs in _ddebug_info

From: Petr Pavlu

Date: Fri Sep 25 2026 - 05:30:01 EST


On 9/24/26 12:34 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 _ddebug_info's use as a cursor into relevant data for a
> builtin module, and access to the full _ddebug state for modules.
>
> NOTES:
>
> rename section:__dyndbg_classes to _class_maps, to better align with
> struct _ddebug_class_maps.
>
> names together, for more obvious name pairing.
>
> 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 <jim.cromie@xxxxxxxxx>
> Reviewed-by: Louis Chauvet <louis.chauvet@xxxxxxxxxxx>
> ---
> v8: set maps.len = nc unconditionally
> v3: squash in section name changes.
>
> v2:
>
> Move RvB after SoB
> In structs _ddebug_descs & _ddebug_class_maps, change int length to unsigned int
> No use of <0 vals is contemplated.
>
> dyndbg: improve section names
>
> change __dyndbg to __dyndbg_descs
> change __dyndbg_classes to __dyndbg_class_maps
>
> this sets up for adding __dyndbg_class_users
>
> fixup-drmprint
> ---
> include/asm-generic/dyndbg.lds.h | 14 +++---
> include/linux/dynamic_debug.h | 34 ++++++++-----
> kernel/module/main.c | 12 ++---
> lib/dynamic_debug.c | 101 +++++++++++++++++++--------------------
> 4 files changed, 86 insertions(+), 75 deletions(-)

Acked-by: Petr Pavlu <petr.pavlu@xxxxxxxx> # modules

-- Petr