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

2021-10-26 Thread Jim Cromie
tations, and passed or failed. v8 is here: https://patchwork.freedesktop.org/series/93914/ https://lore.kernel.org/lkml/20210915163957.2949166-1-jim.cro...@gmail.com/ The major change since v8 is that +T now works for all users, if CONFIG_TRACING=y, otherwise it complains/errors. Jim Crom

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

2021-10-26 Thread Jim Cromie
quot;gvt:render:" }, [8] = { "gvt:sched:" }); If CONFIG_DYNAMIC_DEBUG_CORE=y, then gvt/Makefile adds -DDYNAMIC_DEBUG_MODULE to cflags, which CONFIG_DYNAMIC_DEBUG=n (CORE-only) builds need. This is redone more comprehensively soon. Signed-off-by: Jim Cromie --- v5: . stati

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

2021-10-26 Thread Jim Cromie
o format "^drm:atomic:fail: " +p > control Removing embedded spaces in the class-prefixes simplifies the corresponding match-prefix. This means that "quoted" match-prefixes are only needed when the trailing space is desired, in order to exclude explicitly sub-categorized pr

[Intel-gfx] [PATCH v9 03/10] amdgpu: use dyndbg.CATEGORIES to control existing pr_dbgs

2021-10-26 Thread Jim Cromie
EGORIES to 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 v9 02/10] drm: fix doc grammar

2021-10-26 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 v9 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC

2021-10-26 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 replicate

[Intel-gfx] [PATCH v9 01/10] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES macro and callbacks

2021-10-26 Thread Jim Cromie
quot;); // trailing _ for ad-hoc subcat Summarizing: - "drm:kms: " & "drm:kms:" are different - "drm:kms"also different - includes drm:kms2: - "drm:kms:\t" also different - could be troublesome - "drm:kms:*" does

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

2021-10-26 Thread Jim Cromie
both interfaces Bad: arg-type/count handling (expecting 4 args) is ugly, especially preceding the bitmap-init var-args. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu

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

2021-10-26 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 --- -

[Intel-gfx] [PATCH v9 09/10] dyndbg: create DEFINE_DYNAMIC_DEBUG_TRACE_CATEGORIES

2021-10-26 Thread Jim Cromie
race_var // these may be NULL, IFF !CONFIG_TRACE ?? then a bitmap: [0] = { "category1" }, ...) My BUILD_BUG-fu is insufficient to protect a naive macro. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 19 ++- lib/dynamic_debug.c | 4 ++-- 2

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

2021-10-26 Thread Jim Cromie
lsites 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 v8 00/16] use DYNAMIC_DEBUG to implement DRM.debug

2021-09-15 Thread Jim Cromie
tments), and has no users yet, so it can't cause regressions. Obviously, DRM is the anticipated user. I've fixed the patchwork CI problems I have seen on v6, v7, and lkp-robot reports since. Since CONFIG_DRM_USE_DYNAMIC_DEBUG=y by default, it should have seen "on" testin

[Intel-gfx] [PATCH v8 01/16] dyndbg: add module to a vpr-info in dd-exec-queries

2021-09-15 Thread Jim Cromie
dd-exec-queries accepts a separate module arg (so it can support $module.dyndbg cmdline arg), add it to the vpr-info for more context. 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

[Intel-gfx] [PATCH v8 02/16] dyndbg: pr-info in boot-param should say so

2021-09-15 Thread Jim Cromie
add "bootparam" to format. no functional changes. 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 dfe1e6a857bc..da91ff507117 100644 --- a/lib/dynamic_debug.c

[Intel-gfx] [PATCH v8 03/16] dyndbg: rationalize verbosity

2021-09-15 Thread Jim Cromie
-command strings) would produce short writes, truncating last command and confusing test results. 4 gets per-callsite "changed:" pr-infos, which are very noisy during stress tests, and obscure v1-3 messages. Update docs verbose example to 3 per its comment Signed-off-by: Jim Cromie ---

[Intel-gfx] [PATCH v8 04/16] dyndbg: use alt-quotes in vpr-infos, not those user might use

2021-09-15 Thread Jim Cromie
`echo $cmd > control` can be finicky with respect to quoting (mostly wrt * expansion), so lets not complicate things by adding our own in debug messages. Quote as <%s> instead of '%s' or \"%s\" Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 16 ++

[Intel-gfx] [PATCH v8 05/16] dyndbg: vpr-info on remove-module complete, not starting

2021-09-15 Thread Jim Cromie
On qemu --smp 3 runs, remove-module can get called 3 times. Instead, print once at end, if entry was found and removed. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index

