public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Jim Cromie <jim.cromie@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>, Jason Baron <jbaron@akamai.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Petr Pavlu <petr.pavlu@suse.com>,
	Daniel Gomez <da.gomez@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	Aaron Tomlin <atomlin@atomlin.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org, linux-modules@vger.kernel.org,
	linux-kselftest@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Jim Cromie <jim.cromie@gmail.com>,
	Louis Chauvet <louis.chauvet@bootlin.com>,
	Łukasz Bartosik <ukaszb@chromium.org>
Subject: [PATCH v4 00/25] dynamic-debug cleanups refactors maintenance + alignment fix
Date: Tue, 02 Jun 2026 22:47:57 +0000	[thread overview]
Message-ID: <20260602-dd-maint-2-v4-0-19a1445585a8@gmail.com> (raw)

V4 of this series drops 2 doc-only patches in v3, recently picked up
by linux-doc, thx Jonathan

So new 1st 5 are a fix to a linker-script alignment problem in 32bit
arches causing a null-ptr scanning dyndbg-descriptor section on i386.
These were reviewed by Petr Pavlu.

V4 main change is addition and use of match_wildcard_hyphen(), which
allows that "i2c_hid" is same as "i2c-hid" wrt to modname comparison.
This addresses sashiko-dev's feedback on V3.

v3:

The remaining patches are cleanups, refactors in preparation for an
API change needed to fix a regression in DRM when it uses classmaps.
I split these out for easier review, I will follow up with the API
change afterwards.

The biggest revision vs V2 is the new patch: 25.  It addresses a flaw
detected by sashiko which is best described by example.

Dyndbg uses KBUILD_MODNAME to provide module-name, this works well for
loadable modules (module loader requires unique module names), but for
builtin modules, is effectively kbasename, and not unique.

So we get 4 modules named "main": init/main, kernel/power/main,
kernel/base/poser/main.  This ambiguity is visible in user-space since
the beginning of dyndbg.

Now suppose kernel/{,base}/power/main want to define classmaps to
categorize the various pr-debugs they have.  The current code finds a
module's classmaps by strcmp on modname, so init/main will match
against classmaps defined by both kernel/{,base}/power/main.

