[PATCH v6 22/57] drm_print: condense enum drm_debug_category

2022-09-04 Thread Jim Cromie
ts already strongly implied by the use of the enum itself; its not a normal enum if it can be 2 values simultaneously. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/drm/drm_print.h b/i

[PATCH v6 35/57] dyndbg: add _DPRINTK_FLAGS_TRACE

2022-09-04 Thread Jim Cromie
add new flag, and OR it into _DPRINTK_FLAGS_ENABLED definition CC: vincent.whitchu...@axis.com Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index

[PATCH v6 23/57] drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.

2022-09-04 Thread Jim Cromie
ch module's private class-map. No callsites are actually selected by this patch, since none are class'd yet. Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 + drivers/gpu/drm/display/drm_dp_helper.c | 13 drivers/gpu/drm/drm_crtc_

[PATCH v6 08/57] dyndbg: add test_dynamic_debug module

2022-09-04 Thread Jim Cromie
ameters/do_prints echo module test_dynamic_debug +mftl > /proc/dynamic_debug/control echo junk > /sys/module/test_dynamic_debug/parameters/do_prints Acked-by: Jason Baron Signed-off-by: Jim Cromie --- MAINTAINERS | 2 ++ lib/Kconfig.debug| 10 ++

[PATCH v6 29/57] drm_print: prefer bare printk KERN_DEBUG on generic fn

2022-09-04 Thread Jim Cromie
nhelpful at best, and possibly confusing. reverting yields a nominal data and text shrink: textdata bss dec hex filename 462583 36604 54592 553779 87333 /kernel/drivers/gpu/drm/drm.ko 462515 36532 54592 553639 872a7 -dirty/kernel/drivers/gpu/drm/drm.ko Signed-of

[PATCH v6 36/57] dyndbg: add write-events-to-tracefs code

2022-09-04 Thread Jim Cromie
...@axis.com/ with a few differences: - s/dynamic_/ddebug_/ on Vincent's additions - __printf attrs on the _printk funcs - reuses trace_console() event, not adding a new "printk:dyndbg" event. next patch replaces this with 2 new events CC: vincent.whitchu...@axis.com Signed-off-by:

[PATCH v6 20/57] dyndbg: add drm.debug style (drm/parameters/debug) bitmap support

2022-09-04 Thread Jim Cromie
s by 1. IOW, +L2 means L0,L1,L2, and -L2 means just L0,L1. This kinda spoils the readback fidelity, since the L0 bit gets turned on by any use of any L*, except "-L0". All the interface uncertainty here pertains to the _NAMES features. Nobody has actually asked for this, so its practi

[PATCH v6 09/57] dyndbg: drop EXPORTed dynamic_debug_exec_queries

2022-09-04 Thread Jim Cromie
("dyndbg: refine export, rename to dynamic_debug_exec_queries()") Fixes: 4c0d77828d4f ("dyndbg: export ddebug_exec_queries") Acked-by: Jason Baron Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 9 - lib/dynamic_debug.c | 29 --

[PATCH v6 19/57] doc-dyndbg: edit dynamic-debug-howto for brevity, audience

2022-09-04 Thread Jim Cromie
descriptions CC: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- fixup-doc: trailing colons for block headers, trim fedora numbers. Bagas --- .../admin-guide/dynamic-debug-howto.rst | 235 +- 1 file changed, 117 insertions(+), 118 deletions(-) diff --git a/Documentation/ad

[PATCH v6 12/57] dyndbg: add class_id to pr_debug callsites

2022-09-04 Thread Jim Cromie
e. cc: Rasmus Villemoes Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 71 +++ 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 6a2001250da1..633f4e463766 100644 --- a/i

[PATCH v6 26/57] drm-print.h: include dyndbg header

2022-09-04 Thread Jim Cromie
how lkp sorts it. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 2d2cef76b5c1..f8bb3e7158c6 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -31,6 +31

[PATCH v6 13/57] dyndbg: add __pr_debug_cls for testing

2022-09-04 Thread Jim Cromie
. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 633f4e463766..3c9690da44d9 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h

[PATCH v6 18/57] doc-dyndbg: describe "class CLASS_NAME" query support

2022-09-04 Thread Jim Cromie
Add an explanation of the new "class CLASS_NAME" syntax and meaning, noting that the module determines if CLASS_NAME applies to it. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Doc

[PATCH v6 17/57] dyndbg: validate class FOO by checking with module

