[RFC PATCH v4 19/19] dyndbg: RFC add linker rules to module.lds.h

2021-03-17 Thread Jim Cromie
attempts, to show my errors. no-bisect: expect linker error Signed-off-by: Jim Cromie --- include/asm-generic/module.lds.h | 21 + 1 file changed, 21 insertions(+) diff --git a/include/asm-generic/module.lds.h b/include/asm-generic/module.lds.h index f210d5c1b78b

[RFC PATCH v4 16/19] dyndbg: prevent build bugs via -DNO_DYNAMIC_DEBUG_TABLE

2021-03-17 Thread Jim Cromie
-by: Jim Cromie --- arch/x86/boot/compressed/Makefile | 1 + arch/x86/entry/vdso/Makefile | 3 +++ arch/x86/purgatory/Makefile | 1 + drivers/firmware/efi/libstub/Makefile | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed

[RFC PATCH v4 18/19] dyndbg: shuffle ddebug_table fields

2021-03-17 Thread Jim Cromie
stly to isolate/prove no breakage before HEAD++ Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 29 + lib/dynamic_debug.c | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/l

[RFC PATCH v4 05/19] dyndbg: hoist ->site out of ddebug_match_site

2021-03-17 Thread Jim Cromie
ges Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index da732e0c56e3..abe3382aabd5 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -143,10 +143,9 @@ static v

[RFC PATCH v4 06/19] dyndbg: accept null site in ddebug_change

2021-03-17 Thread Jim Cromie
fix a debug-print that includes site info, by adding an alternate debug message that does not. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c

[RFC PATCH v4 08/19] dyndbg: accept null site in ddebug_proc_show

2021-03-17 Thread Jim Cromie
Accept a ddebug record with a null site pointer, and write abbreviated output for that record that doesn't include site info (but does include line-number, since that can be used in >control queries). Also add a 2nd header line with a template for the new output. Signed-off-by: Jim Cro

[RFC PATCH v4 15/19] dyndbg: add _index to struct _ddebug

2021-03-17 Thread Jim Cromie
r { struct ddebug_table *owner; struct _ddebug item; } and struct ddebug_table_vector { struct ddebug_table *owner; struct _ddebug vector[]; } Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 ++ lib/dynamic_debug.c | 40 ++

[RFC PATCH v4 17/19] dyndbg: RFC - DECLARE/DEFINE_DYNAMIC_DEBUG_TABLE

2021-03-17 Thread Jim Cromie
le modules should get their own. tbt. this could obsolete all the above problems. Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/i915_drv.c | 2 + include/asm-generic/vmlinux.lds.h | 27 +--- include/linux/dynamic_debug.h | 100 +- lib/dynamic_debug.

[RFC PATCH v4 14/19] dyndbg: add ddebug_site(_get|_put) abstraction

2021-03-17 Thread Jim Cromie
els tricky. It needs to be 1st in the sub-vector D: (C1?) add a header record to each sub-vector If we can insert a header record into each modules' __dyndbg* section sub-vectors, we can simplify the cold path above; a single sites* pointer in the header can give us access to __dyndbg_sites[N] Sign

[RFC PATCH v4 13/19] dyndbg+module: expose ddebug_sites to modules

2021-03-17 Thread Jim Cromie
t steal it and stomp on the memory just in front of it (for the sites ptr). rename n to numdbgs Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 ++-- kernel/module-internal.h | 1 + kernel/module.c | 9 ++--- lib/dynamic_debug.c | 20

[RFC PATCH v4 12/19] dyndbg: allow deleting site info via control interface

2021-03-17 Thread Jim Cromie
$line +p >control Dropping site info is a one-way, information losing operation, so minor misuse is possible. Worst case is maybe (depending upon previous settings) some loss of logging context/decorations. echo +D > /proc/dynamic_debug/control [*] amdgpu has some macros invoking clus

[RFC PATCH v4 11/19] dyndbg: refactor ddebug_alter_site out of ddebug_change

