dyndbg: Rework classmap API to fix module dependency issues
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest30 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/30 | docs/dyndbg: update examples \012 to \nDocumentation/ | +10 | 0 replies | |
| 2/30 | docs/dyndbg: explain flags parse 1stDocumentation/ | +12 | 0 replies | |
| 3/30 | test-dyndbg: fixup CLASSMAP usage errorlib/ | +1 | 0 replies | |
| 4/30 | dyndbg: reword "class unknown," to "class:_UNKNOWN_"lib/ | +1 | 0 replies | |
| 5/30 | dyndbg: make ddebug_class_param union members same sizeinclude/ lib/ | +2 | 0 replies | |
| 6/30 | dyndbg: drop NUM_TYPE_ARRAYinclude/ | +1 | 0 replies | |
| 7/30 | dyndbg: tweak pr_fmt to avoid expansion conflictslib/ | +1 | 0 replies | |
| 8/30 | dyndbg: reduce verbose/debug clutterlib/ | +6 | 0 replies | |
| 9/30 | dyndbg: refactor param_set_dyndbg_classes and belowlib/ | +40 | 0 replies | |
| 10/30 | dyndbg: tighten fn-sig of ddebug_apply_class_bitmaplib/ | +11 | 0 replies | |
| 11/30 | dyndbg: replace classmap list with a vectorinclude/ lib/ | +32 | 0 replies | |
| 12/30 | dyndbg: macrofy a 2-index for-loop patternlib/ | +16 | 0 replies | |
| 13/30 | dyndbg: DECLARE_DYNDBG_CLASSMAP needs stub defninclude/ | +20 | 0 replies | |
| 14/30 | dyndbg,module: make proper substructs in _ddebug_infoinclude/ include/ kernel/ +2 more | +87 | 0 replies | |
| 15/30 | dyndbg: hoist classmap-filter-by-modname up to ddebug_add_modulelib/ | +32 | 0 replies | |
| 16/30 | dyndbg: move mod_name from ddebug_table down to _ddebug_infoinclude/ lib/ | +24 | 0 replies | |
| 17/30 | dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and codeinclude/ lib/ lib/ | +14 | 0 replies | |
| 18/30 | selftests-dyndbg: add a dynamic_debug run_tests targetMAINTAINERS tools/ tools/ +2 more | +275 | 0 replies | |
| 19/30 | dyndbg: change __dynamic_func_call_cls* macros into expressionsinclude/ | +4 | 0 replies | |
| 20/30 | dyndbg-API: replace DECLARE_DYNDBG_CLASSMAPMAINTAINERS include/ include/ +6 more | +397 | 0 replies | |
| 21/30 | dyndbg: detect class_id reservation conflictslib/ lib/ | +35 | 0 replies | |
| 22/30 | dyndbg: check DYNAMIC_DEBUG_CLASSMAP_DEFINE args at compile-timeinclude/ lib/ | +21 | 0 replies | |
| 23/30 | dyndbg-test: change do_prints testpoint to accept a loopctlib/ | +21 | 0 replies | |
| 24/30 | dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to APIinclude/ lib/ lib/ +1 more | +106 | 0 replies | |
| 25/30 | dyndbg: treat comma as a token separatorDocumentation/ lib/ tools/ | +39 | 0 replies | |
| 26/30 | dyndbg: split multi-query strings with %Documentation/ lib/ tools/ | +30 | 0 replies | |
| 27/30 | selftests-dyndbg: add test_mod_submodtools/ | +73 | 0 replies | |
| 28/30 | dyndbg: resolve "protection" of class'd pr_debugsinclude/ lib/ | +100 | 0 replies | |
| 29/30 | dyndbg: add DYNAMIC_DEBUG_CLASSMAP_USE_(clname,_base)include/ lib/ | +35 | 0 replies | |
| 30/30 | docs/dyndbg: add classmap info to howtoDocumentation/ | +116 | 0 replies |
Reviews trailers per patch
13 of 30 patches have a Reviewed-by or Acked-by.
| Patch | Louis Chauvet |
|---|---|
| 1/30 | R-b T-b |
| 2/30 | R-b |
| 3/30 | R-b T-b |
| 4/30 | R-b |
| 5/30 | R-b |
| 6/30 | R-b |
| 7/30 | |
| 8/30 | R-b |
| 9/30 | R-b |
| 10/30 | R-b |
| 11/30 | |
| 12/30 | R-b |
| 13/30 | |
| 14/30 | |
| 15/30 | |
| 16/30 | R-b |
| 17/30 | |
| 18/30 | |
| 19/30 | |
| 20/30 | |
| 21/30 | |
| 22/30 | |
| 23/30 | |
| 24/30 | |
| 25/30 | |
| 26/30 | R-b |
| 27/30 | R-b |
| 28/30 | |
| 29/30 | |
| 30/30 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/30] dyndbg: Rework classmap API to fix module dependency issues
This series reworks the dynamic_debug (dyndbg) classmap API to fix a fundamental design flaw that caused issues in subsystems sharing classmaps across several modules, in the 1st use case: DRM
This broke it:
commit aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") This recognized it:
commit bb2ff6c27bc9 ("drm: Disable dynamic debug as broken").
Key changes in this series:
* Core API Rework:
- Replaced DECLARE_DYNDBG_CLASSMAP with a new DEFINE/USE pattern (DYNAMIC_DEBUG_CLASSMAP_DEFINE and DYNAMIC_DEBUG_CLASSMAP_USE) to allow for shared classmap definitions between modules. This is the core fix for the module dependency issue.
- compile-time and run-time checks to detect and prevent misuses of the classmap API, such as overlapping class_id ranges.
- Refined the logic for "protecting" classmaps that implement a stable ABI (like drm.debug).
- undo dumb namespace noise: DYNDBG_, ddebug (w/o the leading _)
* New Test:
- cd tools/testing/selftests; make TARGETS=dynamic_debug run_tests
- supplants DRM as the necessary test
- good for Tested-by: ?
* cleanup, maintenance, refactoring:
- drop unneeded linked list, keep classmaps as "vector"
- tighten/declutter internal callchains, etc
- several macros to de-duplicate code.
* excluded DRM parts
- previous revisions included them for testing, validating
- but this complicated things: audience & purpose
* Documentation:
- The documentation has been updated to reflect all the new API changes and explain the design rationale.
This series has been tested on 3 x86 boxen (w amdgpu, nouveau) and in virtme-ng with 8 permuted variations of the CONFIG_*DYNAMIC_DEBUG* options and others.
The testing included DRM-specific adaptation patches which are excluded here for clarity, but which are the actual user of this feature, and needed for "proof-on-HW-devices".
Jim Cromie (30):
docs/dyndbg: update examples \012 to \n
docs/dyndbg: explain flags parse 1st
test-dyndbg: fixup CLASSMAP usage error
dyndbg: reword "class unknown," to "class:_UNKNOWN_"
dyndbg: make ddebug_class_param union members same size
dyndbg: drop NUM_TYPE_ARRAY
dyndbg: tweak pr_fmt to avoid expansion conflicts
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 a vector
dyndbg: macrofy a 2-index for-loop pattern
dyndbg: DECLARE_DYNDBG_CLASSMAP needs stub defn dyndbg,module: make proper substructs in _ddebug_info
dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module
dyndbg: move mod_name from ddebug_table down to _ddebug_info
dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code
selftests-dyndbg: add a dynamic_debug run_tests target
dyndbg: change __dynamic_func_call_cls* macros into expressions
dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP
dyndbg: detect class_id reservation conflicts
dyndbg: check DYNAMIC_DEBUG_CLASSMAP_DEFINE args at compile-time
dyndbg-test: change do_prints testpoint to accept a loopct
dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to API
dyndbg: treat comma as a token separator
dyndbg: split multi-query strings with %
selftests-dyndbg: add test_mod_submod
dyndbg: resolve "protection" of class'd pr_debugs
dyndbg: add DYNAMIC_DEBUG_CLASSMAP_USE_(clname,_base) docs/dyndbg: add classmap info to howto
.../admin-guide/dynamic-debug-howto.rst | 179 ++++- MAINTAINERS | 3 +- include/asm-generic/vmlinux.lds.h | 5 +- include/linux/dynamic_debug.h | 304 ++++++-- kernel/module/main.c | 15 +- lib/Kconfig.debug | 24 +- lib/Makefile | 5 + lib/dynamic_debug.c | 675 +++++++++++------- lib/test_dynamic_debug.c | 198 +++-- lib/test_dynamic_debug_submod.c | 21 + tools/testing/selftests/Makefile | 1 + .../testing/selftests/dynamic_debug/Makefile | 9 + tools/testing/selftests/dynamic_debug/config | 7 + .../dynamic_debug/dyndbg_selftest.sh | 373 ++++++++++ 14 files changed, 1392 insertions(+), 427 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c create mode 100644 tools/testing/selftests/dynamic_debug/Makefile create mode 100644 tools/testing/selftests/dynamic_debug/config create mode 100755 tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh
Signature · 1 line
2.51.0