Re: [PATCH v8 00/35] fix CONFIG_DRM_USE_DYNAMIC_DEBUG=y regression

2024-05-08 Thread jim . cromie
On Mon, Apr 29, 2024 at 1:32 PM Jim Cromie wrote: > > hi Greg, Jason, DRM-folk, > > This patchset fixes the CONFIG_DRM_USE_DYNAMIC_DEBUG=y regression, > Fixes: bb2ff6c27bc9 ("drm: Disable dynamic debug as broken") > > this is v8. > Its also here: > https://g

Re: [PATCH v8 29/35] dyndbg: add __counted_by annotations

2024-04-30 Thread jim . cromie
On Mon, Apr 29, 2024 at 1:39 PM Jim Cromie wrote: > > Tell the compiler about our vectors (array,length), in 2 places: > these are not flex-arrays, using counted-by is wrong here. Ive dropped this commit, series rebases clean wo it. > h: struct _ddebug_info, which keeps refs to t

[PATCH v8 35/35] drm-print: workaround compiler meh

2024-04-29 Thread Jim Cromie
cific printer") CC: Jani Nikula Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index efdf82f8cbbb..c400441cd77e 100644 --- a/drivers/gpu/drm/drm_pri

[PATCH v8 25/35] docs/dyndbg: explain new delimiters: comma, percent

2024-04-29 Thread Jim Cromie
Add mention of comma and percent delimiters into the respective paragraphs describing their equivalents: space and newline. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst| 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

[PATCH v8 34/35] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2024-04-29 Thread Jim Cromie
Time for some quality CI Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 5a0c476361c3..b2ea73ae48f0 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm

[PATCH v8 32/35] drm: use correct ccflags-y spelling

2024-04-29 Thread Jim Cromie
*_dbg in dyndbg descriptor factory macro") Signed-off-by: Jim Cromie --- drivers/gpu/drm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 104b42df2e95..313516fc2ad5 100644 --- a/drivers/gpu/drm/Makefile +++ b/d

[PATCH v8 31/35] drm-dyndbg: adapt to use DYNDBG_CLASSMAP_PARAM

2024-04-29 Thread Jim Cromie
use new export --- drivers/gpu/drm/drm_print.c | 8 ++-- include/drm/drm_print.h | 6 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 4a5f2317229b..efdf82f8cbbb 100644 --- a/drivers/gpu/drm/drm_print.c

[PATCH v8 27/35] selftests-dyndbg: test dyndbg-to-tracefs

2024-04-29 Thread Jim Cromie
ss. This allows the patch to be committed now w/o inducing selftest failures, and the tests enabled later, with the promised code. Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- .../dynamic_debug/dyndbg_selftest.sh | 435 ++

[PATCH v8 33/35] drm-drivers: DRM_CLASSMAP_USE in 2nd batch of drivers, helpers

2024-04-29 Thread Jim Cromie
as found by choosing M for all DRM-config items I found (not allmodconfig), building & modprobing them, and grepping "class unknown," control. There may yet be others. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ drivers/gpu/drm/gud/gud_drv.c

[PATCH v8 28/35] dyndbg-doc: explain flags parse 1st

2024-04-29 Thread Jim Cromie
ags, and before the match-spec is detailed. Opinions ? Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-de

[PATCH v8 30/35] drm+drivers: adapt to use DYNDBG_CLASSMAP_{DEFINE, USE}

