[PATCH 01/11] drm: replace open-coded ARRAY_SIZE with macro

2012-04-11 Thread Jim Cromie
Signed-off-by: Jim Cromie jim.cro...@gmail.com --- drivers/gpu/drm/drm_edid_modes.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_edid_modes.h b/drivers/gpu/drm/drm_edid_modes.h index a91ffb1..c2534d4 100644 --- a/drivers/gpu/drm/drm_edid_modes.h

[PATCH 01/11] drm: replace open-coded ARRAY_SIZE with macro

2012-04-10 Thread Jim Cromie
Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_edid_modes.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_edid_modes.h b/drivers/gpu/drm/drm_edid_modes.h index a91ffb1..c2534d4 100644 --- a/drivers/gpu/drm/drm_edid_modes.h +++ b/drivers/gpu

[PATCH 4/4] i915: POC use dynamic_debug_exec_queries to control pr_debugs in gvt

2020-08-27 Thread Jim Cromie
=p dyndbg: applied: func="" file="" module="i915" format="^gvt: cmd: " lineno=0-0 dyndbg: processed 1 queries, with 11 matches, 0 errs change ct:11 on format='gvt: cmd: ' change ct:11 Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/i915_params.c

[PATCH 1/4] drm-printk: POC caller of dynamic-debug-exec-queries

2020-08-27 Thread Jim Cromie
debug call, their eventual callsites will have distinct METADATA, so will be itemized in control, and individually selectable. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/drm_print.c

[PATCH 2/4] drm-printk: call pr_debug() from drm_dev_dbg, __drm_dbg

2020-08-27 Thread Jim Cromie
handling all the categories). We are 1 below the function layer of interest, but theres room for optimism. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/

[PATCH 3/4] i915: add -DDYNAMIC_DEBUG_MODULE to i915/gvt/Makefile

2020-08-27 Thread Jim Cromie
$h{$_}\n" for sort keys %h}' "gvt: cmd:" seen 11 "gvt: core:"seen 48 "gvt: dpy:" seen 4 "gvt: el:" seen 21 "gvt: irq:" seen 1 "gvt: mm:" seen 6 "gvt: mmio:"seen 9 "gvt: render:"

[PATCH 0/4] dyndbg: POC use dynamic_debug_exec_queries in DRM

2020-08-27 Thread Jim Cromie
yndbg: query 0: "format='^gvt: cmd: ' -p" [ 3137.050302] dyndbg: entry, buf:'format='^gvt: cmd: ' -p' [ 3137.053331] dyndbg: start-of-word:0 'format='^gvt: cmd: ' -p' These patches were the test/use case for-59 fixes: https://lore.kernel.org/lkml/20200825173339.2082585-1-jim.cro...@gmail.c

Re: [dyndbg] 4397a3e7bf: BUG:sleeping_function_called_from_invalid_context_at_mm/slab.h

2020-08-13 Thread jim . cromie
) > [ 29.713523] Run /sbin/init as init process > [ 29.714612] with arguments: > [ 29.715484] /sbin/init > [ 29.716328] with environment: > [ 29.717235] HOME=/ > [ 29.717983] TERM=linux > [ 29.718801] user=lkp > [ 29.719587] > job=/lkp/jobs/scheduled/vm

[PATCH 7/7] dyndbg: enable 'cache' of active pr_debug callsites

2020-08-10 Thread Jim Cromie
in ddebug_zpool_put() dont zs_unmap the callsite, if it is enabled for printing. This will eliminate possibly repeated un-maps then re-maps of enabled and invoked pr-debug callsites, and will promptly retire all other uses. But this causes kernel to BUG [1.364303] BUG: sleeping function

Re: [RFC PATCH 1/2] drm: RFC add choice to use dynamic debug in drm-debug

2020-12-07 Thread jim . cromie
On Fri, Dec 4, 2020 at 8:42 AM Ville Syrjälä wrote: > > On Thu, Dec 03, 2020 at 08:53:17PM -0700, Jim Cromie wrote: > > drm's debug system uses distinct categories of debug messages, mapped > > to bits in drm.debug. Currently, code does a lot of unlikely bit-mask >

[RFC PATCH 1/2] drm: RFC add choice to use dynamic debug in drm-debug

2020-12-04 Thread Jim Cromie
is a compile-time const. Note that cat isn't needed in the printing, it would be saved into a new field in struct _ddebug, and used only for callsite selection, activation and control. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 13 ++ drivers/gpu/drm/drm_print.c | 75 +

[RFC PATCH 0/2] drm: use dynamic_debug

2020-12-04 Thread Jim Cromie
, which I have in my laptop. `grep pr_debug` found ~90 callsites with a meaningful format-prefix-string, to demonstrate use of "format ^prefix" to control user categorized debugs. Jim Cromie (2): drm: RFC add choice to use dynamic debug in drm-debug i915: POC use dynamic_debug_ex