2022-09-04 Thread Jim Cromie
d_class = _CLASS_DFLT. This insures that legacy queries do not trample on new class'd callsites, as they get added. Also add a new column to control-file output, displaying non-default class-name (when found) or the "unknown _id:", if it has not been (correctly) declared with one of the

[PATCH v6 11/57] dyndbg: gather __dyndbg[] state into struct _ddebug_info

2022-09-04 Thread Jim Cromie
for struct _ddeubg_info. This might be prone to include loops, since its also included by printk.h. Nothing has broken in robot-land on this. cc: Luis Chamberlain Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 13 +++- kernel/module/internal.h | 4 ++-- kernel/module

[PATCH v6 16/57] dyndbg: add ddebug_attach_module_classes

2022-09-04 Thread Jim Cromie
dozen pointers to save. TODO: re-evaluate for lines removable. Signed-off-by: Jim Cromie --- v6 . fix compile err due to reorderd commits, and missed lkp report. . init dt->maps in ddebug_add_module, prior to ddebug_attach_module_classes --- lib/dynamic_debug.c |

[PATCH v6 14/57] dyndbg: add DECLARE_DYNDBG_CLASSMAP macro

2022-09-04 Thread Jim Cromie
(and ignores L1), and +L2 would turn on L<=2 (and ignore others). Signed-off-by: Jim Cromie --- . revised DD_CLASS_TYPE_{DISJOINT,LEVEL}_* names . reorder-enum - _NAMES feature is extra. --- include/linux/dynamic_debug.h | 55 +++ 1 file changed, 55 i

[PATCH v6 02/57] dyndbg: fix module.dyndbg handling

2022-09-04 Thread Jim Cromie
ith strcmp for exact param-name match. Reported-by: Rasmus Villemoes Fixes: b48420c1d301 dynamic_debug: make dynamic-debug work for module initialization Acked-by: Jason Baron Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v6 06/57] dyndbg: use ESCAPE_SPACE for cat control

2022-09-04 Thread Jim Cromie
run_init_process =_ " with environment:\n" init/main.c:1429 [main]run_init_process =_ "%s\n" Acked-by: Jason Baron 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_

[PATCH v6 03/57] dyndbg: show both old and new in change-info

2022-09-04 Thread Jim Cromie
print "old => new" flag values to the info("change") message. no functional change. Acked-by: Jason Baron Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/li

[PATCH v6 05/57] dyndbg: reverse module.callsite walk in cat control

2022-09-04 Thread Jim Cromie
run_init_process =_ "%s\012" Acked-by: Jason Baron Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 7fb99492c16f..8ff11977b8bd 100644 --- a/lib/dynami

[PATCH v6 10/57] dyndbg: cleanup auto vars in dynamic_debug_init

2022-09-04 Thread Jim Cromie
1st step towards 'demotion' of iter->site, for removal later treat vars as iters: - drop init at top init just above for-loop, in a textual block Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 33 + 1 file changed, 17 insertions(+), 16 deleti

[PATCH v6 04/57] dyndbg: reverse module walk in cat control

2022-09-04 Thread Jim Cromie
/proc/dynamic_debug/control walks the prdbg catalog in "reverse", fix this by adding new ddebug_tables to tail of list. This puts init/main.c entries 1st, which looks more than coincidental. no functional changes. Acked-by: Jason Baron Signed-off-by: Jim Cromie --- lib/dynamic_d

[PATCH v6 01/57] dyndbg: fix static_branch manipulation

2022-09-04 Thread Jim Cromie
roc/dynamic_debug/control done; # A B ~B ~A for flg in +T +p "-p #broke here" -T; do echo " $site $flg " > /proc/dynamic_debug/control done } pt_test Fixes: 84da83a6ffc0 dyndbg: combine flags & mask into a struct, simplify with it CC: vincent.whitchu...@

[PATCH v6 00/57] DYNDBG: opt-in class'd debug for modules, use in drm.

2022-09-04 Thread Jim Cromie
> /sys/module/drm/parameters/debug_categories # LEVEL_NAMES echo NV_TRACE > /sys/module/nouveau/parameters/debug-mumble* That design choice is allowed cuz verbosity is always attached to a (user visible) interface, and theres no reason not to put the implementation there (in the callback). It

[PATCH v5 28/33] drm_print: refine drm_debug_enabled for jump-label

2022-08-05 Thread Jim Cromie
tified ~10 remaining callers of the function, leading to the follow-on cleanup patch, and would allow activating the pr_debugs, estimating the callrate, and the potential savings by using the wrapper macro. It is unused ATM, but it fills out the picture. Signed-off-by: Jim Cromie --- drivers/gpu/drm/d