2024-04-29 Thread Jim Cromie
("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +--- drivers/gpu/drm/display/drm_dp_helper.c | 12 +--- drivers/gpu/drm/drm_crtc_helper.c | 12 +--- drivers/gpu/drm/d

[PATCH v8 29/35] dyndbg: add __counted_by annotations

2024-04-29 Thread Jim Cromie
Tell the compiler about our vectors (array,length), in 2 places: h: struct _ddebug_info, which keeps refs to the __dyndbg_* ELF/DATA sections, these are all vectors with a length. c: struct ddebug_table, which has sub-refs into _ddebug_info.* Signed-off-by: Jim Cromie --- include/linux

[PATCH v8 26/35] selftests-dyndbg: add test_mod_submod

2024-04-29 Thread Jim Cromie
smap patches its validating. With some tedium, the tests could be refactored to split out early tests which avoid multi-cmds, and test only the class-params. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 60 +++ 1 file changed, 60 insertions(+)

[PATCH v8 21/35] dyndbg: treat comma as a token separator

2024-04-29 Thread Jim Cromie
dynamic_debug dyndbg=class,D2_CORE,+p Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- lib/dynamic_debug.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 31fd67597928.

[PATCH v8 24/35] selftests-dyndbg: test_percent_splitting multi-cmds on module classes

2024-04-29 Thread Jim Cromie
New fn tests multi-queries composed with % splitters. It uses both test_dynamic_debug and test_dynamic_debug_submod, and manipulates several classes at once. So despite the syntactic-oriented name, it also tests classmaps. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh

[PATCH v8 23/35] dyndbg: split multi-query strings with %

2024-04-29 Thread Jim Cromie
he '%' splits the input into 2 queries, and both fail. Given the limited utility of matching against the working parts of a format string "foo: %d bar %s", nothing is actually lost here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deleti

[PATCH v8 22/35] selftests-dyndbg: add comma_terminator_tests

2024-04-29 Thread Jim Cromie
New fn validates parsing and effect of queries using combinations of commas and spaces to delimit the tokens. It manipulates pr-debugs in builtin module/params, so might have deps I havent foreseen on odd configurations. Signed-off-by: Jim Cromie --- .../selftests/dynamic_debug

[PATCH v8 20/35] dyndbg-doc: add classmap info to howto

2024-04-29 Thread Jim Cromie
: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- v5 adjustments per Randy Dunlap v7 checkpatch fixes v8 more --- .../admin-guide/dynamic-debug-howto.rst | 63 ++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug

[PATCH v8 21/35] dyndbg: treat comma as a token separator

2024-04-29 Thread Jim Cromie
dynamic_debug dyndbg=class,D2_CORE,+p Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- lib/dynamic_debug.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 31fd67597928.

[PATCH v8 22/35] selftests-dyndbg: add comma_terminator_tests

2024-04-29 Thread Jim Cromie
New fn validates parsing and effect of queries using combinations of commas and spaces to delimit the tokens. It manipulates pr-debugs in builtin module/params, so might have deps I havent foreseen on odd configurations. Signed-off-by: Jim Cromie --- .../selftests/dynamic_debug

[PATCH v8 11/35] dyndbg: silence debugs with no-change updates

2024-04-29 Thread Jim Cromie
In ddebug_apply_class_bitmap(), check for actual changes to the bits before announcing them, to declutter logs. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH v8 13/35] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap

2024-04-29 Thread Jim Cromie
old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions

[PATCH v8 20/35] dyndbg-doc: add classmap info to howto

2024-04-29 Thread Jim Cromie
: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- v5 adjustments per Randy Dunlap v7 checkpatch fixes v8 more --- .../admin-guide/dynamic-debug-howto.rst | 63 ++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug

[PATCH v8 19/35] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API

2024-04-29 Thread Jim Cromie
. Signed-off-by: Jim Cromie --- fixup drm-print.h add PARAM_REF forwarding macros with DYNDBG_CLASSMAP_PARAM_REF in the API, add DRM_ variant --- include/linux/dynamic_debug.h | 37 - lib/dynamic_debug.c | 70 ++--- lib/test_dynamic_debug.c

[PATCH v8 18/35] selftests-dyndbg: exit 127 if no facility

2024-04-29 Thread Jim Cromie
ally), without dealing with the mount. Signed-off-by: Jim Cromie --- tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftes

[PATCH v8 14/35] dyndbg: reduce verbose=3 messages in ddebug_add_module

