From: jim.cromie@gmail.com
To: Jason Baron <jbaron@akamai.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
gregkh@linuxfoundation.org, ukaszb@chromium.org,
louis.chauvet@bootlin.com, Bagas Sanjaya <bagasdotme@gmail.com>,
Linux Documentation List <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v6 16/31] dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module
Date: Thu, 11 Dec 2025 09:21:15 +1300 [thread overview]
Message-ID: <CAJfuBxw8xV2RrbTWpmQFpCpiSp9A7KCLP74T_bu+4mxBROf1sg@mail.gmail.com> (raw)
In-Reply-To: <9f36429d-1d6e-4501-a092-fbf45254d116@akamai.com>
On Thu, Dec 11, 2025 at 8:14 AM Jason Baron <jbaron@akamai.com> wrote:
>
>
>
> On 12/10/25 1:33 AM, jim.cromie@gmail.com wrote:
> > !-------------------------------------------------------------------|
> > This Message Is From an External Sender
> > This message came from outside your organization.
> > |-------------------------------------------------------------------!
> >
> > On Wed, Dec 10, 2025 at 11:43 AM Jason Baron <jbaron@akamai.com> wrote:
> >>
> >> Hi Jim,
> >>
> >> Very minor nit below about the kernel-doc ordering for args...
> >>
> >
> >>> +/*
> >>> + * Walk the @_box->@_vec member, over @_vec.start[0..len], and find
> >>> + * the contiguous subrange of elements matching on ->mod_name. Copy
> >>> + * the subrange into @_dst. This depends on vars defd by caller.
> >>> + *
> >>> + * @_i: caller provided counter var, init'd by macro
> >>> + * @_sp: cursor into @_vec.
> >>> + * @_box: contains member named @_vec
> >>> + * @_vec: member-name of a type with: .start .len fields.
> >>> + * @_dst: an array-ref: to remember the module's subrange
> >>> + */
> >>
> >> Not sure if the odering matters for the docs, but it makes it a bit
> >> harder read when these don't go in order.
> >>
> >> Thanks,
> >>
> >> -Jason
> >>
> >
> > I chose that doc ordering for clarity, the easy ones 1st,
> > and @dst last since it gets the subrange info.
> > I think reordering might mean more words trying to connect
> > the pieces, and with less clarity.
> > It does work against the macro arg ordering,
> > which places @dst near the front,
> > I did that to follow LHS = RHS(...) convention.
> >
> > Im happy to swap it around if anyone thinks that convention
> > should supercede these reasons,
> > but Im in NZ on vacation right now,
> > and I forgot to pull the latest rev off my desktop before I left.
> > so I dont want to fiddle with the slightly older copy I have locally,
> > and then have to isolate and fix whatever is different.
> >
> > the same applies to the Documentation tweaks that Bagas noted.
>
> Couldn't you then re-order the function args to match the doc order instead?
>
As you might surmise, the code was written before the kdoc.
Since it is setting the @_dst, it feels like an assignment.
Therefore the LHS = RHS convention seemed pertinent,
and the macro args are ordered to conform to this.
For the (pseudo- since its not /** ) kdoc,
the linear explanation was simplest and clearest, ending with @_dst.
So I see these options (in my preferred order), please pick one.
1. leave as is
2. add an NB: that arg order differs from doc-order
3. change macro arg order
4. change kdoc arg order
If 2-4 can wait, I can do that trivially once Im home (in Jan)
Doing it now, from here, will require fiddling with git am on the mbox.gz
with which Ive had mixed results/troubles in the past.
thanks,
Jim
> Thanks,
>
> -Jason
>
>
> >
> >
> >
> >
> >
> >>> +#define dd_mark_vector_subrange(_i, _dst, _sp, _box, _vec) ({ \
> >>> + typeof(_dst) __dst = (_dst); \
> >>> + int __nc = 0; \
> >>> + for_subvec(_i, _sp, _box, _vec) { \
> >>> + if (!strcmp((_sp)->mod_name, (_dst)->mod_name)) { \
> >>> + if (!__nc++) \
> >>> + (__dst)->info._vec.start = (_sp); \
> >>> + } else { \
> >>> + if (__nc) \
> >>> + break; /* end of consecutive matches */ \
> >>> + } \
> >>> + } \
> >>> + (__dst)->info._vec.len = __nc; \
> >>> +})
> >>> +
> >>> /*
> >>> * Allocate a new ddebug_table for the given module
> >>> * and add it to the global list.
> >>> @@ -1278,6 +1283,8 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _ddebug
> >>> static int ddebug_add_module(struct _ddebug_info *di, const char *modname)
> >>> {
> >>> struct ddebug_table *dt;
> >>> + struct _ddebug_class_map *cm;
> >>> + int i;
> >>>
> >>> if (!di->descs.len)
> >>> return 0;
> >>> @@ -1300,6 +1307,8 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname)
> >>>
> >>> INIT_LIST_HEAD(&dt->link);
> >>>
> >>> + dd_mark_vector_subrange(i, dt, cm, di, maps);
> >>> +
> >>> if (di->maps.len)
> >>> ddebug_attach_module_classes(dt, di);
> >>>
> >>
>
next prev parent reply other threads:[~2025-12-10 20:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251118201842.1447666-1-jim.cromie@gmail.com>
2025-11-18 20:18 ` [PATCH v6 04/31] docs/dyndbg: explain flags parse 1st Jim Cromie
2025-11-20 9:30 ` Bagas Sanjaya
2025-11-18 20:18 ` [PATCH v6 21/31] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP Jim Cromie
2025-11-18 20:18 ` [PATCH v6 25/31] dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to API Jim Cromie
2025-11-18 20:18 ` [PATCH v6 31/31] docs/dyndbg: add classmap info to howto Jim Cromie
2025-11-20 3:08 ` Bagas Sanjaya
2025-11-20 16:22 ` jim.cromie
[not found] ` <20251118201842.1447666-17-jim.cromie@gmail.com>
[not found] ` <fcb2532d-5627-4bc3-a990-ed361b56ccd3@akamai.com>
2025-12-10 6:33 ` [PATCH v6 16/31] dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module jim.cromie
2025-12-10 19:14 ` Jason Baron
2025-12-10 20:21 ` jim.cromie [this message]
2025-12-12 16:05 ` Jason Baron
2025-12-14 18:09 ` jim.cromie
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=CAJfuBxw8xV2RrbTWpmQFpCpiSp9A7KCLP74T_bu+4mxBROf1sg@mail.gmail.com \
--to=jim.cromie@gmail.com \
--cc=bagasdotme@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jbaron@akamai.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=ukaszb@chromium.org \
/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;
as well as URLs for NNTP newsgroup(s).