Re: [PATCH v11 22/65] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP

From: jim . cromie

Date: Fri Mar 20 2026 - 13:52:49 EST


On Fri, Mar 20, 2026 at 10:42 AM Louis Chauvet
<louis.chauvet@xxxxxxxxxxx> wrote:
>
> On Fri, 13 Mar 2026 07:19:47 -0600, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
> > diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> > index 80160028461a..74ed18a038bd 100644
> > --- a/include/linux/dynamic_debug.h
> > +++ b/include/linux/dynamic_debug.h
> > @@ -81,10 +84,18 @@ struct _ddebug_class_map {
> > enum ddebug_class_map_type map_type;
> > };
> >
> > +struct _ddebug_class_user {
> > + char *mod_name;
> > + struct _ddebug_class_map *map;
> > + const int offset; /* user offset to re-number the used map */
> > +};
>
> Is it usefull at this point?
>
> > @@ -137,6 +223,25 @@ struct _ddebug_class_param {
> > [ ... skip 14 lines ... ]
> > + extern struct _ddebug_class_map _var; \
> > + static struct _ddebug_class_user __aligned(8) __used \
> > + __section("__dyndbg_class_users") _uname = { \
> > + .mod_name = KBUILD_MODNAME, \
> > + .map = &(_var), \
> > + .offset = _offset \
>
> I think this offset is useless at this point, or did I miss something?

It is unused yet, it gets used later (patch ~31) in _USE_
to deconflict class-ids when its needed.

I squashed it in here to reduce churn later, and because it is closely
related in function to the offset in class_maps, so I thought it would be
easier to explain in context.

>
> >
> > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> > index e8ffc2b5b330..66f4bfe39e89 100644
> > --- a/lib/dynamic_debug.c
> > +++ b/lib/dynamic_debug.c
> > @@ -1190,6 +1292,22 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _ddebug
> > [ ... skip 13 lines ... ]
> > + return -EINVAL;
> > + }
> > + *reserved_ids |= range;
> > + return 0;
> > +}
> > +
>
> Can you introduce this function when it is used?
>

not sure I follow,
the ddebug_attach_module_classes is from v1 (committed code),
its basically going away in v2 (candidate, at rev11 now)

> --
> Louis Chauvet <louis.chauvet@xxxxxxxxxxx>