[PATCH v5 14/33] dyndbg: add DECLARE_DYNDBG_CLASSMAP macro

2022-08-05 Thread Jim Cromie
L<=2 (and ignore others). Signed-off-by: Jim Cromie --- . revised DD_CLASS_TYPE_{DISJOINT,LEVEL}_* names . reorder-enum by necessity - _NAMES feature is extra. --- include/linux/dynamic_debug.h | 56 +++ 1 file changed, 56 insertions(+) diff --git a/inclu

[PATCH v5 29/33] drm_print: prefer bare printk KERN_DEBUG on generic fn

2022-08-05 Thread Jim Cromie
nhelpful at best, and possibly confusing. reverting yields a nominal data and text shrink: textdata bss dec hex filename 462583 36604 54592 553779 87333 /kernel/drivers/gpu/drm/drm.ko 462515 36532 54592 553639 872a7 -dirty/kernel/drivers/gpu/drm/drm.ko Signed-of

[PATCH v5 13/33] dyndbg: add __pr_debug_cls for testing

2022-08-05 Thread Jim Cromie
. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b6803f7e818f..cb4696c91901 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h

[PATCH v5 25/33] drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro

2022-08-05 Thread Jim Cromie
amic_debug/control CONFIG_DRM_USE_DYNAMIC_DEBUG=y/n is configurable because of the .data footprint cost of per-callsite control; 56 bytes/site * ~2k for i915, ~4k callsites for amdgpu. This is large enough that a kernel builder might not want it. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kco

[PATCH v5 33/33] nouveau: WIP add 2 LEVEL_NUM classmaps for CLI, SUBDEV

2022-08-05 Thread Jim Cromie
dule:nouveau attached 3 classes [ 966.353759] dyndbg: 119 debug prints in module nouveau NOTE: it was 632 with previous commit, switching NV_DEBUG to use NV_SUBDEV_DBG_DEBUG instead of NV_DBG_DEBUG may be the cause. Signed-off-by: Jim Cromie --- .../gpu/drm/nouveau/include/nvkm/co

[PATCH v5 32/33] nouveau: adapt NV_DEBUG, NV_ATOMIC to use DRM.debug

2022-08-05 Thread Jim Cromie
to existing uses of drm_dbg_kms(). Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/nouveau_drv.h | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index b2a970aa9bf4..f266cd6

[PATCH v5 27/33] drm-print: add drm_dbg_driver to improve namespace symmetry

2022-08-05 Thread Jim Cromie
with nouveau, which uses its own stack of macros to construct calls to dev_info, dev_dbg, etc, for which adaptation means drm_dbg_##driver constructs. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b

[PATCH v5 18/33] doc-dyndbg: describe "class CLASS_NAME" query support

2022-08-05 Thread Jim Cromie
Add an explanation of the new "class CLASS_NAME" syntax and meaning, noting that the module determines if CLASS_NAME applies to it. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Doc

[PATCH v5 31/33] nouveau: change nvkm_debug/trace to use dev_dbg POC

2022-08-05 Thread Jim Cromie
ndependent, including choice of DISJOINT or LEVELS, as long as class-names don't conflict. So theres some flexibility. Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/include

[PATCH v5 23/33] drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.

2022-08-05 Thread Jim Cromie
ch module's private class-map. No callsites are actually selected by this patch, since none are class'd yet. Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 + drivers/gpu/drm/display/drm_dp_helper.c | 13 drivers/gpu/drm/drm_crtc_

[PATCH v5 30/33] drm_print: add _ddebug descriptor to drm_*dbg prototypes

2022-08-05 Thread Jim Cromie
. For CONFIG_DRM_USE_DYNAMIC_DEBUG=N, just pass null. Note: desc->class_id is redundant with category parameter, but its availability is dependent on desc. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 8 +--- include/drm/drm_print.h | 23 --- 2 files chan

[PATCH v5 17/33] dyndbg: validate class FOO by checking with module

2022-08-05 Thread Jim Cromie
d_class = _CLASS_DFLT. This insures that legacy queries do not trample on new class'd callsites, as they get added. Also add a new column to control-file output, displaying non-default class-name (when found) or the "unknown _id:", if it has not been (correctly) declared with one of the

[PATCH v5 24/33] drm_print: interpose drm_*dbg with forwarding macros

2022-08-05 Thread Jim Cromie
veau Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 10 +- include/drm/drm_print.h | 9 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index ec32df35a3e3..29a29949ad0b 100644 --- a/drivers