2021-03-17 Thread Jim Cromie
Move the JUMP_LABEL/static-key code to a separate function. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 2d011ac3308d

[RFC PATCH v4 09/19] dyndbg: optimize ddebug_emit_prefix

2021-03-17 Thread Jim Cromie
Add early return if no callsite info is specified in site-flags. This avoids fetching site info that isn't going to be printed. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 9 + lib/dynamic_debug.c | 3 +++ 2 files changed, 12 insertions(+) diff --git

[RFC PATCH v4 10/19] dyndbg: avoid calling dyndbg_emit_prefix when it has no work

2021-03-17 Thread Jim Cromie
Wrap function in a static-inline one, which checks flags to avoid calling the function unnecessarily. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index af9cf97f869b

[RFC PATCH v4 07/19] dyndbg: accept null site in dynamic_emit_prefix

2021-03-17 Thread Jim Cromie
2 prints use site->member, protect them with if site. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 151e55ab6bb5..0c535f3c2ba9 100

[RFC PATCH v4 04/19] dyndbg: accept null site in ddebug_match_site

2021-03-17 Thread Jim Cromie
the match. otherwize site matches. 3- rest of function (checking site vs query) is unchanged. ddebug_match_site ignores module, because it's tested already by the caller, where it is known from debug_tables. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 41

[RFC PATCH v4 02/19] dyndbg: __init iterate over __dyndbg & __dyndbg_site in parallel

2021-03-17 Thread Jim Cromie
rallel with __dyndbg s/iter->site/site/g; 3- add BUG_ON(iter->site != site) DECLARE_DYNAMIC_DEBUG_METADATA + linker insure this now. Maybe we can drop pointer, still get order. 4- var rename n to site_ct Signed-off-by: Jim Cromie --- lib/dynamic_

[RFC PATCH v4 03/19] dyndbg: refactor part of ddebug_change to ddebug_match_site

2021-03-17 Thread Jim Cromie
Move all the site-match logic into a separate function, reindent the code, and replace the continues with return falses. No functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 75 ++--- 1 file changed, 43 insertions(+), 32 deletions

[RFC PATCH v4 00/19] dynamic debug diet plan

2021-03-17 Thread Jim Cromie
ertions of loadable modules, we can easily a 2nd list for that. Jim Cromie (19): dyndbg: split struct _ddebug, move display fields to new _ddebug_site dyndbg: __init iterate over __dyndbg & __dyndbg_site in parallel dyndbg: refactor part of ddebug_change to ddebug_match_site dyndbg: accep

[RFC PATCH v4 01/19] dyndbg: split struct _ddebug, move display fields to new _ddebug_site

2021-03-17 Thread Jim Cromie
s section, with the same align(8) and KEEP as used in the __dyndbg section. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 3 ++ include/linux/dynamic_debug.h | 37 - lib/dynamic_debug.c | 46 +-- 3

[RFC PATCH v3 18/18] dyndbg: shuffle ddebug_table fields

2021-03-15 Thread Jim Cromie
stly to isolate/prove no breakage before HEAD++ Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 29 + lib/dynamic_debug.c | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/l

[RFC PATCH v3 17/18] dyndbg: RFC - DECLARE/DEFINE_DYNAMIC_DEBUG_TABLE

2021-03-15 Thread Jim Cromie
le modules should get their own. tbt. this could obsolete all the above problems. Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/i915_drv.c | 2 + include/asm-generic/vmlinux.lds.h | 27 +--- include/linux/dynamic_debug.h | 100 +- lib/dynamic_debug.

[RFC PATCH v3 16/18] dyndbg: prevent build bugs via -DNO_DYNAMIC_DEBUG_TABLE

2021-03-15 Thread Jim Cromie
-by: Jim Cromie --- arch/x86/boot/compressed/Makefile | 1 + arch/x86/entry/vdso/Makefile | 3 +++ arch/x86/purgatory/Makefile | 1 + drivers/firmware/efi/libstub/Makefile | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed

[RFC PATCH v3 13/18] dyndbg+module: expose ddebug_sites to modules

2021-03-15 Thread Jim Cromie
t steal it and stomp on the memory just in front of it (for the sites ptr). rename n to numdbgs Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 ++-- kernel/module-internal.h | 1 + kernel/module.c | 9 ++--- lib/dynamic_debug.c | 18 +++---

[RFC PATCH v3 09/18] dyndbg: optimize ddebug_emit_prefix

2021-03-15 Thread Jim Cromie
Add early return if no callsite info is specified in site-flags. This avoids fetching site info that isn't going to be printed. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 9 + lib/dynamic_debug.c | 3 +++ 2 files changed, 12 insertions(+) diff --git

[RFC PATCH v3 14/18] dyndbg: add ddebug_site(_get|_put) abstraction

2021-03-15 Thread Jim Cromie
els tricky. It needs to be 1st in the sub-vector D: (C1?) add a header record to each sub-vector If we can insert a header record into each modules' __dyndbg* section sub-vectors, we can simplify the cold path above; a single sites* pointer in the header can give us access to __dyndbg_sites[N] Sign

[RFC PATCH v3 15/18] dyndbg: add _index to struct _ddebug

2021-03-15 Thread Jim Cromie
r { struct ddebug_table *owner; struct _ddebug item; } and struct ddebug_table_vector { struct ddebug_table *owner; struct _ddebug vector[]; } Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 ++ lib/dynamic_debug.c | 43 ++

[RFC PATCH v3 08/18] dyndbg: accept null site in ddebug_proc_show

2021-03-15 Thread Jim Cromie
Accept a ddebug record with a null site pointer, and write abbreviated output for that record that doesn't include site info (but does include line-number, since that can be used in >control queries). Also add a 2nd header line with a template for the new output. Signed-off-by: Jim Cro

[RFC PATCH v3 12/18] dyndbg: allow deleting site info via control interface

2021-03-15 Thread Jim Cromie
$line +p >control Dropping site info is a one-way, information losing operation, so minor misuse is possible. Worst case is maybe (depending upon previous settings) some loss of logging context/decorations. echo +D > /proc/dynamic_debug/control [*] amdgpu has some macros invoking clus

[RFC PATCH v3 11/18] dyndbg: refactor ddebug_alter_site out of ddebug_change

2021-03-15 Thread Jim Cromie
Move the JUMP_LABEL/static-key code to a separate function. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 2d011ac3308d

[RFC PATCH v3 10/18] dyndbg: avoid calling dyndbg_emit_prefix when it has no work

2021-03-15 Thread Jim Cromie
Wrap function in a static-inline one, which checks flags to avoid calling the function unnecessarily. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index af9cf97f869b

[RFC PATCH v3 03/18] dyndbg: refactor part of ddebug_change to ddebug_match_site

2021-03-15 Thread Jim Cromie
Move all the site-match logic into a separate function, reindent the code, and replace the continues with return falses. No functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 75 ++--- 1 file changed, 43 insertions(+), 32 deletions

[RFC PATCH v3 07/18] dyndbg: accept null site in dynamic_emit_prefix

2021-03-15 Thread Jim Cromie
2 prints use site->member, protect them with if site. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 151e55ab6bb5..0c535f3c2ba9 100

[RFC PATCH v3 05/18] dyndbg: hoist ->site out of ddebug_match_site

2021-03-15 Thread Jim Cromie
ges Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index da732e0c56e3..abe3382aabd5 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -143,10 +143,9 @@ static v

[RFC PATCH v3 04/18] dyndbg: accept null site in ddebug_match_site

2021-03-15 Thread Jim Cromie
the match. otherwize site matches. 3- rest of function (checking site vs query) is unchanged. ddebug_match_site ignores module, because it's tested already by the caller, where it is known from debug_tables. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 41

[RFC PATCH v3 06/18] dyndbg: accept null site in ddebug_change