[RFC PATCH 2/2] i915: POC use dynamic_debug_exec_queries to control pr_debugs in gvt

2020-12-04 Thread Jim Cromie
Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/Makefile | 1 + drivers/gpu/drm/i915/i915_params.c | 74 ++ 2 files changed, 75 insertions(+) diff --git a/drivers/gpu/drm/i915/gvt/Makefile b/drivers/gpu/drm/i915/gvt/Makefile index ea8324abc784..e38a1eb61

Re: [RFC PATCH 1/2] drm: RFC add choice to use dynamic debug in drm-debug

2020-12-18 Thread jim . cromie
On Fri, Dec 11, 2020 at 8:34 AM Ville Syrjälä wrote: > > On Thu, Dec 03, 2020 at 08:53:17PM -0700, Jim Cromie wrote: > > drm's debug system uses distinct categories of debug messages, mapped > > to bits in drm.debug. Currently, code does a lot of unlikely bit-mask >

[RFC PATCH 3/4] drm: fixup DRM_DEBUG_KMS_RATELIMITED merge punt

2021-05-31 Thread Jim Cromie
-by: Jim Cromie --- include/drm/drm_print.h | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 616fe5e83b50..9812bf11c1e9 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -571,20

[RFC PATCH 0/4] use DYNAMIC_DEBUG in drm/print

2021-05-31 Thread Jim Cromie
.kernel.org/lkml/20210529200029.205306-1-jim.cro...@gmail.com/T/#ma5052696fe9171649b93b3e1f482de90314a9b61 Jim Cromie (4): drm: fixup comment spelling drm: RFC add choice to use dynamic debug in drm-debug drm: fixup DRM_DEBUG_KMS_RATELIMITED merge punt i915: map gvt pr_debug categories to bits in para

[RFC PATCH 2/4] drm: RFC add choice to use dynamic debug in drm-debug

2021-05-31 Thread Jim Cromie
_*, to get right token type. RFC: for dynamic debug, category is a source-facing addition; something like pr_debug_cat(cat, ...) would do it, iff cat is a compile-time const. Note that cat isn't needed in the printing, it would be saved into a new field in struct _ddebug, and used only for callsite sele

[RFC PATCH 1/4] drm: fixup comment spelling

2021-05-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 a3c58c941bdc..9377a17d74f1 100644 --- a/include/drm/drm_print.h +++ b/include

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