[PATCH v5 21/33] dyndbg: test DECLARE_DYNDBG_CLASSMAP, sysfs nodes

2022-08-05 Thread Jim Cromie
t_0: -22 matches on class: D2_CORE -> 0x1 [ 28.801959] dyndbg: test_dynamic_debug.T_D2: updated 0x0 -> 0x1 [ 28.803974] dyndbg: total matches: -22 Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 125 ++- 1 file changed, 110 insertions(+),

[PATCH v5 15/33] kernel/module: add __dyndbg_classes section

2022-08-05 Thread Jim Cromie
(): - It currently builds a debug_table, and *will* find and attach classes. dynamic_debug_init(): - add class fields to the _ddebug_info cursor var: di. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 3 +++ include/linux/dynamic_debug.h | 2 ++ kernel/module/main.c

[PATCH v5 12/33] dyndbg: add class_id to pr_debug callsites

2022-08-05 Thread Jim Cromie
e. cc: Rasmus Villemoes Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 71 +++ 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 6a2001250da1..b6803f7e818f 100644 --- a/i

[PATCH v5 26/33] drm-print.h: include dyndbg header

2022-08-05 Thread Jim Cromie
how lkp sorts it. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 2d2cef76b5c1..f8bb3e7158c6 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -31,6 +31

[PATCH v5 16/33] dyndbg: add ddebug_attach_module_classes

2022-08-05 Thread Jim Cromie
dozen pointers to save. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 0d6cb6b258bd..a3ace5866f1b 100644 --- a/lib/dynamic_debug.c +++ b/lib

[PATCH v5 11/33] dyndbg: create and use struct _ddebug_info

2022-08-05 Thread Jim Cromie
Luis Chamberlain Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 13 +++- kernel/module/internal.h | 4 ++-- kernel/module/main.c | 18 lib/dynamic_debug.c | 40 +++ 4 files changed, 50 insertions(+)

[PATCH v5 22/33] drm_print: condense enum drm_debug_category

2022-08-05 Thread Jim Cromie
ts already strongly implied by the use of the enum itself; its not a normal enum if it can be 2 values simultaneously. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/drm/drm_print.h b/i

[PATCH v5 20/33] dyndbg: add drm.debug style (drm/parameters/debug) bitmap support

2022-08-05 Thread Jim Cromie
,L1,L2, and -L2 means just L0,L1. This kinda spoils the readback fidelity, since the L0 bit gets turned on by any use of any L*, except "-L0". All the interface uncertainty here pertains to the _NAMES features. Nobody has actually asked for this, so its practi

[PATCH v5 08/33] dyndbg: add test_dynamic_debug module

2022-08-05 Thread Jim Cromie
ameters/do_prints echo module test_dynamic_debug +mftl > /proc/dynamic_debug/control echo junk > /sys/module/test_dynamic_debug/parameters/do_prints Signed-off-by: Jim Cromie Acked-by: Jason Baron --- MAINTAINERS | 2 ++ lib/Kconfig.debug| 10 ++

[PATCH v5 19/33] doc-dyndbg: edit dynamic-debug-howto for brevity, audience

2022-08-05 Thread Jim Cromie
descriptions CC: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- fixup-doc: trailing colons for block headers, trim fedora numbers. Bagas --- .../admin-guide/dynamic-debug-howto.rst | 235 +- 1 file changed, 117 insertions(+), 118 deletions(-) diff --git a/Documentation/ad

[PATCH v5 10/33] dyndbg: cleanup local vars in ddebug_init

2022-08-05 Thread Jim Cromie
this allows 'demotion' of iter->site (for removal later) treat vars as iters: - drop init at top init just above for-loop, in a textual block Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) d

[PATCH v5 07/33] dyndbg: let query-modname override actual module name

2022-08-05 Thread Jim Cromie
only when/after the query-string omitted the module. NB: the query class FOO handling is forthcoming. Fixes: 8e59b5cfb9a6 dynamic_debug: add modname arg to exec_query callchain Signed-off-by: Jim Cromie Acked-by: Jason Baron --- lib/dynamic_debug.c | 11 +++ 1 file changed, 7 inserti

[PATCH v5 06/33] dyndbg: use ESCAPE_SPACE for cat control

2022-08-05 Thread Jim Cromie
run_init_process =_ " with environment:\n" init/main.c:1429 [main]run_init_process =_ "%s\n" Signed-off-by: Jim Cromie Acked-by: Jason Baron --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_

[PATCH v5 09/33] dyndbg: drop EXPORTed dynamic_debug_exec_queries