2021-03-15 Thread Jim Cromie
fix a debug-print that includes site info, by adding an alternate debug message that does not. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c

[RFC PATCH v3 02/18] dyndbg: __init iterate over __dyndbg & __dyndbg_site in parallel

2021-03-15 Thread Jim Cromie
rallel with __dyndbg s/iter->site/site/g; 3- add BUG_ON(iter->site != site) DECLARE_DYNAMIC_DEBUG_METADATA + linker insure this now. Maybe we can drop pointer, still get order. 4- var rename n to site_ct Signed-off-by: Jim Cromie --- lib/dynamic_

[RFC PATCH v3 01/18] dyndbg: split struct _ddebug, move display fields to new _ddebug_site

2021-03-15 Thread Jim Cromie
s section, with the same align(8) and KEEP as used in the __dyndbg section. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 3 ++ include/linux/dynamic_debug.h | 37 - lib/dynamic_debug.c | 46 +-- 3

[RFC PATCH v3 00/18] dynamic debug diet plan

2021-03-15 Thread Jim Cromie
, which can then be make readonly (by means I dont know). If this breaks insertions of loadable modules, we can easily a 2nd list for that. Jim Cromie (18): dyndbg: split struct _ddebug, move display fields to new _ddebug_site dyndbg: __init iterate over __dyndbg & __dyndbg_site in paralle

[PATCH 19/20] dyndbg: try conditional linker expression in KEEP - RFC

2021-01-26 Thread Jim Cromie
ake a look at the source; having never done anything bison-ish, I anticipate a long study without some focused primer knowledge. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h

Re: [RFC PATCH v2 00/19] dynamic debug diet plan

2021-01-06 Thread jim . cromie
On Tue, Dec 29, 2020 at 11:56 AM Joe Perches wrote: > > On Fri, 2020-12-25 at 13:19 -0700, Jim Cromie wrote: > > Well, we're mostly overeating, but we can all look forward to a diet > > in January. And more exersize. > > > > dyndbg's compiled-in data-table curre

[RFC PATCH v2 01/19] dyndbg: fix use before null check

2020-12-25 Thread Jim Cromie
export, rename to dynamic_debug_exec_queries()") Cc: sta...@vger.kernel.org -- -v2 drop comment tweak, improve commit message Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index bd7b3aaa93c3.

[RFC PATCH v2 17/19] dyndbg: rearrange struct ddebug_callsites

2020-12-25 Thread Jim Cromie
-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 0fcbe96736f3..e7b5e7664e51 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux

[RFC PATCH v2 18/19] dyndbg: add module_index to struct _ddebug

2020-12-25 Thread Jim Cromie
[1] DECLARE_DYNAMIC_DEBUG_METADATA may be why 2 linker sections are in-order; it links head->body as it "allocates" them. If we drop the pointer, we lose the constraint on the relative ordering. I hope not. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 16 +

[RFC PATCH v2 16/19] dyndbg: ddebug_site_get/put api commentary

2020-12-25 Thread Jim Cromie
he top (or bottom) or sorted into place. If that doesn't work, a "preload if module is different" strategy could maybe work, but I dont know how to do that in macros. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic

[RFC PATCH v2 12/19] dyndbg: allow deleting site info via control interface

2020-12-25 Thread Jim Cromie
on losing operation, so minor misuse is possible. Worst case is maybe (depending upon previous settings) some loss of logging context/decorations. echo +D > /proc/dynamic_debug/control [*] amdgpu has some macros invoking clusters of pr_debugs; each use of them creates a cluster of pr-debug

[RFC PATCH v2 15/19] dyndbg: add ddebug_site_get/put api with pass-thru impl

2020-12-25 Thread Jim Cromie
Now that site info is optional, abstract it so we can manage it more flexibly later. Change all site users to use ddebug_site_get(p) instead, which just returns ->site. ddebug_site_put is called to balance gets, it currently does nothing. no functional changes. Signed-off-by: Jim Cro

