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

2022-08-05 Thread Jim Cromie
identified ~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/

Re: [Intel-gfx] [PATCH v9 10/10] drm: use DEFINE_DYNAMIC_DEBUG_TRACE_CATEGORIES bitmap to tracefs

2021-11-03 Thread jim . cromie
On Wed, Nov 3, 2021 at 9:58 AM Jason Baron wrote: > > > > On 10/27/21 12:36 AM, Jim Cromie wrote: > > Use new macro to create a sysfs control bitmap knob to control > > print-to-trace in: /sys/module/drm/parameters/trace > > > > todo: reconsider this api, ie

[Intel-gfx] [PATCH v10 00/10] use DYNAMIC_DEBUG to implement DRM.debug & DRM.trace

2021-11-05 Thread Jim Cromie
wrt drm.trace knob 2 separate macros: DEFINE_DYNAMIC_DEBUG_{LOG,TRACE}_GROUPS - JBaron v9: https://patchwork.freedesktop.org/series/96327/ v8: https://patchwork.freedesktop.org/series/93914/ https://lore.kernel.org/lkml/20210915163957.2949166-1-jim.cro...@gmail.com/ The major change since v

[Intel-gfx] [PATCH v10 01/10] dyndbg: add DEFINE_DYNAMIC_DEBUG_BITGRPS macro and callbacks

2021-11-05 Thread Jim Cromie
ifferent - "drm:kms"also different - includes drm:kms2: - "drm:kms:\t" also different - could be troublesome - "drm:kms:*" doesn't work, no wildcard on format atm. Order matters in DEFINE_DYNAMIC_DEBUG_CATEGORIES(... @bit_descs)

[Intel-gfx] [PATCH v10 02/10] drm: fix doc grammar

2021-11-05 Thread Jim Cromie
allocates and initializes ... Signed-off-by: Jim Cromie --- include/drm/drm_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 0cd95953cdf5..4b29261c4537 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h

[Intel-gfx] [PATCH v10 04/10] i915/gvt: trim spaces from pr_debug "gvt: core:" prefixes

2021-11-05 Thread Jim Cromie
ed pr-debugs; in this example, "drm:atomic:fail:". Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/debug.h | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/debug.h b/drivers/gpu/drm/i915/gvt/debug.h index c6027125c1ec..b

[Intel-gfx] [PATCH v10 03/10] amdgpu: use dyndbg.BITGRPS to control existing pr_debugs

2021-11-05 Thread Jim Cromie
o create a sysfs location which maps from bits to these 13 sets of categorized pr_debugs to en/disable. Makefile adds -DDYNAMIC_DEBUG_MODULE for CONFIG_DYNAMIC_DEBUG_CORE, otherwise BUILD_BUG_ON triggers (obvious errors on subtle misuse is better than mysterious ones). Signed-off-by:

[Intel-gfx] [PATCH v10 10/10] drm: use DEFINE_DYNAMIC_DEBUG_TRACE_GROUPS in 3 places

2021-11-05 Thread Jim Cromie
add sysfs knobs to enable modules' pr_debug()s ---> tracefs Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 8 drivers/gpu/drm/drm_print.c| 13 ++--- drivers/gpu/drm/i915/intel_gvt.c | 15 ---

[Intel-gfx] [PATCH v10 07/10] drm_print: instrument drm_debug_enabled

2021-11-05 Thread Jim Cromie
=_ "todo: maybe avoid via dyndbg\012" drivers/gpu/drm/drm_edid_load.c:178 [drm]edid_load =_ "todo: maybe avoid via dyndbg\012" At quick glance, edid won't qualify, drm_print might, drm_vblank is strongest chance, maybe atomic-ioctl too. Signed-off-by: Jim Cromie --- incl

[Intel-gfx] [PATCH v10 06/10] drm_print: add choice to use dynamic debug in drm-debug