2022-08-05 Thread Jim Cromie
("dyndbg: refine export, rename to dynamic_debug_exec_queries()") Fixes: 4c0d77828d4f ("dyndbg: export ddebug_exec_queries") Signed-off-by: Jim Cromie Acked-by: Jason Baron --- include/linux/dynamic_debug.h | 9 - lib/dynamic_debug.c | 29 --

[PATCH v5 05/33] dyndbg: reverse module.callsite walk in cat control

2022-08-05 Thread Jim Cromie
klisted =_ "initcall %s blacklisted\012" init/main.c:1424 [main]run_init_process =_ " with arguments:\012" init/main.c:1426 [main]run_init_process =_ "%s\012" init/main.c:1427 [main]run_init_process =_ " with environment:\012" init/main.c:1429 [main]run

[PATCH v5 02/33] dyndbg: fix module.dyndbg handling

2022-08-05 Thread Jim Cromie
ith strcmp for exact param-name match. Reported-by: Rasmus Villemoes Fixes: b48420c1d301 dynamic_debug: make dynamic-debug work for module initialization Signed-off-by: Jim Cromie Acked-by: Jason Baron --- include/linux/dynamic_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v5 04/33] dyndbg: reverse module walk in cat control

2022-08-05 Thread Jim Cromie
/proc/dynamic_debug/control walks the prdbg catalog in "reverse", fix this by adding new ddebug_tables to tail of list. This puts init/main.c entries 1st, which looks more than coincidental. no functional changes. Signed-off-by: Jim Cromie Acked-by: Jason Baron --- lib/dynamic_d

[PATCH v5 01/33] dyndbg: fix static_branch manipulation

2022-08-05 Thread Jim Cromie
roc/dynamic_debug/control done; # A B ~B ~A for flg in +T +p "-p #broke here" -T; do echo " $site $flg " > /proc/dynamic_debug/control done } pt_test Fixes: 84da83a6ffc0 dyndbg: combine flags & mask into a struct, simplify with it CC: vincent.whitchu...@

[PATCH v5 03/33] dyndbg: show both old and new in change-info

2022-08-05 Thread Jim Cromie
print "old => new" flag values to the info("change") message. no functional change. Signed-off-by: Jim Cromie Acked-by: Jason Baron --- lib/dynamic_debug.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/li

[PATCH v5 00/33] DYNDBG: opt-in class'd debug for modules, use in drm.

2022-08-05 Thread Jim Cromie
DRM_UT_VBL DRM_UT_STATE DRM_UT_LEASE DRM_UT_DP \ DRM_UT_DRMRES; do echo -n doing class $cls +/- $flgs " " echo doing class $cls +$flgs > /sys/kernel/tracing/trace_marker sleep .1 flags_class +$flgs $c

Re: [PATCH v4 00/41] DYNDBG: opt-in class'd debug for modules, use in drm.

2022-08-03 Thread jim . cromie
On Wed, Jul 20, 2022 at 9:32 AM Jim Cromie wrote: > > Hi Jason, Greg, DRM-folk, > > This adds 'typed' "class FOO" support to dynamic-debug, where 'typed' > means either DISJOINT (like drm debug categories), or VERBOSE (like > nouveau debug-levels). Use it i

Re: [PATCH v4 16/41] dyndbg: add drm.debug style bitmap support

2022-07-28 Thread jim . cromie
On Fri, Jul 22, 2022 at 2:33 PM Jason Baron wrote: > > > > On 7/20/22 11:32, Jim Cromie wrote: > > Add kernel_param_ops and callbacks to apply a class-map to a > > sysfs-node, which then can control classes defined in that class-map. > > This supports uses like: &g

Re: [PATCH v4 12/41] dyndbg: add DECLARE_DYNDBG_CLASSMAP

2022-07-22 Thread jim . cromie
On Fri, Jul 22, 2022 at 2:23 PM Jason Baron wrote: > > > > On 7/20/22 11:32, Jim Cromie wrote: > > DECLARE_DYNDBG_CLASSMAP lets modules declare a set of classnames, this > > opt-in authorizes dyndbg to allow enabling of prdbgs by their class: > > > >

Re: [drm] 39dec70a06: leaking-addresses.proc._dyndbg_classes.

2022-07-21 Thread jim . cromie
On Wed, Jul 20, 2022 at 7:05 PM kernel test robot wrote: > > > Greeting, > > FYI, we noticed the following commit (built with gcc-11): > > commit: 39dec70a061e581e60adb416031948ecd2dcd5d0 ("drm: POC drm on dyndbg > - use in core, 2 helpers, 3 drivers.") > https://github.com/jimc/linux.git