[Intel-gfx] [PATCH v8 06/16] dyndbg: no vpr-info on empty queries

2021-09-15 Thread Jim Cromie
when `echo $cmd > control` contains multiple queries, extra query separators (;\n) can parse as empty statements. This is normal, and pr-info on empty command is just noise. Also change varname. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 13 +++-- 1 file changed, 7 inserti

[Intel-gfx] [PATCH v8 08/16] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES bitmap and callbacks

2021-09-15 Thread Jim Cromie
atomic: fail:", with that undesirable embedded space; obviously not ideal wrt clear and simple prefixes. a fix: drm_dbg_atomic_("fail: ..."); // trailing _ for ad-hoc subcat Summarizing: - "drm:kms: " & "drm:kms:" are different - "drm:kms"

[Intel-gfx] [PATCH v8 07/16] dyndbg-doc: fix bootparam usage example

2021-09-15 Thread Jim Cromie
This example uses dyndbg as a core/kernel param; it is a (fake) module param. Using it as given gets an "Unknown command line parameters:" warning. Fix the broken example. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 6 ++ 1 file changed, 2

[Intel-gfx] [PATCH v8 09/16] drm: fix doc grammar error

2021-09-15 Thread Jim Cromie
no code changes, good for rc 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 b439ae1921b8..ebb22166ace1 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h

[Intel-gfx] [PATCH v8 10/16] i915/gvt: remove spaces in pr_debug "gvt: core:" etc prefixes

2021-09-15 Thread Jim Cromie
d pr-debugs; in this example, "drm:atomic:fail:". RFC: maybe the prefix catenation should paste in the " " class-prefix terminator explicitly. A pr_debug_() flavor could exclude the " ", allowing ad-hoc sub-categorization by appending for example, "fail:" t

[Intel-gfx] [PATCH v8 11/16] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES for existing prdbgs

2021-09-15 Thread Jim Cromie
t;), _DD_cat_(7, "gvt:render:"), _DD_cat_(8, "gvt:sched:")); If CONFIG_DYNAMIC_DEBUG_CORE=y, then gvt/Makefile adds -DDYNAMIC_DEBUG_MODULE to cflags, which CONFIG_DYNAMIC_DEBUG=n (CORE-only) builds need. This is redone more comprehensively soon. Signed-off-by: Ji

[Intel-gfx] [PATCH v8 12/16] amdgpu: use DEFINE_DYNAMIC_DEBUG_CATEGORIES on existing prdbgs

2021-09-15 Thread Jim Cromie
uveau Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/Makefile | 2 + .../gpu/drm/amd/display/dc/core/dc_debug.c| 43 ++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefil

[Intel-gfx] [PATCH v8 13/16] drm_print: add choice to use dynamic debug in drm-debug

2021-09-15 Thread Jim Cromie
ould 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__, ...) // not ideal Unfortunately __func__ is not a macro, and cannot be catenated at pr

[Intel-gfx] [PATCH v8 14/16] drm_print: instrument drm_debug_enabled

2021-09-15 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 --- -

[Intel-gfx] [PATCH v8 16/16] nouveau: fold multiple DRM_DEBUG_DRIVERs together

2021-09-15 Thread Jim Cromie
With DRM_USE_DYNAMIC_DEBUG, each callsite record requires 56 bytes. We can combine 12 into one here and save ~620 bytes. Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/nouveau_drm.c | 36 +-- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers

[Intel-gfx] [PATCH v8 15/16] amdgpu_ucode: reduce number of pr_debug calls

2021-09-15 Thread Jim Cromie
break any syslog conventions ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 293 -- 1 file changed, 158 insertions(+), 135 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index

Re: [Intel-gfx] ✗ Fi.CI.BUILD: failure for use DYNAMIC_DEBUG to implement DRM.debug (rev3)

2021-09-16 Thread jim . cromie
On Wed, Sep 15, 2021 at 10:50 AM Patchwork wrote: > > == Series Details == > > Series: use DYNAMIC_DEBUG to implement DRM.debug (rev3) > URL : https://patchwork.freedesktop.org/series/93914/ > State : failure > > == Summary == > > Applying: dyndbg: add module to a vpr-info in dd-exec-queries > A

[Intel-gfx] [PATCH 0/4] drm: maintenance patches for 5.15-rcX

2021-09-29 Thread Jim Cromie
hi drm folks, Heres a small set of assorted patches which are IMO suitable for rcX; one doc fix, 2 patches folding multiple DBGs together, and a format string modification. Jim Cromie (4): drm: fix doc grammar error amdgpu_ucode: reduce number of pr_debug calls nouveau: fold multiple