[RFC PATCH v2 11/19] dyndbg: refactor ddebug_alter_site out of ddebug_change

2020-12-25 Thread Jim Cromie
Move the JUMP_LABEL/static-key code to a separate inline function. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index daded73c8575

[RFC PATCH v2 09/19] dyndbg: optimize ddebug_emit_prefix

2020-12-25 Thread Jim Cromie
Add early return if no callsite info is specified in site-flags. This avoids fetching site info that isn't going to be printed. RFC: is this a proper place to use likely()? Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 9 + lib/dynamic_debug.c | 3 +++ 2 files

[RFC PATCH v2 19/19] dyndbg: try DEFINE_DYNAMIC_DEBUG_TABLE

2020-12-25 Thread Jim Cromie
ffset Info Type Sym. ValueSym. Name + Addend 001a0001 R_X86_64_64 .rodata.str1.1 + d8 0008 000a0001 R_X86_64_64 .rodata.str1.8 + 110 Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/

[RFC PATCH v2 13/19] dyndbg: verify __dyndbg & __dyndbg_callsite invariant

2020-12-25 Thread Jim Cromie
828: 82b32f28 82b32f10 1 24 40 [1.929326] dyndbg: 2829: 82b32f40 82b32f10 2 48 80 [1.930209] dyndbg: 2 debug prints in module i386 We have N (col 4), and N * structsize (col 5). I feel like it still needs more staring at. Signed-off-by: Jim Cromie ---

[RFC PATCH v2 10/19] dyndbg: avoid calling dyndbg_emit_prefix when it has no work

2020-12-25 Thread Jim Cromie
Wrap function in a static-inline one, which checks flags to avoid calling the function unnecessarily. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8e81ce58c1bd

[RFC PATCH v2 07/19] dyndbg: accept null site in dynamic_emit_prefix

2020-12-25 Thread Jim Cromie
2 prints use site->member, protect them with if site. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 5422cef58130..190a796da03a 100

[RFC PATCH v2 14/19] dyndbg+module: expose ddebug_callsites to modules

2020-12-25 Thread Jim Cromie
to initialize it from the elf section. Its possible that this closes a hole created when __dyndbg_callsites section was added, and wasnt handled by module load-info. I never saw any misbehavior loading i915.ko into a vm, but still.. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4

[RFC PATCH v2 08/19] dyndbg: accept null site in ddebug_proc_show

2020-12-25 Thread Jim Cromie
Accept a ddebug record with a null site pointer, and write abbreviated output for that record that doesn't include site info (but does include line-number, since that can be used in >control queries). Also add a 2nd header line with a template for the new output. Signed-off-by: Jim Cro

[RFC PATCH v2 04/19] dyndbg: accept null site in ddebug_match_site

2020-12-25 Thread Jim Cromie
re skipped entirely in caller, so we can ignore it here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 41 + 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d9a0527ec842..bb9279c8cbfd 100644

[RFC PATCH v2 06/19] dyndbg: accept null site in ddebug_change

2020-12-25 Thread Jim Cromie
fix a debug-print that includes site info, by adding an alternate debug message that does not. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c

[RFC PATCH v2 05/19] dyndbg: hoist ->site out of ddebug_match_site

2020-12-25 Thread Jim Cromie
A coming change adds _get/_put abstraction on the site pointer, to allow managing site info more flexibly. The get/put pattern is best done at a single lexical scope, where its more obviously correct, so hoist the ->site ref out of ddebug_match_site, and pass it in instead. Signed-off-by:

[RFC PATCH v2 02/19] dyndbg: split struct _ddebug, move display fields to new _ddebug_callsite

2020-12-25 Thread Jim Cromie
to (not initializes) the autovar, to avoid a panic when p == SEQ_START_TOKEN. vmlinux.lds.h: add __ddebug_callsites section, with the same align(8) and KEEP as used in the __ddebug section. RFC this is slightly out of sync with METADATA code, and dropping align(8) on the struct itself. Signed-off-by: Jim Cromie