2024-04-29 Thread Jim Cromie
When modprobing a module, dyndbg currently logs/says "add-module", and then "skipping" if the module has no prdbgs. Instead just check 1st and return quietly. no functional change Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 7 +++ 1 file changed, 3 insert

[PATCH v8 09/35] dyndbg: drop NUM_TYPE_ARRAY

2024-04-29 Thread Jim Cromie
ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b53217e4b711

[PATCH v8 10/35] dyndbg: reduce verbose/debug clutter

2024-04-29 Thread Jim Cromie
" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op='+' flags=0x1 *flagsp=0x1 *maskp=0x dyndbg: no-match: func="" file="" module="" format="" lineno=0-0 class=... dyndbg: processed 1 queries, with 0 m

[PATCH v8 17/35] selftests-dyndbg: add tools/testing/selftests/dynamic_debug/*

2024-04-29 Thread Jim Cromie
ettings, added by modprobe, alter the counts of flag-matching patterns, breaking the tests' expectations. Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- MAINTAINERS | 1 + tools/testing/selftests/Makefile

[PATCH v8 08/35] dyndbg: split param_set_dyndbg_classes to _module & wrapper fns

2024-04-29 Thread Jim Cromie
-by: Jim Cromie --- lib/dynamic_debug.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a1fd2e9dbafb..4a48f830507f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -711,18 +711,9

[PATCH v8 15/35] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code

2024-04-29 Thread Jim Cromie
est-surface, simplify things. also rename enum class_map_type to enum ddebug_class_map_type. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 23 ++-- lib/dynamic_debug.c | 102 +++--- lib/test_dynamic_debug.c | 26 - 3 files chan

[PATCH v8 12/35] dyndbg: tighten ddebug_class_name() 1st arg type

2024-04-29 Thread Jim Cromie
Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH v8 16/35] dyndbg-API: fix DECLARE_DYNDBG_CLASSMAP

2024-04-29 Thread Jim Cromie
quot; >control queries. Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") Ref: bb2ff6c27bc9 ("drm: Disable dynamic debug as broken") Signed-off-by: Jim Cromie --- v8 - split drm parts to separate commits. preserve DECLARE_DYNDBG_CLASSMAP to decouple DRM, n

[PATCH v8 06/35] dyndbg: replace classmap list with a vector

2024-04-29 Thread Jim Cromie
o length. Also: Move #define __outvar up, above an added use in a fn-prototype. Simplify ddebug_attach_module_classes args, ref has both addy,len. no functional changes Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 - lib/dynamic_debug.c

[PATCH v8 04/35] dyndbg: reword "class unknown, " to "class:_UNKNOWN_"

2024-04-29 Thread Jim Cromie
uot; to loudly announce the erroneous situation, and to make it exceedingly greppable. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index f2c5e7910bb1..73ccf947d4aa 100644 --- a/lib/dy

[PATCH v8 05/35] dyndbg: make ddebug_class_param union members same size

2024-04-29 Thread Jim Cromie
struct ddebug_class_param keeps a ref to the state-storage of the param; make both class-types use the same unsigned long storage type. ISTM this is simpler and safer. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2

[PATCH v8 07/35] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it

2024-04-29 Thread Jim Cromie
change. Signed-off-by: Jim Cromie --- after `modprobe i915`, heres the module dependencies, though not all on drm.debug. bash-5.2# lsmod Module Size Used by i915 3133440 0 drm_buddy 20480 1 i915 ttm90112 1 i915 i2c_algo_bit

[PATCH v8 03/35] test-dyndbg: fixup CLASSMAP usage error

2024-04-29 Thread Jim Cromie
aps must set their base to share the 0-62 class_id space !! Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8dd250ad022b..a01f0193a419 100644 --- a/lib/test_dynam

[PATCH v8 02/35] docs/dyndbg: update examples \012 to \n

2024-04-29 Thread Jim Cromie
commit 47ea6f99d06e ("dyndbg: use ESCAPE_SPACE for cat control") changed the control-file to display format strings with "\n" rather than "\012". Update the docs to match the new reality. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-how

[PATCH v8 01/35] dyndbg: fix old BUG_ON in >control parser

2024-04-29 Thread Jim Cromie
Fix a BUG_ON from 2009. Even if it looks "unreachable" (I didn't really look), lets make sure by removing it, doing pr_err and return -EINVAL instead. cc: sta...@vger.kernel.org Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 6 +- 1 file changed, 5 insertions(+), 1 deletio

[PATCH v8 00/35] fix CONFIG_DRM_USE_DYNAMIC_DEBUG=y regression

2024-04-29 Thread Jim Cromie
besides a lot of logging work. sleep 15 is not the best stopwatch. recent spins thru lkp-test have also been SUCCESS-ful. Jim Cromie (35): old-bugs & cleanups: dyndbg: fix old BUG_ON in >control parser docs/dyndbg: update examples \012 to \n test-dyndbg: fixup CLASSMAP usage error

[PATCH v7d 23/23] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2023-10-31 Thread Jim Cromie
Lots of burn-in testing needed before signing, upstreaming. NOTE: I set default Y to maximize testing by default. Is there a better way to do this ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v7d 22/23] drm-drivers: DRM_CLASSMAP_USE in 2nd batch of drivers, helpers

2023-10-31 Thread Jim Cromie
found by choosing M for all DRM-config items I found (not allmodconfig), building & modprobing them, and grepping "class unknown," control. There may yet be others. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ drivers/gpu/drm/gud/gud_drv.c

[PATCH v7d 21/23] drm: use correct ccflags-y spelling

2023-10-31 Thread Jim Cromie
*_dbg in dyndbg descriptor factory macro") Signed-off-by: Jim Cromie --- drivers/gpu/drm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 215e78e79125..22b1984cc982 100644 --- a/drivers/gpu/drm/Makefile +++ b/d

[PATCH v7d 19/23] dyndbg: add _DPRINTK_FLAGS_INCL_LOOKUP

2023-10-31 Thread Jim Cromie
cts _DPRINTK_FLAGS_INCL_LOOKUP macro out of _DPRINTK_FLAGS_INCL_ANY macro, then redefs latter. Next re-refactor dynamic_emit_prefix inner/outer fns accordingly. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a

[PATCH v7d 20/23] dyndbg: refactor *dynamic_emit_prefix

2023-10-31 Thread Jim Cromie
ot;inline" from outer, let the compiler decide. Maybe also change name accordingly. Signed-off-by: Jim Cromie --- fixup whitespace --- lib/dynamic_debug.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/d

[PATCH v7d 18/23] dyndbg: reserve flag bit _DPRINTK_FLAGS_PREFIX_CACHED

2023-10-31 Thread Jim Cromie
another factor; the 3 columns in the __dyndbg section are highly redundant and compressible, but to get the compression, we need field accessors, which will rebalance the tradeoff. So, for now, its just the bit reservation. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 + 1 file

[PATCH v7d 15/23] dyndbg: refactor ddebug_classparam_clamp_input

2023-10-31 Thread Jim Cromie
ync_classbits(), to validate inputs from parent's params, just like our own. To support that reuse, alter ddebug_sync_classbits() and caller to pass kp instead of kp->arg. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 70 ++--- 1 file changed, 47 insertions(

[PATCH v7d 17/23] dyndbg-doc: add classmap info to howto

2023-10-31 Thread Jim Cromie
Add some basic info on classmap usage and api cc: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- v5- adjustments per Randy Dunlap, me v7b- checkpatch fixes --- .../admin-guide/dynamic-debug-howto.rst | 60 ++- 1 file changed, 59 insertions(+), 1 deletion(-) diff

[PATCH v7d 16/23] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API

2023-10-31 Thread Jim Cromie
. Signed-off-by: Jim Cromie --- --- drivers/gpu/drm/drm_print.c | 8 ++ include/drm/drm_print.h | 6 ++-- include/linux/dynamic_debug.h | 37 +++- lib/test_dynamic_debug.c| 50 + lib/test_dynamic_debug_submod.c | 9

[PATCH v7d 14/23] dyndbg-API: fix CONFIG_DRM_USE_DYNAMIC_DEBUG regression

2023-10-31 Thread Jim Cromie
;) Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Ref: commit bb2ff6c27bc9 ("drm: Disable dynamic debug as broken") Signed-off-by: Jim Cromie --- last submission-blocking bug: missing __align(8) in DYNAMIC_DEBUG_DECLARE_METADATA on ddebug_

[PATCH v7d 13/23] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code

2023-10-31 Thread Jim Cromie
ngs for now. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 19 ++- lib/dynamic_debug.c | 103 +++--- lib/test_dynamic_debug.c | 26 - 3 files changed, 12 insertions(+), 136 deletions(-) diff --git a/include/linux/dynamic_debu

[PATCH v7d 12/23] dyndbg: reduce verbose=3 messages in ddebug_add_module

2023-10-31 Thread Jim Cromie
The fn currently says "add-module", then "skipping" if the module has no prdbgs. Just check 1st and return quietly. no functional change Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/d

[PATCH v7d 09/23] dyndbg: silence debugs with no-change updates

2023-10-31 Thread Jim Cromie
check for actual changes before announcing them, declutter logs. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b0e11f6bfaa2..b07aab422604 100644 --- a/lib

[PATCH v7d 11/23] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap

2023-10-31 Thread Jim Cromie
old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions

[PATCH v7d 10/23] dyndbg: tighten ddebug_class_name() 1st arg type

2023-10-31 Thread Jim Cromie
Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH v7d 08/23] dyndbg: reduce verbose/debug clutter

2023-10-31 Thread Jim Cromie
rs That is excessive, so this patch: - shrinks 3 lines of 2nd stanza to single line - drops 1st 2 lines of 3rd stanza 3rd is like 1st, with result, not procedure. 2nd is just status, retold in 4th, with more info. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 14 +++--- 1 f

[PATCH v7d 07/23] dyndbg: drop NUM_TYPE_ARRAY

2023-10-31 Thread Jim Cromie
ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b53217e4b711

[PATCH v7d 06/23] dyndbg: split param_set_dyndbg_classes to module/wrapper fns

2023-10-31 Thread Jim Cromie
cope of changes made. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ba41fdeaaf98..b67c9b137447 100644 --- a

[PATCH v7d 05/23] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it

2023-10-31 Thread Jim Cromie
Add query_module param to ddebug_apply_class_bitmap(). This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie --- after `modprobe i915`, heres

[PATCH v7d 04/23] dyndbg: replace classmap list with a vector

2023-10-31 Thread Jim Cromie
ref has both addy,len. no functional changes Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 - lib/dynamic_debug.c | 61 ++- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/include/linux/dynamic_debug.h b/inclu

[PATCH v7d 02/23] dyndbg: reword "class unknown, " to "class:_UNKNOWN_"

2023-10-31 Thread Jim Cromie
few prdbg formats, so thats a suboptimal search term to find occurrences of the problem. Thus change it to "_UNKNOWN_" which properly shouts the condition. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/d

[PATCH v7d 03/23] dyndbg: make ddebug_class_param union members same size

2023-10-31 Thread Jim Cromie
struct ddebug_class_param keeps a ref to the state-storage of the param, make both flavors use the same unsigned long under-type. ISTM this is simpler and safer. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2

[PATCH v7d 01/23] test-dyndbg: fixup CLASSMAP usage error

2023-10-31 Thread Jim Cromie
cations, which created all the usage complications above. [1] name changes later to DYNDBG_CLASSMAP_DEFINE Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c

[PATCH v7d 00/23] fix DRM_USE_DYNAMIC_DEBUG=y regression

2023-10-31 Thread Jim Cromie
or drm_kms_helper [0.488743] dyndbg: attach-client-module: module:drm_kms_helper nd:93 nc:0 nu:1 [0.489742] dyndbg: 93 debug prints in module drm_kms_helper Id like to get this into linux-next, so widespread testing is appreciated. lkp-robot reported BUILD SUCCESS on it, Im running it on my amdgpu desk

[PATCH v7c 23/24] drm-drivers: DRM_CLASSMAP_USE in 2nd batch of drivers, helpers

2023-10-18 Thread Jim Cromie
found by choosing M for all DRM-config items I found (not allmodconfig), building & modprobing them, and grepping "class unknown," control. There may yet be others. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ drivers/gpu/drm/gud/gud_drv.c

[PATCH v7c 24/24] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2023-10-18 Thread Jim Cromie
Lots of burn-in testing needed before signing, upstreaming. NOTE: I set default Y to maximize testing by default. Is there a better way to do this ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v7c 20/24] dyndbg: refactor *dynamic_emit_prefix

2023-10-18 Thread Jim Cromie
ot;inline" from outer, let the compiler decide. Maybe also change name accordingly. Signed-off-by: Jim Cromie --- fixup whitespace --- lib/dynamic_debug.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/d

[PATCH v7c 18/24] dyndbg: reserve flag bit _DPRINTK_FLAGS_PREFIX_CACHED

2023-10-18 Thread Jim Cromie
another factor; the 3 columns in the __dyndbg section are highly redundant and compressible, but to get the compression, we need field accessors, which will rebalance the tradeoff. So, for now, its just the bit reservation. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 + 1 file

[PATCH v7c 22/24] drm: use correct ccflags-y spelling

2023-10-18 Thread Jim Cromie
*_dbg in dyndbg descriptor factory macro") Signed-off-by: Jim Cromie --- drivers/gpu/drm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 215e78e79125..22b1984cc982 100644 --- a/drivers/gpu/drm/Makefile +++ b/d

[PATCH v7c 21/24] dyndbg: change WARN_ON to WARN_ON_ONCE

2023-10-18 Thread Jim Cromie
- this is a module-load activity, so it won't continuously spam syslog. Signed-off-by: Jim Cromie --- undo BUG_ON addition --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 9db797a0cf82..213110ec1e9c 100644 --- a/lib

[PATCH v7c 13/24] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code

2023-10-18 Thread Jim Cromie
ngs for now. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 19 ++- lib/dynamic_debug.c | 103 +++--- lib/test_dynamic_debug.c | 26 - 3 files changed, 12 insertions(+), 136 deletions(-) diff --git a/include/linux/dynamic_debu

[PATCH v7c 19/24] dyndbg: add _DPRINTK_FLAGS_INCL_LOOKUP

2023-10-18 Thread Jim Cromie
cts _DPRINTK_FLAGS_INCL_LOOKUP macro out of _DPRINTK_FLAGS_INCL_ANY macro, then redefs latter. Next re-refactor dynamic_emit_prefix inner/outer fns accordingly. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a

[PATCH v7c 17/24] dyndbg-doc: add classmap info to howto

2023-10-18 Thread Jim Cromie
Add some basic info on classmap usage and api cc: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- v5- adjustments per Randy Dunlap, me v7b- checkpatch fixes --- .../admin-guide/dynamic-debug-howto.rst | 60 ++- 1 file changed, 59 insertions(+), 1 deletion(-) diff

[PATCH v7c 09/24] dyndbg: silence debugs with no-change updates

2023-10-18 Thread Jim Cromie
check for actual changes before announcing them, declutter logs. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b0e11f6bfaa2..b07aab422604 100644 --- a/lib

[PATCH v7c 16/24] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API

2023-10-18 Thread Jim Cromie
. Signed-off-by: Jim Cromie --- --- drivers/gpu/drm/drm_print.c | 8 ++ include/drm/drm_print.h | 6 ++-- include/linux/dynamic_debug.h | 37 +++- lib/test_dynamic_debug.c| 50 + lib/test_dynamic_debug_submod.c | 9

[PATCH v7c 14/24] dyndbg-API: fix CONFIG_DRM_USE_DYNAMIC_DEBUG regression

2023-10-18 Thread Jim Cromie
: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Ref: commit bb2ff6c27bc9 ("drm: Disable dynamic debug as broken") Signed-off-by: Jim Cromie --- fixup-kconfig description too short --- MAINTAINERS | 2 +- driv

[PATCH v7c 15/24] dyndbg: refactor ddebug_classparam_clamp_input

2023-10-18 Thread Jim Cromie
ync_classbits(), to validate inputs from parent's params, just like our own. To support that reuse, alter ddebug_sync_classbits() and caller to pass kp instead of kp->arg. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 70 ++--- 1 file changed, 47 insertions(

[PATCH v7c 08/24] dyndbg: reduce verbose/debug clutter

2023-10-18 Thread Jim Cromie
rs That is excessive, so this patch: - shrinks 3 lines of 2nd stanza to single line - drops 1st 2 lines of 3rd stanza 3rd is like 1st, with result, not procedure. 2nd is just status, retold in 4th, with more info. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 14 +++--- 1 f

[PATCH v7c 12/24] dyndbg: reduce verbose=3 messages in ddebug_add_module

2023-10-18 Thread Jim Cromie
The fn currently says "add-module", then "skipping" if the module has no prdbgs. Just check 1st and return quietly. no functional change Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/d

[PATCH v7c 11/24] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap

2023-10-18 Thread Jim Cromie
old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions

[PATCH v7c 10/24] dyndbg: tighten ddebug_class_name() 1st arg type

2023-10-18 Thread Jim Cromie
Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH v7c 07/24] dyndbg: drop NUM_TYPE_ARRAY

2023-10-18 Thread Jim Cromie
ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b53217e4b711

[PATCH v7c 05/24] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it

2023-10-18 Thread Jim Cromie
Add query_module param to ddebug_apply_class_bitmap(). This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie --- after `modprobe i915`, heres

[PATCH v7c 06/24] dyndbg: split param_set_dyndbg_classes to module/wrapper fns

2023-10-18 Thread Jim Cromie
cope of changes made. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ba41fdeaaf98..b67c9b137447 100644 --- a

[PATCH v7c 04/24] dyndbg: replace classmap list with a vector

2023-10-18 Thread Jim Cromie
ref has both addy,len. no functional changes Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 - lib/dynamic_debug.c | 61 ++- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/include/linux/dynamic_debug.h b/inclu

[PATCH v7c 02/24] dyndbg: reword "class unknown, " to "class:_UNKNOWN_"

2023-10-18 Thread Jim Cromie
few prdbg formats, so thats a suboptimal search term to find occurrences of the problem. Thus change it to "_UNKNOWN_" which properly shouts the condition. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/d

[PATCH v7c 03/24] dyndbg: make ddebug_class_param union members same size

2023-10-18 Thread Jim Cromie
struct ddebug_class_param keeps a ref to the state-storage of the param, make both flavors use the same unsigned long under-type. ISTM this is simpler and safer. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2

[PATCH v7c 01/24] test-dyndbg: fixup CLASSMAP usage error

2023-10-18 Thread Jim Cromie
cations, which created all the usage complications above. [1] name changes later to DYNDBG_CLASSMAP_DEFINE Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c

[PATCH v7c 00/24] fix DRM_USE_DYNAMIC_DEBUG=y regression

2023-10-18 Thread Jim Cromie
486742] dyndbg: bit_4: 44 matches on class: DRM_UT_ATOMIC -> 0x10 [0.487742] dyndbg: applied bitmap: 0x10 to: 0x0 for drm_kms_helper [0.488743] dyndbg: attach-client-module: module:drm_kms_helper nd:93 nc:0 nu:1 [0.489742] dyndbg: 93 debug prints in module drm_kms_helper Widespread testing is appre

Re: [PATCH v1] dynamic_debug: add support for logs destination

2023-10-17 Thread jim . cromie
adding in Jason, not sure how he got missed. On Mon, Oct 16, 2023 at 9:13 AM Łukasz Bartosik wrote: > > czw., 12 paź 2023 o 20:48 napisał(a): > > > > > If you want the kernel to keep separate flight recorders I guess we could > > > add that, but I don't think it currently exists for the dyndbg

Re: [PATCH v7b 00/25] fix DRM_USE_DYNAMIC_DEBUG=y regression

2023-10-14 Thread jim . cromie
On Fri, Oct 13, 2023 at 4:48 PM Jim Cromie wrote: > > hi Jason, DRM-folk > > (now with checkpatch fixes) I missed fixing boxed-vector, am just dropping it. > > This patchest fixes the chicken-egg initialization problem in the 1st > version of ddebug-class-maps,

[PATCH v7b 25/25] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2023-10-13 Thread Jim Cromie
Lots of burn-in testing needed before signing, upstreaming. NOTE: I set default Y to maximize testing by default. Is there a better way to do this ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v7b 20/25] dyndbg: add _DPRINTK_FLAGS_INCL_LOOKUP

2023-10-13 Thread Jim Cromie
cts _DPRINTK_FLAGS_INCL_LOOKUP macro out of _DPRINTK_FLAGS_INCL_ANY macro, then redefs latter. Next re-refactor dynamic_emit_prefix inner/outer fns accordingly. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a

[PATCH v7b 21/25] dyndbg: refactor *dynamic_emit_prefix

2023-10-13 Thread Jim Cromie
ot;inline" from outer, let the compiler decide. Maybe also change name accordingly. Signed-off-by: Jim Cromie --- fixup whitespace --- lib/dynamic_debug.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/d

[PATCH v7b 23/25] drm: use correct ccflags-y spelling

2023-10-13 Thread Jim Cromie
*_dbg in dyndbg descriptor factory macro") Signed-off-by: Jim Cromie --- drivers/gpu/drm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 215e78e79125..22b1984cc982 100644 --- a/drivers/gpu/drm/Makefile +++ b/d

[PATCH v7b 24/25] drm-drivers: DRM_CLASSMAP_USE in 2nd batch of drivers, helpers

2023-10-13 Thread Jim Cromie
found by choosing M for all DRM-config items I found (not allmodconfig), building & modprobing them, and grepping "class unknown," control. There may yet be others. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ drivers/gpu/drm/gud/gud_drv.c

[PATCH v7b 22/25] dyndbg: change WARN_ON to WARN_ON_ONCE

2023-10-13 Thread Jim Cromie
- this is a module-load activity, so it won't continuously spam syslog. Signed-off-by: Jim Cromie --- undo BUG_ON addition --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 5825b58043a6..2a5eb64dbc27 100644 --- a/lib

[PATCH v7b 19/25] dyndbg: reserve flag bit _DPRINTK_FLAGS_PREFIX_CACHED

2023-10-13 Thread Jim Cromie
another factor; the 3 columns in the __dyndbg section are highly redundant and compressible, but to get the compression, we need field accessors, which will rebalance the tradeoff. So, for now, its just the bit reservation. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 + 1 file

[PATCH v7b 18/25] dyndbg-doc: add classmap info to howto

2023-10-13 Thread Jim Cromie
Add some basic info on classmap usage and api cc: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- v5- adjustments per Randy Dunlap, me v7b- checkpatch fixes --- .../admin-guide/dynamic-debug-howto.rst | 60 ++- 1 file changed, 59 insertions(+), 1 deletion(-) diff

  1   2   3   4   5   6   7   8   9   >