[Intel-gfx] [PATCH 1/4] drm: fix doc grammar error

2021-09-29 Thread Jim Cromie
no code changes, good for rc 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 2/4] amdgpu_ucode: reduce number of pr_debug calls

2021-09-29 Thread Jim Cromie
break any syslog conventions ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 293 -- 1 file changed, 158 insertions(+), 135 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index

[Intel-gfx] [PATCH 4/4] i915/gvt: remove spaces in pr_debug "gvt: core:" etc prefixes

2021-09-29 Thread Jim Cromie
ailing space is desired, in order to exclude explicitly sub-categorized 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/drive

[Intel-gfx] [PATCH 3/4] nouveau: fold multiple DRM_DEBUG_DRIVERs together

2021-09-29 Thread Jim Cromie
With DRM_USE_DYNAMIC_DEBUG, each callsite record requires 56 bytes. We can combine 12 into one here and save ~620 bytes. Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/nouveau_drm.c | 36 +-- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers

Re: [Intel-gfx] [PATCH 2/4] amdgpu_ucode: reduce number of pr_debug calls

2021-09-29 Thread jim . cromie
On Wed, Sep 29, 2021 at 8:08 PM Joe Perches wrote: > > On Wed, 2021-09-29 at 19:44 -0600, Jim Cromie wrote: > > There are blocks of DRM_DEBUG calls, consolidate their args into > > single calls. With dynamic-debug in use, each callsite consumes 56 > > bytes of calls

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

2021-07-22 Thread jim . cromie
Thanks for the feedback! On Tue, Jul 20, 2021 at 9:29 AM Daniel Vetter wrote: > > On Wed, Jul 14, 2021 at 11:51:36AM -0600, Jim Cromie wrote: > > drm's debug system uses distinct categories of debug messages, encoded > > in an enum (DRM_UT_), which are mapp

Re: [Intel-gfx] [RESEND PATCH v6 03/14] drm/i915/utils: Replace dev_printk with drm helpers

2021-07-28 Thread jim . cromie
On Wed, Jul 21, 2021 at 1:55 PM Sean Paul wrote: > > From: Sean Paul > > Use drm logging helpers to add support for the upcoming tracefs > implementation. > > Signed-off-by: Sean Paul > Link: > https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-4-s...@poorly.run > #v5 > > Chang

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

2021-07-28 Thread jim . cromie
On Tue, Jul 27, 2021 at 10:03 AM Sean Paul wrote: > > On Thu, Jul 22, 2021 at 11:20 AM Sean Paul wrote: > > > > Reply-all fail. Adding everyone else back to my response. > > > On Tue, Jul 20, 2021 at 03:29:34PM +0200, Daniel Vetter wrote: > > > On Wed, J

[Intel-gfx] [PATCH v4 0/7] drm: use dyndbg in drm_print

2021-07-31 Thread Jim Cromie
this patchset bare-metal on an i915 laptop & an amdgpu desktop (both as loadable modules). I booted the amdgpu box with: BOOT_IMAGE=(hd2,gpt2)/vmlinuz-5.13.0-dd7-13692-g8def25788f56 \ root=UUID=mumble ro \ rootflags=subvol=root00 rhgb \ dynamic_debug.verbose=3 main.dyndbg=+p \

[Intel-gfx] [PATCH v4 1/7] drm/print: fixup spelling in a comment

2021-07-31 Thread Jim Cromie
s/prink/printk/ - no functional changes Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 9b66be54dd16..15a089a87c22 100644 --- a/include/drm/drm_print.h +++ b/include

[Intel-gfx] [PATCH v4 2/7] moduleparam: add data member to struct kernel_param

2021-07-31 Thread Jim Cromie
lls __module_param_call_wdata(), which has accepts new data param and inits .data with it. Re-define __module_param_call() using it. Use of this new data member will be rare, it might be worth redoing this as a separate/sub-type to keep the base case. Signed-off-by: Jim Cromie --- include/li

[Intel-gfx] [PATCH v4 3/7] dyndbg: add dyndbg-bitmap definer and callbacks

2021-07-31 Thread Jim Cromie
D: set_dyndbg() works to enable categories, but fails to disable them. This is because the code relied on having an old copy of the param (__gvt_debug) to detect +/- changes. Rewriting the loop is probably easier than stashing the old state for change detection. Signed-off-by: Jim Cromie --

[Intel-gfx] [PATCH v4 4/7] i915/gvt: remove spaces in pr_debug "gvt: core:" etc prefixes