[RFC PATCH v2 00/19] dynamic debug diet plan

2020-12-25 Thread Jim Cromie
differs by dropping zram attempt, making callsite data optional, etc. Jim Cromie (19): against v5.10 dyndbg: fix use before null check 1 dyndbg: split struct _ddebug, move display fields to new _ddebug_callsite 2 dyndbg: refactor part of ddebug_change to ddebug_match_site dyndbg: a

[RFC PATCH v2 03/19] dyndbg: refactor part of ddebug_change to ddebug_match_site

2020-12-25 Thread Jim Cromie
Move all the site-match logic into a separate function, reindent the code, and replace the continues with return falses. No functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 75 ++--- 1 file changed, 43 insertions(+), 32 deletions

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

2020-12-17 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 >

[PATCH v2] dyndbg: fix use before null check

2020-12-09 Thread Jim Cromie
export, rename to dynamic_debug_exec_queries()") Cc: sta...@vger.kernel.org -- -v2 drop comment tweak, improve commit message Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index bd7b3aaa93c3.

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

2020-12-04 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 2/2] i915: POC use dynamic_debug_exec_queries to control pr_debugs in gvt

2020-12-03 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

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

2020-12-03 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-03 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

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

2020-11-25 Thread jim . cromie
On Wed, Nov 25, 2020 at 1:54 PM Jason Baron wrote: > > > > On 11/25/20 2:36 PM, Jim Cromie wrote: > > In ddebug_putsite(), dont zs_unmap the callsite if it is enabled for > > printing. This means that the next time this pr_debug callsite is > > executed, the _

[PATCH 0/7] WIP dyndbg diet plan, paging Dr Zram.

2020-11-25 Thread Jim Cromie
dule 1668 file 810 func Once __dyndbg_callsites section is reclaimed, %30 savings looks likely. Jim Cromie (7): dyndbg: move struct _ddebug's display fields to new _ddebug_callsite dyndbg: count repetition in __dyndbg_callsite fields. dyndbg: add some code to see alignments of linkage data d

[PATCH 4/7] dyndbg: select ZPOOL,ZS_MALLOC in Kconfig.debug DYNAMIC_DEBUG_CORE

2020-11-25 Thread Jim Cromie
pends on" instead of "select" to break a recursive dependency. I think this doesnt quite sort things out for other config permutations, TBD. -v2 fixup -> _CORE Reported-by: kernel test robot Signed-off-by: Jim Cromie --- lib/Kconfig.debug | 2 ++ 1 file changed, 2 insertio

[PATCH 2/7] dyndbg: count repetition in __dyndbg_callsite fields.

2020-11-25 Thread Jim Cromie
records, and get 11/24 compression on init/main pr_debugs. For a slightly apples-to-oranges comparison (text vs pointers), `gzip /proc/dynamic_debug/control` achieves 6/1 compression. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 17 +++-- 1 file changed, 15 insertions(+), 2

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

2020-11-25 Thread Jim Cromie
1.917038] ret_from_fork+0x22/0x30 [1.917726] Kernel Offset: disabled [1.918324] ---[ end Kernel panic - not syncing: Requested init /bin/sh failed (error -14). ]--- QEMU 5.1.0 monitor - type 'help' for more information Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 4 +++- 1

[PATCH 6/7] dyndbg: add locking around zpool-add loop in zpool-init

2020-11-25 Thread Jim Cromie
d the loop of ddebug_zpool_add(), to match the locking in ddebug_add_module(). Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 473406b069a7..534d73e45844 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynam

[PATCH 1/7] dyndbg: move struct _ddebug's display fields to new _ddebug_callsite

2020-11-25 Thread Jim Cromie
ecessary on struct _ddebug_callsite, I think its there for the static_key member. I do wonder if its arch dependent, 8 seems big for i686 at least. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 4 +++ include/linux/dynamic_debug.h | 41 +++- lib/dynamic_debug.c