2021-05-31 Thread Jim Cromie
der moving the callback code into lib/dynamic_debug, it might make for a declarative interface, like an adorned version of: +static char *format_prefix_classes[] = { + "gvt: cmd: ", Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/Makefile | 4 ++ drivers/gpu/drm/i91

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

2021-07-11 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 ---

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

2021-07-11 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

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

2021-07-11 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

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

2021-07-11 Thread Jim Cromie
ter @ 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 i915: map gvt pr_debug c

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

2021-07-11 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

Re: [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 > []

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

2021-08-22 Thread Jim Cromie
ork, 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

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

2021-08-22 Thread Jim Cromie
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 to use advantageously. Signed-off-by: Jim Cromie

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

2021-08-22 Thread Jim Cromie
that 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

[PATCH v6 07/11] drm_print: instrument drm_debug_enabled

2021-08-22 Thread Jim Cromie
uot;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 --- --- inclu

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

2021-08-22 Thread Jim Cromie
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)(const char *fmt, char *pref

[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

[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

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

2021-08-22 Thread Jim Cromie
t. 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 callsites, but it is tedious

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

2021-08-22 Thread Jim Cromie
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-term is misleading, because i

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

2021-08-22 Thread Jim Cromie
rized 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, &

[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/

[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

[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

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

2021-08-13 Thread Jim Cromie
his 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-tip/drm-tip) Jim C

[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

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

2021-08-13 Thread Jim Cromie
ce +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 | 10 ++ lib/Makefil

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

2021-08-13 Thread Jim Cromie
es) 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 the stubs . const *s

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

2021-08-13 Thread Jim Cromie
rized 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, &

[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

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

2021-08-13 Thread Jim Cromie
FINE_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 ratelimit chunk from elsew

[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

[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/

Re: [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

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

2021-08-31 Thread Jim Cromie
that 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

[PATCH v7 6/8] drm_print: instrument drm_debug_enabled

2021-08-31 Thread Jim Cromie
uot;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 --- include/drm/d

[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

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

2021-08-31 Thread Jim Cromie
rized 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 &

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

2021-08-31 Thread Jim Cromie
iled-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 context. Unfortunately __func

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

2021-08-31 Thread Jim Cromie
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 bits are/will-stay applied 0-N, the lat

[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/

[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

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

2021-08-31 Thread Jim Cromie
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: c

Re: [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) > >

Re: [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 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,

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 n

Re: [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"

[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

[PATCH v8 00/16] use DYNAMIC_DEBUG to implement DRM.debug

2021-09-15 Thread Jim Cromie
s), 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" testing, not just &qu

[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

[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

[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

[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 ---

[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

[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

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

2021-09-15 Thread Jim Cromie
mbedded 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" also different - includes drm:kms2: - "drm:

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

2021-09-15 Thread Jim Cromie
rized 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

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

2021-09-15 Thread Jim Cromie
that 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

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

2021-09-15 Thread Jim Cromie
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 preprocess/compile time. I

[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

[PATCH v8 14/16] drm_print: instrument drm_debug_enabled

2021-09-15 Thread Jim Cromie
uot;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 --- --- includ

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

2021-09-15 Thread Jim Cromie
nouveau 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

[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

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

2021-09-15 Thread Jim Cromie
mmio:"), _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

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

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. >

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

2021-07-14 Thread Jim Cromie
ken type for both !/!! DRM_USE_DYNAMIC_DEBUG 4. simplification of __DRM_DEFINE_DBG_RATELIMITED macro remove DRM_UT_ ## KMS as extra indirection pass both DRM_UT & cDRM_UT, for drm_debug_enabled & drm_dev_dbg Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 13 + d

[PATCH v3 4/5] drm/print: move conditional deref into macro defn

2021-07-14 Thread Jim Cromie
edefined drm_dev_dbg() as a macro. That new macro can do the maybe(deref), so the ~9 callers dont have to. no functional changes. small word-count reduction. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff

[PATCH v3 5/5] i915: map gvt pr_debug categories to bits in parameters/debug_gvt

2021-07-14 Thread Jim Cromie
"gvt: mm: ", "help", "gvt: mmio: ", "help", "gvt: render: ", "help", "gvt: sched: " "help"); Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/Makefile | 4 ++ drivers/gpu/drm/i91

[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

[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

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

2021-07-14 Thread Jim Cromie
tes 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 something else ? Jim Cromi

Re: [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

Re: [RESEND PATCH v6 14/14] drm/print: Add tracefs support to the drm logging helpers

2021-07-29 Thread jim . cromie
On Wed, Jul 21, 2021 at 11:56 AM Sean Paul wrote: > > From: Sean Paul > > This patch adds a new module parameter called drm.trace which accepts > the same mask as drm.debug. When a debug category is enabled, log > messages will be put in a new tracefs instance called drm for > consumption. > >

Re: [RESEND PATCH v6 14/14] drm/print: Add tracefs support to the drm logging helpers

2021-07-29 Thread jim . cromie
On Thu, Jul 29, 2021 at 2:24 PM wrote: > > On Wed, Jul 21, 2021 at 11:56 AM Sean Paul wrote: > > > > From: Sean Paul > > > > This patch adds a new module parameter called drm.trace which accepts > > the same mask as drm.debug. When a debug category is enabled, log > > messages will be put in a

Re: [RESEND PATCH v6 05/14] drm/print: rename drm_debug* to be more syslog-centric

2021-07-28 Thread jim . cromie
On Wed, Jul 21, 2021 at 1:55 PM Sean Paul wrote: > > From: Sean Paul > > In preparation for tracefs support, rename drm_debug related functions > to reflect that it targets the syslog. This will allow us to selectively > target syslog and/or tracefs. > > No functional changes here. I feel like

Re: [RESEND PATCH v6 05/14] drm/print: rename drm_debug* to be more syslog-centric

2021-07-28 Thread jim . cromie
On Wed, Jul 21, 2021 at 1:55 PM Sean Paul wrote: > > From: Sean Paul > > In preparation for tracefs support, rename drm_debug related functions > to reflect that it targets the syslog. This will allow us to selectively > target syslog and/or tracefs. > > No functional changes here. > ... >

Re: [RESEND PATCH v6 01/14] drm/mipi_dbi: Convert pr_debug calls to DRM_DEBUG_DRIVER

2021-07-28 Thread jim . cromie
On Wed, Jul 21, 2021 at 1:55 PM Sean Paul wrote: > > From: Sean Paul > > Use the drm logging helpers to output these messages to ensure they'll > be included by the drm tracefs instance. > > Signed-off-by: Sean Paul > Link: >

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

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

2021-07-31 Thread Jim Cromie
TBD: 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 --

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

2021-07-31 Thread Jim Cromie
amp; 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 \ amdgpu.debug=1 amdgpu.test=1 \ "amd

[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

[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

  1   2   3   4   5   6   7   8   9   >