2021-07-31 Thread Jim Cromie
plicitly. A pr_debug_() flavor could exclude the " ", allowing ad-hoc sub-categorization by appending for example, "fail:" to "drm:atomic:". Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/debug.h | 18 +- 1 file changed, 9 insertions(

[Intel-gfx] [PATCH v4 5/7] i915/gvt: control pr_debug("gvt:")s with bits in parameters/debug_gvt

2021-07-31 Thread Jim Cromie
{ "gvt: dpy: ", "display help" }, { "gvt: el: ", "help" }, { "gvt: irq: ", "help" }, { "gvt: mm: ", "help" }, { "gvt: mmio: ", "help" }, { "gvt: r

[Intel-gfx] [PATCH v4 6/7] drm/print: add choice to use dynamic debug in drm-debug

2021-07-31 Thread Jim Cromie
e the class prefix, and to read naturally in logs with plain #catenation. Prefixes given in args to DYNDBG_BITMAP_DESC() determine the bit-query map; so to insure the map is stable, new categories or 3rd level categories must be added to the end. The prefixes may have trailing spaces, depending upon

[Intel-gfx] [PATCH v4 7/7] amdgpu: define a dydbg-bitmap to control categorized pr_debugs

2021-07-31 Thread Jim Cromie
efine bits to control those pr_debugs by their category. Signed-off-by: Jim Cromie --- .../gpu/drm/amd/display/dc/core/dc_debug.c| 42 ++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_debug.c b/drivers/gpu/drm/amd/displ

[Intel-gfx] [PATCH] dyndbg: add special aux_print framework

2021-07-31 Thread Jim Cromie
e, and a wrapper on drm_trace_printf to bundle up the args and comport with the prototype, which can evolve to suit this 1st client. it is on top of: https://patchwork.freedesktop.org/series/92544/ (v4 on lkml, v2 in patchwork) Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 7

[Intel-gfx] [PATCH] dyndbg: add special aux_print framework

2021-07-31 Thread Jim Cromie
e, and a wrapper on drm_trace_printf to bundle up the args and comport with the prototype, which can evolve to suit this 1st client. it is on top of: https://patchwork.freedesktop.org/series/92544/ (v4 on lkml, v2 in patchwork) Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 7

Re: [Intel-gfx] [PATCH v4 2/7] moduleparam: add data member to struct kernel_param

2021-08-02 Thread jim . cromie
On Mon, Aug 2, 2021 at 10:18 AM Emil Velikov wrote: > > Hi Jim, > > On Sat, 31 Jul 2021 at 22:42, Jim Cromie wrote: > > > Use of this new data member will be rare, it might be worth redoing > > this as a separate/sub-type to keep the base case. > &

Re: [Intel-gfx] [PATCH v4 3/7] dyndbg: add dyndbg-bitmap definer and callbacks

2021-08-02 Thread jim . cromie
On Mon, Aug 2, 2021 at 10:24 AM Emil Velikov wrote: > > Hi Jim, > > On Sat, 31 Jul 2021 at 22:42, Jim Cromie wrote: > > > +struct dyndbg_bitdesc { > > + /* bitpos is inferred from index in containing array */ > > + char *prefix; > > + cha

[Intel-gfx] [PATCH v5 0/9] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and use in DRM

2021-08-13 Thread Jim Cromie
Its worth noting, this changes the dyndbg-state underneath settings applied with `echo > parameters/debug`; the latter is qualitatively writeonly, maybe a param_get should return "NA" "-1" this merged cleanly, on top of commit d65ef4634e5c795a6a4df1d198992c70e9692fb3 (drm

[Intel-gfx] [PATCH v5 1/9] drm/print: fixup spelling in a comment

2021-08-13 Thread Jim Cromie
s/prink/printk/ - no functional changes Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 9b66be54dd16..15a089a87c22 100644 --- a/include/drm/drm_print.h +++ b/include

[Intel-gfx] [PATCH v5 2/9] moduleparam: add data member to struct kernel_param

2021-08-13 Thread Jim Cromie
ase. --- v4+: . const void* data - Signed-off-by: Jim Cromie --- include/linux/moduleparam.h | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index eed280fae433..878387e0b2d9 100644 --- a/include/linux/modulepara

[Intel-gfx] [PATCH v5 3/9] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks

2021-08-13 Thread Jim Cromie
ncludes (modifies) subcategories, but then 2nd overrides it. So don't do that. There is still plenty of bikeshedding to do. --- v4+: . rename to DEFINE_DYNAMIC_DEBUG_CATEGORIES from DEFINE_DYNDBG_BITMAP . in query, replace hardcoded "i915" w kp->mod->name . static inline

[Intel-gfx] [PATCH v5 4/9] i915/gvt: remove spaces in pr_debug "gvt: core:" etc prefixes

2021-08-13 Thread Jim Cromie
categorized pr-debugs; in this example, "drm:atomic:fail:". RFC: maybe the prefix catenation should paste in the " " class-prefix terminator explicitly. A pr_debug_() flavor could exclude the " ", allowing ad-hoc sub-categorization by appending for

[Intel-gfx] [PATCH v5 5/9] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create "gvt:core:" etc categories

2021-08-13 Thread Jim Cromie
ion construct. if CONFIG_DRM_USE_DYNAMIC_DEBUG, then -DDYNAMIC_DEBUG_MODULE is added cflags, by gvt/Makefile. --- v4+: . static decl of vector of bit->class descriptors - Emil.V . relocate gvt-makefile chunk from elsewhere Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/Makefile

[Intel-gfx] [PATCH v5 6/9] amdgpu: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to control categorized pr_debugs

2021-08-13 Thread Jim Cromie
IES to create a /sys debug_dc parameter, modinfos, and to specify a map from bits -> categorized pr_debugs to be controlled. Signed-off-by: Jim Cromie --- .../gpu/drm/amd/display/dc/core/dc_debug.c| 44 ++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/

[Intel-gfx] [PATCH v5 7/9] drm_print: add choice to use dynamic debug in drm-debug

2021-08-13 Thread Jim Cromie
face. --- v4+: . use DEFINE_DYNAMIC_DEBUG_CATEGORIES in drm_print.c . s/DRM_DBG_CLASS_/DRM_DBG_CAT_/ - dont need another term . default=y in KBuild entry - per @DanVet . move some commit-log prose to dyndbg commit . add-prototyes to (param_get/set)_dyndbg . more wrinkles found by . relocate rat

[Intel-gfx] [PATCH v5 8/9] amdgpu_ucode: reduce number of pr_debug calls

2021-08-13 Thread Jim Cromie
There are blocks of DRM_DEBUG calls, consolidate their args into single calls. With dynamic-debug in use, each callsite consumes 56 bytes of ro callsite data, and this patch removes about 65 calls, so it saves ~3.5kb. no functional changes. Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd

[Intel-gfx] [PATCH v5 9/9] dyndbg: RFC add tracer facility RFC

2021-08-13 Thread Jim Cromie
) needs if (+p), since +T also enables . add prototypes for un/register_aux_print . change iface names: s/aux_print/tracer/ . also s/trace_print/tracer/ . struct va_format *vaf - tighten further ? Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 32 - lib/Kconfig.debug |

Re: [Intel-gfx] [PATCH v5 2/9] moduleparam: add data member to struct kernel_param

2021-08-13 Thread jim . cromie
On Fri, Aug 13, 2021 at 9:44 AM Andy Shevchenko wrote: > > On Fri, Aug 13, 2021 at 09:17:10AM -0600, Jim Cromie wrote: > > Add a const void* data member to the struct, to allow attaching > > private data that will be used soon by a setter method (via kp->data) > >

[Intel-gfx] [PATCH v6 00/11] use DYNAMIC_DEBUG to implement DRM.debug

2021-08-22 Thread Jim Cromie
in a configurable manner. v6: cleans up per v5 feedback, and adds RFC stuff: - test_dynamic_debug.ko: uses tracer facility added in v5:8/9 - prototype print-once & rate-limiting Hopefully adding RFC stuff doesnt distract too much. Jim Cromie (11): moduleparam: add data member to

[Intel-gfx] [PATCH v6 01/11] moduleparam: add data member to struct kernel_param

2021-08-22 Thread Jim Cromie
ase. Signed-off-by: Jim Cromie --- v6: . const void* data - . better macro names s/_cbd/_cb_data/, s/_wdata/_with_data/ . more const, no cast - Willy --- include/linux/moduleparam.h | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/linux/moduleparam.h b/incl

[Intel-gfx] [PATCH v6 02/11] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks

2021-08-22 Thread Jim Cromie
stable map, new categories or 3rd level categories must be added to the end. Since bits are/will-stay applied 0-N, the later bits can countermand the earlier ones, but its tricky - consider; DD_CATs(... "drm:atomic:", "drm:atomic:fail:" ) // misleading The 1st search

[Intel-gfx] [PATCH v6 04/11] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create "gvt:core:" etc categories

2021-08-22 Thread Jim Cromie
p" }, { "gvt:mm: ", "help" }, { "gvt:mmio: ", "help" }, { "gvt:render: ", "help" }, { "gvt:sched: " "help" }); The actual patch has a few details different, cmd_help() macro emits the initia

[Intel-gfx] [PATCH v6 03/11] i915/gvt: remove spaces in pr_debug "gvt: core:" etc prefixes

2021-08-22 Thread Jim Cromie
categorized pr-debugs; in this example, "drm:atomic:fail:". RFC: maybe the prefix catenation should paste in the " " class-prefix terminator explicitly. A pr_debug_() flavor could exclude the " ", allowing ad-hoc sub-categorization by appending for

[Intel-gfx] [PATCH v6 07/11] drm_print: instrument drm_debug_enabled

2021-08-22 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 ---

[Intel-gfx] [PATCH v6 09/11] nouveau: fold multiple DRM_DEBUG_DRIVERs together

2021-08-22 Thread Jim Cromie
With DRM_USE_DYNAMIC_DEBUG, each callsite record requires 56 bytes. We can combine 12 into one here and save ~620 bytes. Signed-off-by: Jim Cromie --- --- drivers/gpu/drm/nouveau/nouveau_drm.c | 36 +-- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a

[Intel-gfx] [PATCH v6 10/11] dyndbg: RFC add debug-trace callback, selftest with it. RFC

2021-08-22 Thread Jim Cromie
e aux_print callsites (or subsets of them) to tailor the debug-stream for the purpose. Controlling flow is the best work limiter. Signed-off-by: Jim Cromie --- v5: (this patch sent after (on top of) v4) . fix "too many arguments to function", and name the args: int (*aux_print)(co

[Intel-gfx] [PATCH v6 05/11] amdgpu: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to control categorized pr_debugs

2021-08-22 Thread Jim Cromie
IES to create a /sys debug_dc parameter, modinfos, and to specify a map from bits -> categorized pr_debugs to be controlled. Signed-off-by: Jim Cromie --- .../gpu/drm/amd/display/dc/core/dc_debug.c| 44 ++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/

[Intel-gfx] [PATCH v6 08/11] amdgpu_ucode: reduce number of pr_debug calls

2021-08-22 Thread Jim Cromie
break any syslog conventions ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 293 -- 1 file changed, 158 insertions(+), 135 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index

[Intel-gfx] [PATCH v6 11/11] dyndbg: RFC add print-once and print-ratelimited features. RFC.

2021-08-22 Thread Jim Cromie
on, but it is predictable for a given function (except perhaps recursive, but thats not done anyway). Note also that any function can have a single group of prdebugs, plus any number of prdbgs without 'g', either with or without 'r'. So grouping should be flexible enough

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

2021-08-22 Thread Jim Cromie
ut 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__, ...) // not ideal With "lineno X" in a query, its possible to enable single callsi

Re: [Intel-gfx] [PATCH v6 02/11] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks

2021-08-23 Thread jim . cromie
On Mon, Aug 23, 2021 at 12:41 AM Andy Shevchenko wrote: > > On Mon, Aug 23, 2021 at 1:21 AM Jim Cromie wrote: > > > > DEFINE_DYNAMIC_DEBUG_CATEGORIES(name, var, bitmap_desc, @bit_descs) > > allows users to define a drm.debug style (bitmap) sysfs interface, and > >

Re: [Intel-gfx] [PATCH v6 01/11] moduleparam: add data member to struct kernel_param

2021-08-27 Thread jim . cromie
On Wed, Aug 25, 2021 at 11:13 AM Jason Baron wrote: > > > > On 8/22/21 6:19 PM, Jim Cromie wrote: > > Add a const void* data member to the struct, to allow attaching > > private data that will be used soon by a setter method (via kp->data) > > to perform more ela

[Intel-gfx] [PATCH v7 0/8] use DYNAMIC_DEBUG to implement DRM.debug

2021-08-31 Thread Jim Cromie
dule wmi [43852.517497] dyndbg: 92 debug prints in module nouveau There are a few multi-second delays there, just before dyndbg initializes the large blocks of debug prints. Jim Cromie (8): dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks dyndbg: remove spaces in pr_debug "gvt:

[Intel-gfx] [PATCH v7 1/8] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks

2021-08-31 Thread Jim Cromie
ot;drm:kms:*" doesn't work, no wildcard on format atm. Order matters in DEFINE_DYNAMIC_DEBUG_CATEGORIES(... @bit_descs) @bit_descs (array) position determines the bit mapping to the prefix, so to keep a stable map, new categories or 3rd level categories must be added to the end. Since

[Intel-gfx] [PATCH v7 2/8] dyndbg: remove spaces in pr_debug "gvt: core:" etc prefixes

2021-08-31 Thread Jim Cromie
d pr-debugs; in this example, "drm:atomic:fail:". RFC: maybe the prefix catenation should paste in the " " class-prefix terminator explicitly. A pr_debug_() flavor could exclude the " ", allowing ad-hoc sub-categorization by appending for example, "fail:" to &

[Intel-gfx] [PATCH v7 3/8] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create "gvt:core:" etc categories

2021-08-31 Thread Jim Cromie
p" }, { "gvt:mm: ", "help" }, { "gvt:mmio: ", "help" }, { "gvt:render: ", "help" }, { "gvt:sched: " "help" }); The actual patch has a few details different, cmd_help() macro emits the initi

[Intel-gfx] [PATCH v7 4/8] amdgpu: use DEFINE_DYNAMIC_DEBUG_CATEGORIES

2021-08-31 Thread Jim Cromie
IES to create a /sys debug_dc parameter, modinfos, and to specify a map from bits -> categorized pr_debugs to be controlled. Signed-off-by: Jim Cromie --- .../gpu/drm/amd/display/dc/core/dc_debug.c| 44 ++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/

[Intel-gfx] [PATCH v7 5/8] drm_print: add choice to use dynamic debug in drm-debug

2021-08-31 Thread Jim Cromie
prefix be in the compiled-in format string; run-time prefixing evades callsite selection by category. pr_debug("%s: ...", __func__, ...) // not ideal With "lineno X" in a query, its possible to enable single callsites, but it is tedious, and useless in a category conte

[Intel-gfx] [PATCH v7 6/8] drm_print: instrument drm_debug_enabled

2021-08-31 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 --- inc

[Intel-gfx] [PATCH v7 8/8] nouveau: fold multiple DRM_DEBUG_DRIVERs together

2021-08-31 Thread Jim Cromie
With DRM_USE_DYNAMIC_DEBUG, each callsite record requires 56 bytes. We can combine 12 into one here and save ~620 bytes. Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/nouveau_drm.c | 36 +-- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers

[Intel-gfx] [PATCH v7 7/8] amdgpu_ucode: reduce number of pr_debug calls

2021-08-31 Thread Jim Cromie
break any syslog conventions ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 293 -- 1 file changed, 158 insertions(+), 135 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index

Re: [Intel-gfx] ✗ Fi.CI.IGT: failure for use DYNAMIC_DEBUG to implement DRM.debug (rev2)

2021-09-02 Thread jim . cromie
On Tue, Aug 31, 2021 at 5:38 PM Patchwork wrote: > *Patch Details* > *Series:* use DYNAMIC_DEBUG to implement DRM.debug (rev2) > *URL:* https://patchwork.freedesktop.org/series/93914/ > *State:* failure > *Details:* > https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20931/index.html CI > Bug Lo

Re: [Intel-gfx] [PATCH v7 3/8] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create "gvt:core:" etc categories

2021-09-03 Thread jim . cromie
On Fri, Sep 3, 2021 at 5:07 AM Tvrtko Ursulin wrote: > > > On 31/08/2021 21:21, Jim Cromie wrote: > > The gvt component of this driver has ~120 pr_debugs, in 9 categories > > quite similar to those in DRM. Following the interface model of > > drm.debug, add a par

Re: [Intel-gfx] [PATCH v7 5/8] drm_print: add choice to use dynamic debug in drm-debug

2021-09-03 Thread jim . cromie
On Fri, Sep 3, 2021 at 5:15 AM Tvrtko Ursulin wrote: > > > On 31/08/2021 21:21, Jim Cromie wrote: > > drm's debug system writes 10 distinct categories of messages to syslog > > using a small API[1]: drm_dbg*(10 names), DRM_DEV_DEBUG*(3 names), > > DRM_DEBUG*(8

Re: [Intel-gfx] [PATCH v7 6/8] drm_print: instrument drm_debug_enabled

2021-09-05 Thread jim . cromie
On Tue, Aug 31, 2021 at 2:21 PM Jim Cromie wrote: > > Duplicate drm_debug_enabled() code into both "basic" and "dyndbg" > ifdef branches. Then add a pr_debug("todo: ...") into the "dyndbg" > branch. > > Then convert the "dyndbg"

Re: [Intel-gfx] [PATCH v7 3/8] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create "gvt:core:" etc categories

2021-09-06 Thread jim . cromie
On Mon, Sep 6, 2021 at 6:26 AM Tvrtko Ursulin < tvrtko.ursu...@linux.intel.com> wrote: > > > On 03/09/2021 20:22, jim.cro...@gmail.com wrote: > > On Fri, Sep 3, 2021 at 5:07 AM Tvrtko Ursulin > > wrote: > >> > >> > >> On 31/08/2021 21:21, Ji

Re: [Intel-gfx] [PATCH v7 5/8] drm_print: add choice to use dynamic debug in drm-debug

2021-09-06 Thread jim . cromie
> I'll try to extract the "executive summary" from this, you tell me if I > got it right. > > So using or not using dynamic debug for DRM debug ends up being about > shifting the cost between kernel binary size (data section grows by each > pr_debug call site) and runtime conditionals? Yes. > Sin

Re: [Intel-gfx] [PATCH v7 3/8] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create "gvt:core:" etc categories

2021-09-07 Thread jim . cromie
n 03/09/2021 20:22, jim.cro...@gmail.com > > <mailto:jim.cro...@gmail.com> wrote: > > > > On Fri, Sep 3, 2021 at 5:07 AM Tvrtko Ursulin > > > > > <mailto:tvrtko.ursu...@linux.intel.com>> wrote: > > > >> > > > >> > &g

[Intel-gfx] [RFC PATCH v2 1/4] drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macro

2021-07-12 Thread Jim Cromie
whitespace only, to diff-minimize a later commit. no functional changes --- include/drm/drm_print.h | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 9b66be54dd16..6419b4e7c5dc 100644 --- a/include/drm

[Intel-gfx] [RFC PATCH v2 2/4] drm: fixup comment spelling

2021-07-12 Thread Jim Cromie
s/prink/printk/ - no functional changes --- include/drm/drm_print.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 6419b4e7c5dc..4559583bc88b 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -327,7 +3

[Intel-gfx] [RFC PATCH v2 0/4] Allow using dyndbg to replace drm_debug_enabled

2021-07-12 Thread Jim Cromie
stress. this is on top of master @ v5.13-13688-gde5540965853 v1 is here: https://lore.kernel.org/lkml/20201204035318.332419-1-jim.cro...@gmail.com/ Jim Cromie (4): drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macro drm: fixup comment spelling drm: RFC add choice to use dynamic debug in drm-debug

[Intel-gfx] [RFC PATCH v2 4/4] i915: map gvt pr_debug categories to bits in parameters/debug_gvt

2021-07-12 Thread Jim Cromie
The gvt component of this driver has ~120 pr_debugs, in 9 "classes". Following the interface model of drm.debug, add a parameter to map bits to these classes. If CONFIG_DRM_USE_DYNAMIC_DEBUG=y (and CONFIG_DYNAMIC_DEBUG_CORE), add -DDYNAMIC_DEBUG_MODULE into Makefile. TBD: maybe add a separate CON

[Intel-gfx] [RFC PATCH v2 3/4] drm: RFC add choice to use dynamic debug in drm-debug

2021-07-12 Thread Jim Cromie
drm's debug system uses distinct categories of debug messages, encoded in an enum (DRM_UT_), which are mapped to bits in drm.debug. drm_debug_enabled() does a lot of unlikely bit-mask checks on drm.debug; we can use dynamic debug instead, and get all that static_key/jump_label goodness. Dynamic de

Re: [Intel-gfx] [RFC PATCH v2 1/4] drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macro

2021-07-12 Thread jim . cromie
On Sun, Jul 11, 2021 at 10:17 AM Joe Perches wrote: > > On Sat, 2021-07-10 at 23:49 -0600, Jim Cromie wrote: > > whitespace only, to diff-minimize a later commit. > > no functional changes > [] > > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h > []

[Intel-gfx] [PATCH v3 0/5] drm: use dyndbg in drm_print

2021-07-14 Thread Jim Cromie
dbg callsites with a format like '[DML' etc at boot, and amdgpu.test=1 triggers 3 minutes of tests, causing ~76k prdbgs in 409 seconds, before I turned them off with: echo module amdgpu -p > /proc/dynamic_debug/control This is on top of master @ v5.14-rc1 Should I rebase onto somethi

[Intel-gfx] [PATCH v3 1/5] drm/print: fixup spelling in a comment

2021-07-14 Thread Jim Cromie
s/prink/printk/ - no functional changes Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 9b66be54dd16..15a089a87c22 100644 --- a/include/drm/drm_print.h +++ b/include

[Intel-gfx] [PATCH v3 2/5] drm_print.h: rewrap __DRM_DEFINE_DBG_RATELIMITED macro

2021-07-14 Thread Jim Cromie
whitespace only, to minimize the diff of a later commit. no functional changes Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 15a089a87c22

  1   2   3   4   5   6   7   8   9   >