[PATCH v4 31/41] dyndbg: add _DPRINTK_FLAGS_ENABLED

2022-07-20 Thread Jim Cromie
_DPRINTK_FLAGS_PRINTK, in order to break any stale uses. CC: vincent.whitchu...@axis.com Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 10 ++ lib/dynamic_debug.c | 8 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/linux/dynamic_debug.h b

[PATCH v4 34/41] dyndbg: add 2 trace-events: drm_{,dev}debug

2022-07-20 Thread Jim Cromie
done only in TP_printk, to save work while writing to the ring-buffer. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 25 - include/trace/events/drm.h | 54 + 2 files changed, 72 insertions(+), 7 deletions(-) create mode 100644 i

[PATCH v4 28/41] drm_print: add _ddebug descriptor to drm_*dbg prototypes

2022-07-20 Thread Jim Cromie
. For CONFIG_DRM_USE_DYNAMIC_DEBUG=N, just pass null. Note: desc->class_id is redundant with category parameter, but its availability is dependent on desc. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 8 +--- include/drm/drm_print.h | 23 --- 2 files chan

[PATCH v4 33/41] dyndbg: add write-events-to-tracefs code

2022-07-20 Thread Jim Cromie
onsole() event, not adding a new "printk:dyndbg" event. later patches differentiate to new events. - a flags arg remains unchanged, adapt later to *descriptor. CC: vincent.whitchu...@axis.com Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 5 +- lib

[PATCH v4 32/41] dyndbg: add _DPRINTK_FLAGS_TRACE

2022-07-20 Thread Jim Cromie
add new flag, and OR it into _DPRINTK_FLAGS_ENABLED definition CC: vincent.whitchu...@axis.com Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index

[PATCH v4 36/41] dyndbg/drm: POC add tracebits sysfs-knob

2022-07-20 Thread Jim Cromie
and is why structs classmap and bitmap-param are separate. 2- add a 2nd struct ddebug_classes_bitmap_param refs 1, reusing it. flags = "T", to enable trace-events on this callsite. 3- module_param_cb([2]) - does the sysfs part Signed-off-by: Jim Cromie --- drivers/gpu/drm/d

[PATCH v4 26/41] drm_print: refine drm_debug_enabled for jump-label

2022-07-20 Thread Jim Cromie
tified ~10 remaining callers of the function, leading to the follow-on cleanup patch, and would allow activating the pr_debugs, estimating the callrate, and the potential savings by using the wrapper macro. It is unused ATM, but it fills out the picture. Signed-off-by: Jim Cromie --- drivers/gpu/drm/d

[PATCH v4 27/41] drm_print: prefer bare printk KERN_DEBUG on generic fn

2022-07-20 Thread Jim Cromie
nhelpful at best, and possibly confusing. reverting yields a nominal data and text shrink: textdata bss dec hex filename 462583 36604 54592 553779 87333 /kernel/drivers/gpu/drm/drm.ko 462515 36532 54592 553639 872a7 -dirty/kernel/drivers/gpu/drm/drm.ko Signed-of

[PATCH v4 38/41] nouveau-dyndbg: alter DEBUG, TRACE, SPAM levels to use dyndbg