[PATCH 5/7] dyndbg: replace __dyndbg_callsite section with a zs-pool copy.

2020-11-25 Thread Jim Cromie
thout also needing all the other callsite data. Getting it out of head would save on-line ram. But it broke in HEAD~1 when I tried it, with asm goto errors. `grep arch_static_branch` suggests my argument to it was uniquely complicated and dereferencing. Signed-off-by: Jim Cromie --- inc

[PATCH 3/7] dyndbg: add some code to see alignments of linkage data

2020-11-25 Thread Jim Cromie
those linkage data sources, then we can use +1 to mark the Beginning-Of-Tuple (or EOT), and so distinguish amongst the N-tuples, and reconstruct each record by copying and changing the previous record. Each new module block starts with a 4-tuple; the init/main example block above is a 4,1,1,1,2,2-t

Re: [PATCH] locking-selftest: add option to proceed through unexpected failures

2020-11-24 Thread jim . cromie
On Tue, Nov 17, 2020 at 3:02 AM Peter Zijlstra wrote: > > On Fri, Nov 13, 2020 at 04:00:48PM -0700, Jim Cromie wrote: > > Locking selftest is currently (v.5.10-rc3) seeing 14 unexpected failures. > > Add option to not disable debug_locks, so as to let it reveal any > &

[PATCH] dyndbg: fix use before null check

2020-11-23 Thread Jim Cromie
commit a2d375eda771 ("dyndbg: refine export, rename to dynamic_debug_exec_queries()") Above commit copies a string before checking for null pointer, fix this, and add a pr_err. Also trim comment, and add return val info. Fixes: a2d375eda771 Cc: sta...@vger.kernel.org Signed-off-by:

[PATCH] locking-selftest: add option to proceed through unexpected failures

2020-11-13 Thread Jim Cromie
Locking selftest is currently (v.5.10-rc3) seeing 14 unexpected failures. Add option to not disable debug_locks, so as to let it reveal any locking flaws in new unrelated work. Signed-off-by: Jim Cromie --- lib/locking-selftest.c | 21 ++--- 1 file changed, 18 insertions(+), 3

Re: [PATCH 1/2] dyndbg: dont panic over bad input

2020-09-22 Thread jim . cromie
On Tue, Sep 22, 2020 at 2:08 AM Petr Mladek wrote: > > On Mon 2020-09-21 13:04:32, Jim Cromie wrote: > > This BUG_ON, from 2009, caught the impossible case of a word-char both > > starting and ending a string (loosely speaking). A bad (reverted) > > patch finally

Re: [PATCH 1/2] dyndbg: dont panic over bad input

2020-09-21 Thread jim . cromie
On Mon, Sep 21, 2020 at 1:29 PM Joe Perches wrote: > > On Mon, 2020-09-21 at 13:04 -0600, Jim Cromie wrote: > > This BUG_ON, from 2009, caught the impossible case of a word-char both > > starting and ending a string (loosely speaking). A bad (reverted) > > patch finally

[PATCH 0/2] dyndbg: 2 fixes/cleanups for 5.9

2020-09-21 Thread Jim Cromie
2 things which might qualify as fixes a bad (reverted) patch hit a BUG_ON, change that to return -EINVAL instead keep useful part of the reverted patch, use keyword, arg varnames Jim Cromie (2): dyndbg: dont panic over bad input dyndbg: use keyword, arg varnames for query term pairs lib

[PATCH 2/2] dyndbg: use keyword, arg varnames for query term pairs

2020-09-21 Thread Jim Cromie
optimize for clarity by replacing word[i,i+1] refs with temps. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 90ddf07ce34fe

[PATCH 1/2] dyndbg: dont panic over bad input

2020-09-21 Thread Jim Cromie
etr Mladek Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 2d4dfd44b0fa5..90ddf07ce34fe 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -259,7 +259,10 @@

Re: [PATCH 1/3] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver

2020-09-14 Thread jim . cromie
> > > > Please you should not be using netdev_info(). netdev_dbg() please. > > > > I changed most netif_msg_*()+netdev_*() to netif_*(), including > netif_dbg() in several places. However, after reading other drivers I > decided to leave this at INFO level. I think this is the way to go, > because

Re: kernel BUG at /usr/src/kernel/lib/dynamic_debug.c:267!

2020-09-09 Thread jim . cromie
On Wed, Sep 9, 2020 at 6:24 AM Greg Kroah-Hartman wrote: > > On Wed, Sep 09, 2020 at 10:00:25AM +0200, Petr Mladek wrote: > > On Wed 2020-09-09 14:47:45, Masami Hiramatsu wrote: > > > Hi Naresh, > > > > > > Thanks for reporting, it seems that you have run the > > >

Re: [dyndbg] 70f06a871f: kernel_BUG_at_lib/dynamic_debug.c

2020-09-07 Thread jim . cromie
quot;foo bar"") > url: > https://github.com/0day-ci/linux/commits/Jim-Cromie/dyndbg-cleanups-for-5-9/20200901-022403 > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git > f75aef392f869018f78cfedf3c320a6b3fcfda6b > > in testcase: kernel-selftests

[PATCH v3 1/3] dyndbg: give %3u width in pr-format, cosmetic only

2020-08-31 Thread Jim Cromie
Specify the print-width so log entries line up nicely. 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 1d012e597cc3..01b7d0210412 100644 --- a/lib

[PATCH v3 0/3] dyndbg: cleanups for 5.9

2020-08-31 Thread Jim Cromie
3 items for v5.9-rc fixed width format %3u in debug output - cosmetic fix export: ddebug_exec_queries -> dynamic_debug_exec_queries fix format="foo bar" parsing Jim Cromie (3): dyndbg: give %3u width in pr-format, cosmetic only dyndbg: refine export, rename to dynamic_debug

[PATCH v3 2/3] dyndbg: refine export, rename to dynamic_debug_exec_queries()

2020-08-31 Thread Jim Cromie
copy query string to a local buffer, so users can pass hard-coded/RO queries, and internal function can be used unchanged. Fixes: 4c0d77828d4f ("dyndbg: export ddebug_exec_queries") --- v2- code improvements, per Joe Perches v3- commit message fixups Signed-off-by: Jim Cromie --- include/l

[PATCH v3 3/3] dyndbg: fix problem parsing format="foo bar"

2020-08-31 Thread Jim Cromie
like file=bar and module=foo") --- -v3 commit message, checkpatch fixes Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 08e4b0575

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

2020-08-26 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

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

2020-08-26 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-26 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-26 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-26 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 v2 3/3] dyndbg: fix problem parsing format="foo bar"

2020-08-25 Thread Jim Cromie
tokenizer by terminating an unquoted token on the '=', avoiding that problem. And since ddebug-parse-query will never see a combined 'keyword=value', revert those parts of the previous commit. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 33 ++--- 1 file changed, 14

[PATCH-v2 0/3] dynamic-debug fixups for 5.9

2020-08-25 Thread Jim Cromie
- fix new export name, with a wrapper for more utility. now with fixes per Joe Perches - parse format="foo bar" like "format" "foo bar" - pretty-print Jim Cromie (3): dyndbg: give %3u width in pr-format, cosmetic only dyndbg: refine export, rename

[PATCH v2 1/3] dyndbg: give %3u width in pr-format, cosmetic only

2020-08-25 Thread Jim Cromie
Specify the print-width so log entries line up nicely. 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 1d012e597cc3..01b7d0210412 100644 --- a/lib

[PATCH v2 2/3] dyndbg: refine export, rename to dynamic_debug_exec_queries()

2020-08-25 Thread Jim Cromie
v5.9.0 Implement as new function wrapping ddebug_exec_queries(now static again), which copies the query-string, preserving ddebug_exec_queries' in-place parsing, while allowing users to pass const strings. -- v2- fixes per Joe Perches Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 20

  1   2   3   4   >