2021-11-05 Thread Jim Cromie
quot; callsites from getting stomped on by `echo 0 > debug`. Other categories could differ, but we need some default. Dyndbg requires that the prefix be in the compiled-in format string; run-time prefixing evades callsite selection by category. pr_debug("%s: ...", __func

[Intel-gfx] [PATCH v10 05/10] i915/gvt: use dyndbg.BITGRPS for existing pr_debugs

2021-11-05 Thread Jim Cromie
:" }, [7] = { "gvt:render:" }, [8] = { "gvt:sched:" } }; DEFINE_DYNAMIC_DEBUG_BITGRPS(debug_gvt, __gvt_debug, "dyndbg bitmap desc", If CONFIG_DYNAMIC_DEBUG_CORE=y, then gvt/Makefile adds -DDYNAMIC_DEBUG_MODULE to cflags, which CONFIG_DYNAMIC_DE

[Intel-gfx] [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC

2021-11-05 Thread Jim Cromie
acer(), since dyndbg could just provide it when TRACING is on. NOTES: $> modprobe test_dynamic_debug dyndbg=+p it fails 3/29 tests. havent looked at why. $> modprobe test_dynamic_debug use_bad_tracer=1 Earlier in dev, bad_tracer() exploded in recursion, I havent been able to r

[Intel-gfx] [PATCH v10 09/10] dyndbg: create DEFINE_DYNAMIC_DEBUG_LOG|TRACE_GROUPS

2021-11-05 Thread Jim Cromie
r flags, but DEFINE_DYNAMIC_DEBUG_BITGRPS_FLAGS can be used to explicitly toggle them. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 44 ++- lib/dynamic_debug.c | 4 ++-- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/

[Intel-gfx] [PATCH v10 00/10 RESEND] use DYNAMIC_DEBUG to implement DRM.debug & DRM.trace

2021-11-11 Thread Jim Cromie
k-next]$ wc /proc/dynamic_debug/control 8927 71062 1099699 /proc/dynamic_debug/control [jimc@gandalf wk-next]$ uname -a Linux gandalf 5.15.0-rh2-12144-g5d5db04dfb0c #3 SMP PREEMPT Thu Nov 11 10:5 - pr_debug as event provider using exported trace_array_printk cheap with JU

[Intel-gfx] [PATCH v10 01/10] dyndbg: add DEFINE_DYNAMIC_DEBUG_BITGRPS macro and callbacks

2021-11-11 Thread Jim Cromie
ifferent - "drm:kms"also different - includes drm:kms2: - "drm:kms:\t" also different - could be troublesome - "drm:kms:*" doesn't work, no wildcard on format atm. Order matters in DEFINE_DYNAMIC_DEBUG_CATEGORIES(... @bit_descs)

[Intel-gfx] [PATCH v10 02/10] drm: fix doc grammar

2021-11-11 Thread Jim Cromie
allocates and initializes ... Signed-off-by: Jim Cromie --- include/drm/drm_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 0cd95953cdf5..4b29261c4537 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h

[Intel-gfx] [PATCH v10 03/10] amdgpu: use dyndbg.BITGRPS to control existing pr_debugs

2021-11-11 Thread Jim Cromie
o create a sysfs location which maps from bits to these 13 sets of categorized pr_debugs to en/disable. Makefile adds -DDYNAMIC_DEBUG_MODULE for CONFIG_DYNAMIC_DEBUG_CORE, otherwise BUILD_BUG_ON triggers (obvious errors on subtle misuse is better than mysterious ones). Signed-off-by:

[Intel-gfx] [PATCH v10 04/10] i915/gvt: trim spaces from pr_debug "gvt: core:" prefixes

2021-11-11 Thread Jim Cromie
ed pr-debugs; in this example, "drm:atomic:fail:". Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/debug.h | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/debug.h b/drivers/gpu/drm/i915/gvt/debug.h index c6027125c1ec..b

[Intel-gfx] [PATCH v10 05/10] i915/gvt: use dyndbg.BITGRPS for existing pr_debugs

2021-11-11 Thread Jim Cromie
:" }, [7] = { "gvt:render:" }, [8] = { "gvt:sched:" } }; DEFINE_DYNAMIC_DEBUG_BITGRPS(debug_gvt, __gvt_debug, "dyndbg bitmap desc", If CONFIG_DYNAMIC_DEBUG_CORE=y, then gvt/Makefile adds -DDYNAMIC_DEBUG_MODULE to cflags, which CONFIG_DYNAMIC_DE

[Intel-gfx] [PATCH v10 06/10] drm_print: add choice to use dynamic debug in drm-debug

2021-11-11 Thread Jim Cromie
quot; callsites from getting stomped on by `echo 0 > debug`. Other categories could differ, but we need some default. Dyndbg requires that the prefix be in the compiled-in format string; run-time prefixing evades callsite selection by category. pr_debug("%s: ...", __func

[Intel-gfx] [PATCH v10 07/10] drm_print: instrument drm_debug_enabled

2021-11-11 Thread Jim Cromie
=_ "todo: maybe avoid via dyndbg\012" drivers/gpu/drm/drm_edid_load.c:178 [drm]edid_load =_ "todo: maybe avoid via dyndbg\012" At quick glance, edid won't qualify, drm_print might, drm_vblank is strongest chance, maybe atomic-ioctl too. Signed-off-by: Jim Cromie --- incl

[Intel-gfx] [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC

2021-11-11 Thread Jim Cromie
acer(), since dyndbg could just provide it when TRACING is on. NOTES: $> modprobe test_dynamic_debug dyndbg=+p it fails 3/29 tests. havent looked at why. $> modprobe test_dynamic_debug use_bad_tracer=1 Earlier in dev, bad_tracer() exploded in recursion, I havent been able to r

[Intel-gfx] [PATCH v10 09/10] dyndbg: create DEFINE_DYNAMIC_DEBUG_LOG|TRACE_GROUPS

2021-11-11 Thread Jim Cromie
r flags, but DEFINE_DYNAMIC_DEBUG_BITGRPS_FLAGS can be used to explicitly toggle them. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 44 ++- lib/dynamic_debug.c | 4 ++-- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/

[Intel-gfx] [PATCH v10 10/10] drm: use DEFINE_DYNAMIC_DEBUG_TRACE_GROUPS in 3 places

2021-11-11 Thread Jim Cromie
add sysfs knobs to enable modules' pr_debug()s ---> tracefs Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 8 drivers/gpu/drm/drm_print.c| 13 ++--- drivers/gpu/drm/i915/intel_gvt.c | 15 ---

Re: [Intel-gfx] [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC

2021-11-19 Thread jim . cromie
12 Nov 2021 10:08:41 -0500 > >>> Jason Baron wrote: > >>> > >>>> On 11/12/21 6:49 AM, Vincent Whitchurch wrote: > >>>>> On Thu, Nov 11, 2021 at 03:02:04PM -0700, Jim Cromie wrote: > >>>>&

Re: [Intel-gfx] [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC

2021-11-22 Thread jim . cromie
; > >> On 11/16/21 3:46 AM, Pekka Paalanen wrote: > > >>> On Fri, 12 Nov 2021 10:08:41 -0500 > > >>> Jason Baron wrote: > > >>> > > >>>> On 11/12/21 6:49 AM, Vincent Whitchurch wrote: > > >>>>>

[Intel-gfx] [PATCH 00/12] use dynamic-debug under drm.debug api

2022-02-16 Thread Jim Cromie
y was original goal. - loses the optional decorations. drm has its own logmsg standards, doesnt need decorations slapped on later: could recast flags for drm specific decorations This is based on 5.17-rc4 Its also here: in (dd-drm branch) ghlinux-rohttps://github.com/jimc/linux.git (fetch

[Intel-gfx] [PATCH 01/13] dyndbg: fix static_branch manipulation

2022-02-16 Thread Jim Cromie
/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

[Intel-gfx] [PATCH 03/13] dyndbg: add DEFINE_DYNAMIC_DEBUG_CLASSBITS macro and callbacks

2022-02-16 Thread Jim Cromie
mething like: _pick_sym_(DRM_UT_CORE, "mumble something useful about CORE debug") _pick_sym_(a,b) a // gives us what we need here _pick_help_(a,b) #a " : " b // mod-info fodder Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 50

[Intel-gfx] [PATCH 02/13] dyndbg: add class_id field and query support

2022-02-16 Thread Jim Cromie
ly, the default would be zero, but DRM_UT_CORE "uses" that value, in the sense that 0 is exposed as a bit position in drm.debug. Using 15 allows identity mapping from category to class, avoiding fiddly offsets. CC: Rasmus Villemoes Signed-off-by: Jim Cromie fixup class-id preset fix2

[Intel-gfx] [PATCH 04/13] dyndbg: drop EXPORTed dynamic_debug_exec_queries

2022-02-16 Thread Jim Cromie
ected users, and any prospects would likely reuse the bitmap or a straightforward extension of it, we can drop this function until its really needed. This also drops the CONFIG_DYNAMIC_DEBUG=N stub-func, and its pr_warn(), which I avoided in 2012, then added in 2020 :-/ Signed-off-by: Jim Cromie

[Intel-gfx] [PATCH 07/13] drm_print: condense enum drm_debug_category

2022-02-16 Thread Jim Cromie
-test, the category now fits in 4 bits, allowing it in struct _ddebug.class_id:4. This sets us up to adapt drm to use dyndbg with JUMP_LABEL, thus avoiding all those bit-tests anyway. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 22 +++--- 1 file changed, 11 inserti

[Intel-gfx] [PATCH 05/13] dyndbg: improve change-info to have old and new

2022-02-16 Thread Jim Cromie
move site.flag update after the v4pr_info("change") message, and improve the message to print both old and new flag values. Heres new form: dyndbg: changed net/ipv4/tcp.c:2424 [tcp]tcp_recvmsg_locked pT -> _ Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 11 ++- 1

[Intel-gfx] [PATCH 09/13] drm_print: wrap drm_*_dbg in dyndbg jumplabel

2022-02-16 Thread Jim Cromie
IC_DEBUG_CORE only eliminates the builtin portion, leaving only drm modules, but still 200k of module data is a lot. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 12 drivers/gpu/drm/Makefile | 2 ++ include/drm/drm_print.h | 12 3 files changed, 26 inserti

[Intel-gfx] [PATCH 08/13] drm_print: interpose drm_*dbg with forwarding macros

2022-02-16 Thread Jim Cromie
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 f783d4963d4b..e45ba224e57c 100644 --- a/drivers/gpu/d

[Intel-gfx] [PATCH 06/13] dyndbg: abstract dyndbg_site_is_printing

2022-02-16 Thread Jim Cromie
Hide flags test in a macro. no functional changes. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 664bb83778d2..106065244f73 100644 --- a/include

[Intel-gfx] [PATCH 12/13] drm_print: add _ddebug desc to drm_*dbg prototypes

2022-02-16 Thread Jim Cromie
ration for all those drm.debug callsites. For CONFIG_DRM_USE_DYNAMIC_DEBUG=N, just pass null. NB: desc->class_id is redundant with category, but !!desc dependent. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 23 +-- include/drm/drm_print.h | 23 +

[Intel-gfx] [PATCH 11/13] drm_print: prefer bare printk KERN_DEBUG on generic fn

2022-02-16 Thread Jim Cromie
.0-rc4-lm1-9-g6ce0b88d2539-dirty/kernel/drivers/gpu/drm/drm.ko NB: this was noticed using _drm_debug_enabled(), added earlier. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu

[Intel-gfx] [PATCH 13/13] drm_print: use DEFINE_DYNAMIC_DEBUG_CLASSBITS for drm.debug

2022-02-16 Thread Jim Cromie
ons. _ddebug.class_id is uint:4, values 0-14 are valid. 15 is reserved for non-classified callsites (regular pr_debugs). Using it terminates the scan, don't use it halfway through your list. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 20 ++-- include/drm/drm

[Intel-gfx] [PATCH 10/13] drm_print: refine drm_debug_enabled for dyndbg+jump-label

2022-02-16 Thread Jim Cromie
function. When plugged into 1, it identified ~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

[Intel-gfx] [PATCH 00/12] use dynamic-debug under drm.debug api

2022-03-01 Thread Jim Cromie
his is based on 5.17-rc4, for no particular reason. Its also here: in (dd-drm branch) ghlinux-rohttps://github.com/jimc/linux.git (fetch) Jim Cromie (13): dyndbg: fix static_branch manipulation @stable dyndbg: add class_id field and query support dyndbg: add DEFINE_DYNAMIC_DEBUG_CL

[Intel-gfx] [PATCH 01/13] dyndbg: fix static_branch manipulation

2022-03-01 Thread Jim Cromie
/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

[Intel-gfx] [PATCH 02/13] dyndbg: add class_id field and query support

2022-03-01 Thread Jim Cromie
ly, the default would be zero, but DRM_UT_CORE "uses" that value, in the sense that 0 is exposed as a bit position in drm.debug. Using 15 allows identity mapping from category to class, avoiding fiddly offsets. CC: Rasmus Villemoes Signed-off-by: Jim Cromie fixup class-id preset fix2

[Intel-gfx] [PATCH 03/13] dyndbg: add DEFINE_DYNAMIC_DEBUG_CLASSBITS macro and callbacks

2022-03-01 Thread Jim Cromie
t could be upgraded, something like: _pick_sym_(DRM_UT_CORE, "mumble something useful about CORE debug") _pick_sym_(a,b) a // gives us what we need here _pick_help_(a,b) #a " : " b // mod-info fodder Signed-off-by: Jim Cromie --- include/linux/dynamic_debug

[Intel-gfx] [PATCH 04/13] dyndbg: drop EXPORTed dynamic_debug_exec_queries

2022-03-01 Thread Jim Cromie
ected users, and any prospects would likely reuse the bitmap or a straightforward extension of it, we can drop this function until its really needed. This also drops the CONFIG_DYNAMIC_DEBUG=N stub-func, and its pr_warn(), which I avoided in 2012, then added in 2020 :-/ Signed-off-by: Jim Cromie

[Intel-gfx] [PATCH 05/13] dyndbg: improve change-info to have old and new

2022-03-01 Thread Jim Cromie
move site.flag update after the v4pr_info("change") message, and improve the message to print both old and new flag values. Heres new form: dyndbg: changed net/ipv4/tcp.c:2424 [tcp]tcp_recvmsg_locked pT -> _ Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 11 ++- 1

[Intel-gfx] [PATCH 07/13] drm_print: condense enum drm_debug_category

2022-03-01 Thread Jim Cromie
-test, the category now fits in 4 bits, allowing it in struct _ddebug.class_id:4. This sets us up to adapt drm to use dyndbg with JUMP_LABEL, thus avoiding all those bit-tests anyway. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 22 +++--- 1 file changed, 11 inserti

[Intel-gfx] [PATCH 06/13] dyndbg: abstract dyndbg_site_is_printing

2022-03-01 Thread Jim Cromie
Hide flags test in a macro. no functional changes. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 664bb83778d2..106065244f73 100644 --- a/include

[Intel-gfx] [PATCH 08/13] drm_print: interpose drm_*dbg with forwarding macros

2022-03-01 Thread Jim Cromie
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 f783d4963d4b..e45ba224e57c 100644 --- a/drivers/gpu/d

[Intel-gfx] [PATCH 09/13] drm_print: wrap drm_*_dbg in dyndbg jumplabel

2022-03-01 Thread Jim Cromie
IC_DEBUG_CORE only eliminates the builtin portion, leaving only drm modules, but still 200k of module data is a lot. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 12 drivers/gpu/drm/Makefile | 2 ++ include/drm/drm_print.h | 12 3 files changed, 26 inserti

[Intel-gfx] [PATCH 11/13] drm_print: prefer bare printk KERN_DEBUG on generic fn

2022-03-01 Thread Jim Cromie
.0-rc4-lm1-9-g6ce0b88d2539-dirty/kernel/drivers/gpu/drm/drm.ko NB: this was noticed using _drm_debug_enabled(), added earlier. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu

[Intel-gfx] [PATCH 10/13] drm_print: refine drm_debug_enabled for dyndbg+jump-label

2022-03-01 Thread Jim Cromie
function. When plugged into 1, it identified ~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

[Intel-gfx] [PATCH 13/13] drm_print: use DEFINE_DYNAMIC_DEBUG_CLASSBITS for drm.debug

2022-03-01 Thread Jim Cromie
cases/reasons. _ddebug.class_id is uint:4, values 0-14 are valid. 15 is reserved for non-classified callsites (regular pr_debugs). Using it terminates the scan, don't use it halfway through your list. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 20 ++--

[Intel-gfx] [PATCH 12/13] drm_print: add _ddebug desc to drm_*dbg prototypes

2022-03-01 Thread Jim Cromie
ration for all those drm.debug callsites. For CONFIG_DRM_USE_DYNAMIC_DEBUG=N, just pass null. NB: desc->class_id is redundant with category, but !!desc dependent. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 23 +-- include/drm/drm_print.h | 23 +

Re: [Intel-gfx] ✗ Fi.CI.BAT: failure for use dynamic-debug under drm.debug api (rev2)

2022-03-01 Thread jim . cromie
On Tue, Mar 1, 2022 at 2:32 PM Patchwork wrote: > > Patch Details > Series:use dynamic-debug under drm.debug api (rev2) > URL:https://patchwork.freedesktop.org/series/100289/ > State:failure > Details:https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22448/index.html > > CI Bug Log - changes from

Re: [Intel-gfx] ✗ Fi.CI.SPARSE: warning for use dynamic-debug under drm.debug api (rev2)

2022-03-01 Thread jim . cromie
On Tue, Mar 1, 2022 at 2:00 PM Patchwork wrote: > > == Series Details == > > Series: use dynamic-debug under drm.debug api (rev2) > URL : https://patchwork.freedesktop.org/series/100289/ > State : warning > > == Summary == > > $ dim sparse --fast origin/drm-tip > Sparse version: v0.6.2 > Fast mo

Re: [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for use dynamic-debug under drm.debug api (rev2)

2022-03-04 Thread jim . cromie
On Tue, Mar 1, 2022 at 1:57 PM Patchwork wrote: > > == Series Details == > > Series: use dynamic-debug under drm.debug api (rev2) > URL : https://patchwork.freedesktop.org/series/100289/ > State : warning > > == Summary == > > $ dim checkpatch origin/drm-tip > c2ed9cc02d9c dyndbg: fix static_bra

Re: [Intel-gfx] [PATCH v3 3/5] drm/print: RFC add choice to use dynamic debug in drm-debug

2022-03-05 Thread Jim Cromie
patchwork CI cuz of a macro warning in dyndbg, which would be nice for CI to "pass" because its out of DRM tree, and subject to a separate review process, and in the meantime, it would be nice to see it under test. Going item by item: On Wed, Jul 14, 2021 at 11:51:36AM -0600, Jim Cromie

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

2022-09-04 Thread Jim Cromie
ER > /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 callb

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

2022-09-04 Thread Jim Cromie
uot; > /proc/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: vinc

[Intel-gfx] [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

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

2022-09-04 Thread Jim Cromie
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

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

2022-09-04 Thread Jim Cromie
iter 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 insertion

[Intel-gfx] [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 ++

[Intel-gfx] [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

[Intel-gfx] [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/m

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

2022-09-04 Thread Jim Cromie
427 [main]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/li

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

2022-09-04 Thread Jim Cromie
y compiler. 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/dynam

[Intel-gfx] [PATCH v6 16/57] dyndbg: add ddebug_attach_module_classes

2022-09-04 Thread Jim Cromie
s only a couple 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/dy

[Intel-gfx] [PATCH v6 21/57] dyndbg: test DECLARE_DYNDBG_CLASSMAP, sysfs nodes

2022-09-04 Thread Jim Cromie
h 0 matches, 1 errs [ 28.800378] dyndbg: bit_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 ++

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

2022-09-04 Thread Jim Cromie
trim fmlt 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/Docume

[Intel-gfx] [PATCH v6 28/57] drm_print: refine drm_debug_enabled for jump-label

2022-09-04 Thread Jim Cromie
identified ~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/

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

2022-09-04 Thread Jim Cromie
n.c:1429 [main]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 -

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

2022-09-04 Thread Jim Cromie
according to each 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

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

2022-09-04 Thread Jim Cromie
urns off L>2 (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 fil

[Intel-gfx] [PATCH v6 07/57] dyndbg: let query-modname override actual module name

2022-09-04 Thread Jim Cromie
g it 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 Acked-by: Jason Baron Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 11 +++ 1 file changed, 7 in

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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 --

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

2022-09-04 Thread Jim Cromie
supplied, valid_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) decl

[Intel-gfx] [PATCH v6 37/57] dyndbg: add 2 trace-events: drm_debug, drm_devdbg

2022-09-04 Thread Jim Cromie
tracefs, so pr_debug() and dev_dbg() calls can add more debug context into the trace-logs, and then at users option, less into syslog. The new events allow enabling by event-type in tracefs, and dyndbg allows individual enablement of prdbg callsites (via +T flag). Signed-off-by: Jim Cromie

[Intel-gfx] [PATCH v6 25/57] drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro

2022-09-04 Thread Jim Cromie
c/dynamic_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/dr

[Intel-gfx] [PATCH v6 15/57] kernel/module: add __dyndbg_classes section

2022-09-04 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

[Intel-gfx] [PATCH v6 32/57] nouveau: adapt NV_DEBUG, NV_ATOMIC to use DRM.debug

2022-09-04 Thread Jim Cromie
e due 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 84df5ddae4d0..3b

[Intel-gfx] [PATCH v6 30/57] drm_print: add _ddebug descriptor to drm_*dbg prototypes

2022-09-04 Thread Jim Cromie
onal. 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

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

2022-09-04 Thread Jim Cromie
tly to see 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 @@

[Intel-gfx] [PATCH v6 34/57] dyndbg: add _DPRINTK_FLAGS_ENABLED

2022-09-04 Thread Jim Cromie
new symbol _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

[Intel-gfx] [PATCH v6 33/57] nouveau: WIP add 2 LEVEL_NUM classmaps for CLI, SUBDEV

2022-09-04 Thread Jim Cromie
104] dyndbg: module: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/

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

2022-09-04 Thread Jim Cromie
behavior change. 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

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

2022-09-04 Thread Jim Cromie
nt.whitchu...@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

[Intel-gfx] [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

[Intel-gfx] [PATCH v6 39/57] dyndbg/drm: POC add tracebits sysfs-knob

2022-09-04 Thread Jim Cromie
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/drm_print.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/drm_print.c b/d

[Intel-gfx] [PATCH v6 38/57] dyndbg: add 2 more trace-events: pr_debug, dev_dbg

2022-09-04 Thread Jim Cromie
use in drm_dbg() and drm_devdbg(), and call them. This recapitulates the changes described above, connecting 3-10K drm.debug callsites to tracefs. Signed-off-by: Jim Cromie --- include/trace/events/dyndbg.h | 74 +++ lib/dynamic_debug.c

[Intel-gfx] [PATCH v6 52/57] dyndbg: add DEFINE_DYNAMIC_DEBUG_TABLE, use it tacitly RFC

2022-09-04 Thread Jim Cromie
linker compute the offset and initialize ._index accordingly, but that resulted in some "linker cant compute" error. Ive initialized it in __ddebug_add_module() instead. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 34 ++ 1 file c

[Intel-gfx] [PATCH v6 27/57] drm-print: add drm_dbg_driver to improve namespace symmetry

2022-09-04 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

[Intel-gfx] [PATCH v6 40/57] dyndbg: abstraction macros for modname, function, filename fields

2022-09-04 Thread Jim Cromie
27;s site-rec of a builtin or loadable module, which is unique over the pertinent lifetime, and has all the info. WAG,TLDR: "decorating" could be defered until `cat trace`, modulo loadable sites[] data being needed to render after module is unloaded. no functional changes. Signed-o

[Intel-gfx] [PATCH v6 46/57] dyndbg: drop site-> in add-module, more needed

2022-09-04 Thread Jim Cromie
--- lib/dynamic_debug.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 41c23ec979f4..059212df68f9 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1347,7 +1347,7 @@ static int __ddebug_add_module(str

[Intel-gfx] [PATCH v6 31/57] nouveau: change nvkm_debug/trace to use dev_dbg POC

2022-09-04 Thread Jim Cromie
is independent, 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/nouve

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

2022-09-04 Thread Jim Cromie
bear +/- signs, which alters the on-bit-pos 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

[Intel-gfx] [PATCH v6 51/57] dyndbg: prevent build bugs via -DNO_DYNAMIC_DEBUG_TABLE

2022-09-04 Thread Jim Cromie
. I found the x86 problems myself, l...@intel.com found arm & sparc problems, and may yet find others. Reported-by: # on [jimc:lkp-test/dyndbg-diet] recently Signed-off-by: Jim Cromie --- arch/arm/boot/compressed/Makefile | 2 ++ arch/sparc/vdso/Makefile | 2 ++ arch/x86/b

<    1   2   3   4   5   6   7   8   9   >