The current code will also map "main" classes to kernel/*/power/main,
so they will probably work at first, but 2 independent classmaps can
both use class-ids 0-N, but will conflict if they're both used by a
module.  Then we have classmap overlaps and unpredictable results.

patch-24 eliminates the ambiguity by using KBUILD_MODFILE to provide a
unique module-name, then adds matching against kbasename(modname) to
restore the legacy query behavior.  It *does* change the modname
exposed in /proc/dynamic_debug/control, but not the result of a query
like "module main +p".

OLDER VERSIONS:

V2 primarily revises:
 https://lore.kernel.org/lkml/20260504-dd-cleanups-2-v1-0-6fdd24040642@gmail.com/
    
V2 addressed most of sashiko's feedback on V1:
 https://sashiko.dev/#/patchset/20260504-dd-cleanups-2-v1-0-6fdd24040642%40gmail.com
    
It dropped the pr-fmt patch, as not reproducible,
advanced the drop-NAMES patch to reduce subsequent churn,
and fixed the classmaps PARAMs to u64 to avoid 32bit flags on 32bit arches
    
For easy one-stop-shopping, V2 also included 2 smaller series:
    
1st fixes a section alignment problem, with Reviewed-by from Petr Pavlu
 https://lore.kernel.org/lkml/20260515-asm-generic-1-v3-0-680b273666d4@gmail.com/
    
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
    

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
Changes in v4:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v3: https://lore.kernel.org/r/20260601-dd-maint-2-v3-0-4a15b241bd3c@gmail.com

Changes in v3:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v2: https://lore.kernel.org/r/20260523-dd-maint-2-v2-0-b937312aa083@gmail.com

---
Jim Cromie (25):
      docs/dyndbg: update examples \012 to \n
      docs/dyndbg: explain flags parse 1st
      vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h
      vmlinux.lds.h: drop unused HEADERED_SECTION* macros
      vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386
      vmlinux.lds.h: remove redundant ALIGN(8) directives
      dyndbg.lds.S: fix lost dyndbg sections in modules
      dyndbg: factor ddebug_match_desc out from ddebug_change
      dyndbg: add stub macro for DECLARE_DYNDBG_CLASSMAP
      dyndbg: reword "class unknown," to "class:_UNKNOWN_"
      dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code
      dyndbg: drop NUM_TYPE_ARGS
      dyndbg: reduce verbose/debug clutter
      dyndbg: refactor param_set_dyndbg_classes and below
      dyndbg: tighten fn-sig of ddebug_apply_class_bitmap
      dyndbg: replace classmap list with an array-slice
      dyndbg: macrofy a 2-index for-loop pattern
      dyndbg: Upgrade class param storage to u64 for 64-bit classmaps
      dyndbg,module: make proper substructs in _ddebug_info
      dyndbg: move mod_name down from struct ddebug_table to _ddebug_info
      dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module
      selftests-dyndbg: add a dynamic_debug run_tests target
      dyndbg: change __dynamic_func_call_cls* macros into expressions
      lib/parser: add match_wildcard_hyphen() for agnostic matching
      dynamic_debug: use KBUILD_MODFILE for unique builtin module names

 Documentation/admin-guide/dynamic-debug-howto.rst  |  55 ++-
 MAINTAINERS                                        |   2 +
 drivers/gpu/drm/drm_print.c                        |   6 +-
 include/asm-generic/bounded_sections.lds.h         |  32 ++
 include/asm-generic/dyndbg.lds.h                   |  18 +
 include/asm-generic/vmlinux.lds.h                  |  68 +--
 include/drm/drm_print.h                            |   2 +-
 include/linux/dynamic_debug.h                      | 133 +++---
 include/linux/parser.h                             |   1 +
 kernel/module/main.c                               |  12 +-
 lib/dynamic_debug.c                                | 507 ++++++++++-----------
 lib/parser.c                                       |  58 ++-
 lib/test_dynamic_debug.c                           |  30 +-
 scripts/module.lds.S                               |   2 +
 tools/testing/selftests/Makefile                   |   1 +
 tools/testing/selftests/dynamic_debug/Makefile     |   9 +
 tools/testing/selftests/dynamic_debug/config       |   8 +
 .../selftests/dynamic_debug/dyndbg_selftest.sh     | 343 ++++++++++++++
 18 files changed, 833 insertions(+), 454 deletions(-)
---
base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
change-id: 20260521-dd-maint-2-76c542079420

Best regards,
-- 
Jim Cromie <jim.cromie@gmail.com>


             reply	other threads:[~2026-06-02 22:48 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 22:47 Jim Cromie [this message]
2026-06-02 22:47 ` [PATCH v4 01/25] docs/dyndbg: update examples \012 to \n Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:47 ` [PATCH v4 02/25] docs/dyndbg: explain flags parse 1st Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 03/25] vmlinux.lds.h: refactor BOUNDED_SECTION_* macros into bounded_sections.lds.h Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 04/25] vmlinux.lds.h: drop unused HEADERED_SECTION* macros Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 05/25] vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386 Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 06/25] vmlinux.lds.h: remove redundant ALIGN(8) directives Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 07/25] dyndbg.lds.S: fix lost dyndbg sections in modules Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 08/25] dyndbg: factor ddebug_match_desc out from ddebug_change Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 09/25] dyndbg: add stub macro for DECLARE_DYNDBG_CLASSMAP Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 10/25] dyndbg: reword "class unknown," to "class:_UNKNOWN_" Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 11/25] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 12/25] dyndbg: drop NUM_TYPE_ARGS Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 13/25] dyndbg: reduce verbose/debug clutter Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 14/25] dyndbg: refactor param_set_dyndbg_classes and below Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 15/25] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 16/25] dyndbg: replace classmap list with an array-slice Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 17/25] dyndbg: macrofy a 2-index for-loop pattern Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 18/25] dyndbg: Upgrade class param storage to u64 for 64-bit classmaps Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 19/25] dyndbg,module: make proper substructs in _ddebug_info Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 20/25] dyndbg: move mod_name down from struct ddebug_table to _ddebug_info Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 21/25] dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 22/25] selftests-dyndbg: add a dynamic_debug run_tests target Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 23/25] dyndbg: change __dynamic_func_call_cls* macros into expressions Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 24/25] lib/parser: add match_wildcard_hyphen() for agnostic matching Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-02 22:48 ` [PATCH v4 25/25] dynamic_debug: use KBUILD_MODFILE for unique builtin module names Jim Cromie
2026-06-04  2:12   ` Claude review: " Claude Code Review Bot
2026-06-04  2:12 ` Claude review: dynamic-debug cleanups refactors maintenance + alignment fix Claude Code Review Bot

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=20260602-dd-maint-2-v4-0-19a1445585a8@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=atomlin@atomlin.com \
    --cc=corbet@lwn.net \
    --cc=da.gomez@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jbaron@akamai.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mcgrof@kernel.org \
    --cc=mripard@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=samitolvanen@google.com \
    --cc=shuah@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=skhan@linuxfoundation.org \
    --cc=tzimmermann@suse.de \
    --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