2022-07-20 Thread Jim Cromie
lcomed. no functional changes. (other than dyndbg's default-off) Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h b/drivers/gpu

[PATCH v4 39/41] nouveau-dbg: add 2 verbose-classmaps for CLI, SUBDEV

2022-07-20 Thread Jim Cromie
it was 632 with previous commit, switching NV_DEBUG to use NV_SUBDEV_DBG_DEBUG instead of NV_DBG_DEBUG is the cause. Signed-off-by: Jim Cromie --- .../gpu/drm/nouveau/include/nvkm/core/debug.h| 16 .../gpu/drm/nouveau/include/nvkm/core/subdev.h | 3 ++- drivers/gpu/drm/nouveau/nouvea

[PATCH v4 22/41] drm_print: interpose drm_*dbg with forwarding macros

2022-07-20 Thread Jim Cromie
veau Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 10 +- include/drm/drm_print.h | 9 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 44be95fac164..21b416af0be2 100644 --- a/drivers

[PATCH v4 37/41] nouveau: adapt NV_DEBUG, NV_ATOMIC to use DRM.debug

2022-07-20 Thread Jim Cromie
to existing uses of drm_dbg_kms(). Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/nouveau_drv.h | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index b2a970aa9bf4..f266cd6

[PATCH v4 40/41] nouveau-dbg: fixup lost prdbgs

2022-07-20 Thread Jim Cromie
SE_DYNAMIC_DEBUG=y. So this is a useful place to stop and take another look around, try to guess which trail to take.. Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau

[PATCH v4 41/41] nouveau-dyndbg: wip subdev refine, breaks on use

2022-07-20 Thread Jim Cromie
that dyndbg can observe the underlying debug value, and make enable/disable decisions based upon it. But Im not getting the ctor called, so the ptr is NULL when refd. Signed-off-by: Jim Cromie --- .../drm/nouveau/include/nvkm/core/subdev.h| 2 +- drivers/gpu/drm/nouveau/nouveau_drm.c

[PATCH v4 25/41] drm-print: include dyndbg header indirectly

2022-07-20 Thread Jim Cromie
=0x%lx, auth=%d, %s\n", Since that macro is defined in drm_print.h, include there too, so that any uses have the definitions of all the macros in the callchain. This is done as a separate patch mostly to see how lkp sorts it; I'll probably squash it with HEAD~1 Signed-off-by: Jim Cromie --- i

[PATCH v4 05/41] dyndbg: reverse module.callsite walk in cat control

2022-07-20 Thread Jim Cromie
klisted =_ "initcall %s blacklisted\012" init/main.c:1424 [main]run_init_process =_ " with arguments:\012" init/main.c:1426 [main]run_init_process =_ "%s\012" init/main.c:1427 [main]run_init_process =_ " with environment:\012" init/main.c:1429 [m

[PATCH v4 30/41] tracing/events: Add __vstring() and __assign_vstr() helper macros

2022-07-20 Thread Jim Cromie
ven Eckelmann Cc: Johannes Berg Cc: Jim Cromie Signed-off-by: Steven Rostedt (Google) --- include/linux/trace_events.h | 18 ++ include/trace/stages/stage1_struct_define.h | 3 +++ include/trace/stages/stage2_data_offsets.h | 3 +++ include/trace/stages/stage

[PATCH v4 18/41] doc-dyndbg: describe "class CLASS_NAME" query support

2022-07-20 Thread Jim Cromie
Add an explanation of the new "class CLASS_NAME" syntax and meaning, noting that the module determines if CLASS_NAME applies to it. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Doc

[PATCH v4 16/41] dyndbg: add drm.debug style bitmap support

2022-07-20 Thread Jim Cromie
echo class V3 +p > control echo class V1 -p > control IMO thats ok, relative verbosity is an interface property. Signed-off-by: Jim Cromie --- . drop kp->mod->name as unneeded (build-dependent) --- include/linux/dynamic_debug.h | 18 lib/dynamic_debug.c | 193 +

[PATCH v4 29/41] nouveau: change nvkm_debug/trace to use dev_dbg POC

2022-07-20 Thread Jim Cromie
ndependent, including choice of DISJOINT or LEVELS, as long as class-names don't conflict. So theres some flexibility. Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/include

[PATCH v4 24/41] drm-print: add drm_dbg_driver to improve namespace symmetry

2022-07-20 Thread Jim Cromie
with nouveau, which uses its own stack of macros to construct calls to dev_info, dev_dbg, etc, for which adaptation means drm_dbg_##driver constructs. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b

[PATCH v4 35/41] dyndbg: add 2 more trace-events: pr_debug, dev_dbg

2022-07-20 Thread Jim Cromie
is true, issues a trace_devdbg(), otherwise trace_prdbg(). This way we don't consume buffer space storing nulls. Otherwise the events are equivalent. Signed-off-by: Jim Cromie --- include/trace/events/dyndbg.h | 74 +++ lib/dynamic_debug.c | 73

[PATCH v4 17/41] dyndbg: test DECLARE_DYNDBG_CLASSMAP, sysfs nodes

2022-07-20 Thread Jim Cromie
E -> 0x1 [ 28.801959] dyndbg: test_dynamic_debug.T_D2: updated 0x0 -> 0x1 [ 28.803974] dyndbg: total matches: -22 Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 125 ++- 1 file changed, 110 insertions(+), 15 deletions(-) diff --git a/lib/test_

[PATCH v4 11/41] dyndbg: add __pr_debug_cls for testing

2022-07-20 Thread Jim Cromie
, at least until a need emerges. ISTM the drm.debug model (macro wrappers inserting enum const 1st arg) is the baseline approach. NB: it does require a builtin-constant class, no __pr_debug_cls(i"",...) Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 7 +++ 1 file

[PATCH v4 07/41] dyndbg: let query-modname override actual module name

2022-07-20 Thread Jim Cromie
only when/after the query-string omitted the module. NB: the query class FOO handling is forthcoming. Fixes: 8e59b5cfb9a6 dynamic_debug: add modname arg to exec_query callchain Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-)

[PATCH v4 14/41] dyndbg: add ddebug_attach_module_classes

2022-07-20 Thread Jim Cromie
dozen pointers to save. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b6d80ba25bf5..e29730686cfb 100644 --- a/lib/dynamic_debug.c +++ b/lib

[PATCH v4 10/41] dyndbg: add class_id to pr_debug callsites

2022-07-20 Thread Jim Cromie
Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 71 +++ 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 8d9eec5f6d8b..d1429812be2e 100644 --- a/include/linux/dynamic_d

[PATCH v4 23/41] drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro

2022-07-20 Thread Jim Cromie
amic_debug/control CONFIG_DRM_USE_DYNAMIC_DEBUG=y/n is configurable because of the .data footprint cost of per-callsite control; 56 bytes/site * ~2k for i915, ~4k callsites for amdgpu. This is large enough that a kernel builder might not want it. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kco

[PATCH v4 21/41] drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.

2022-07-20 Thread Jim Cromie
e none are class'd yet. change __drm_debug from int to long, so BIT() is usable on it. Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 + drivers/gpu/drm/display/drm_dp_helper.c | 13 drivers/gpu/drm/drm_crtc_helper.c | 13 drivers/g

[PATCH v4 08/41] dyndbg: add test_dynamic_debug module

2022-07-20 Thread Jim Cromie
ameters/do_prints echo module test_dynamic_debug +mftl > /proc/dynamic_debug/control echo junk > /sys/module/test_dynamic_debug/parameters/do_prints Signed-off-by: Jim Cromie --- MAINTAINERS | 2 ++ lib/Kconfig.debug| 10 ++ lib/Makefile

[PATCH v4 15/41] dyndbg: validate class FOO by checking with module

2022-07-20 Thread Jim Cromie
d_class = _CLASS_DFLT. This insures that legacy queries do not trample on new class'd callsites, as they get added. Also add a new column to control-file output, displaying non-default class-name (when found) or the "unknown _id:", if it has not been (correctly) declared with one of the

[PATCH v4 20/41] drm_print: condense enum drm_debug_category

2022-07-20 Thread Jim Cromie
ts already strongly implied by the use of the enum itself; its not a normal enum if it can be 2 values simultaneously. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/drm/drm_print.h b/i

[PATCH v4 19/41] doc-dyndbg: edit dynamic-debug-howto for brevity, audience

2022-07-20 Thread Jim Cromie
nux-...@vger.kernel.org Signed-off-by: Jim Cromie --- fixup-doc: trailing colons for block headers, trim fedora numbers. Bagas --- .../admin-guide/dynamic-debug-howto.rst | 235 +- 1 file changed, 117 insertions(+), 118 deletions(-) diff --git a/Documentation/admin-guide/dyn

[PATCH v4 12/41] dyndbg: add DECLARE_DYNDBG_CLASSMAP

2022-07-20 Thread Jim Cromie
ys/module/test_dynamic_debug/p_VX IOW, half relations are suggested by the +/-, and enum control of individual behaviors leaves some room for this, especially wrt handling [+-]SYMBOLIC inputs from the user. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 55 +++

[PATCH v4 13/41] kernel/module: add __dyndbg_classes section

2022-07-20 Thread Jim Cromie
and attach classes. dynamic_debug_init(): compute num_classes from linker symbols, and add new _start, num_classes params to ddebug_add_module() calls. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 3 +++ include/linux/dynamic_debug.h | 9 ++--- kernel/module/internal.h

[PATCH v4 09/41] dyndbg: drop EXPORTed dynamic_debug_exec_queries

2022-07-20 Thread Jim Cromie
("dyndbg: refine export, rename to dynamic_debug_exec_queries()") Fixes: 4c0d77828d4f ("dyndbg: export ddebug_exec_queries") Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 9 - lib/dynamic_debug.c | 29 - 2 files c

[PATCH v4 06/41] dyndbg: use ESCAPE_SPACE for cat control

2022-07-20 Thread Jim Cromie
run_init_process =_ " with environment:\n" init/main.c:1429 [main]run_init_process =_ "%s\n" 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 8f

<    1   2   3   4   5   6   7   8   9   >