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

2020-08-24 Thread Jim Cromie
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". Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 20 +++

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

2020-08-24 Thread Jim Cromie
- fix new export name, with a wrapper for more utility. - 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 to dynamic_debug_exec_queries() dynd

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

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

2020-08-24 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 2/2] dyndbg: give %3u width in pr-format, cosmetic only

2020-08-14 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 0/2] for-5.9rc1 dyndbg fixes

2020-08-14 Thread Jim Cromie
2 items for v5.9-rc1 fix sparse complaint about exported ddebug_exec_queries fixed width format %3u Jim Cromie (2): dyndbg: add decl for exported ddebug_exec_queries() dyndbg: give %3u width in pr-format, cosmetic only include/linux/dynamic_debug.h | 3 +++ lib/dynamic_debug.c

[PATCH 1/2] dyndbg: add decl for exported ddebug_exec_queries()

2020-08-14 Thread Jim Cromie
59cf47e7df31 dyndbg: export ddebug_exec_queries elicited a sparse complaint. Add declaration to header file. I skipped the kerneldoc for now, unsure where it should go. Ive seen it in .c files, Im leaning that way. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 3 +++ 1 file

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

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

Re: [PATCH 3/7] dyndbg: select ZPOOL in Kconfig.debug

2020-08-09 Thread jim . cromie
On Sat, Aug 8, 2020 at 11:06 PM Randy Dunlap wrote: > > On 8/7/20 1:09 PM, Jim Cromie wrote: > > dyndbg will next need zs_malloc and friends, so add config reqs now, > > to avoid touching make-deps late in a patch-set. > > > > I used select in order not to hide dy

[PATCH 0/7] dyndbg: WIP diet plan

2020-08-07 Thread Jim Cromie
together nicely until the "cache" commit, when it blows up starting init (or right after freeing unused kernel image, which Im hoping to do...). last commit log has the BUG trace from a LOCKDEP build, which reports stuff I dont quite undertand, except that it looks bad. Jim Cromie (7)

[PATCH 4/7] dyndbg: split struct _ddebug in 2, creating _ddebug_callsite

2020-08-07 Thread Jim Cromie
ction. I suspect keep may go as a part of effecting the section reclaim. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 4 +++ include/linux/dynamic_debug.h | 35 +++-- lib/dynamic_debug.c | 52 +-- 3 files changed, 58 ins

[PATCH 2/7] dyndbg: motivate a diet plan

2020-08-07 Thread Jim Cromie
this table dramatically. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 01b7d0210412..691e79826fc2 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c

[PATCH 3/7] dyndbg: select ZPOOL in Kconfig.debug

2020-08-07 Thread Jim Cromie
dyndbg will next need zs_malloc and friends, so add config reqs now, to avoid touching make-deps late in a patch-set. I used select in order not to hide dyndbg inadvertently. I want to say recommends, since it could be an optional feature. Whats the best way ? Signed-off-by: Jim Cromie --- lib

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

2020-08-07 Thread Jim Cromie
he locking in ddebug_add_module(). Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index fdf52a26a504..701d3d1fb7e7 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1182,

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

2020-08-07 Thread Jim Cromie
zram/etc - zram compression - eventually swap it out entirely - map in the enabled callsites only Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 + lib/dynamic_debug.c | 156 +++--- 2 files changed, 145 insertions(+), 12 deletions(-)

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

2020-08-07 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 6/8] dyndbg: ddebug_zpool_remove

2020-08-07 Thread Jim Cromie
add ddebug_zpool_remove() to undo ddebug_zpool_add(), and call it from ddebug_remove_module(). Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 049299027fb3..102f47b2a439

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

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

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

2020-08-07 Thread Jim Cromie
that protection. This commit adds locking to ddebug_zpool_init(), around the loop of ddebug_zpool_add(), to match the locking in ddebug_add_module(). Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH v5 07/18] dyndbg: fix a BUG_ON in ddebug_describe_flags

2020-07-19 Thread Jim Cromie
a struct to a member in that struct, and hoist the member deref up to the caller. This makes the function reusable (soon) where flags are unpacked. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib

[PATCH v5 14/18] dyndbg: accept query terms like file=bar and module=foo

2020-07-19 Thread Jim Cromie
Current code expects "keyword" "arg" as 2 words, space separated. Change to also accept "keyword=arg" form as well, and drop !(nwords%2) requirement. Then in rest of function, use new keyword, arg variables instead of word[i], word[i+1] Signed-off-by: Jim Cromie

[PATCH v5 11/18] dyndbg: use gcc ?: to reduce word count

2020-07-19 Thread Jim Cromie
reduce word count via gcc ?: extension, no actual code change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e879af4e66e0..6d0159075308 100644 --- a/lib

[PATCH v5 08/18] dyndbg: fix pr_err with empty string

2020-07-19 Thread Jim Cromie
this pr_err attempts to print the string after the OP, but the string has been parsed and chopped up, so looks empty. 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

[PATCH v5 12/18] dyndbg: refactor parse_linerange out of ddebug_parse_query

2020-07-19 Thread Jim Cromie
Make the code-block reusable to later handle "file foo.c:101-200" etc. This is a 99% code move, with reindent, function wrap, +pr_debug. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 63 ++--- 1 file changed, 36

[PATCH v5 18/18] dyndbg: export ddebug_exec_queries

2020-07-19 Thread Jim Cromie
bug_change vs "module=* +p". ISTM this proposed export presents no locking problems. TLDR; It would be interesting to see how drm.dyndbg=$QUERY and drm.debug=$HEXY would interact; it might be order dependent, as if given as modprobe args or in /etc/modprobe.d/ Signed-off-by: Jim C

[PATCH v5 17/18] dyndbg: shorten our logging prefix, drop __func__

2020-07-19 Thread Jim Cromie
For log-message output, reduce column space consumed by current pr_fmt by dropping __func__ and shortening "dynamic_debug" to "dyndbg". This improves readability on narrow consoles, and better matches other kernel boot info messages. Signed-off-by: Jim Cromie --- lib/dynam

[PATCH v5 16/18] dyndbg: allow anchored match on format query term

2020-07-19 Thread Jim Cromie
cit wildcards. This makes no attempt at wider regex features, just the one we need. TLDR: Using the anchor also means the []s are less helpful for disamiguating the prefix from a random in-message occurrence, allowing shorter prefixes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 13

[PATCH v5 06/18] dyndbg: fix overcounting of ram used by dyndbg

2020-07-19 Thread Jim Cromie
. Heres my overhead, on a virtme-run VM on a fedora-31 laptop: dynamic_debug:dynamic_debug_init: 260 modules, 2479 entries \ and 10400 bytes in ddebug tables, 138824 bytes in __dyndbg section Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 8 ++-- 1 file changed, 2 insertions

[PATCH v5 15/18] dyndbg: combine flags & mask into a struct, simplify with it

2020-07-19 Thread Jim Cromie
er, less stack overhead no functional changes Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 45 - 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index fad6c34c930d..c983049e986d 100644 -

[PATCH v5 09/18] dyndbg: prefer declarative init in caller, to memset in callee

2020-07-19 Thread Jim Cromie
ddebug_exec_query declares an auto var, and passes it to ddebug_parse_query, which memsets it before using it. Drop that memset, instead initialize the variable in the caller; let the compiler decide how to do it. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 3 +-- 1 file changed, 1

[PATCH v5 04/18] dyndbg: refine debug verbosity; 1 is basic, 2 more chatty

2020-07-19 Thread Jim Cromie
emove)_module() also print 1 line per action on a module, not needed by typical modprobe user. This leaves verbose=1 better focussed on the >control parsing process. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-)

[PATCH v5 03/18] dyndbg: drop obsolete comment on ddebug_proc_open

2020-07-19 Thread Jim Cromie
commit 4bad78c55002 ("lib/dynamic_debug.c: use seq_open_private() instead of seq_open()")' The commit was one of a tree-wide set which replaced open-coded boilerplate with a single tail-call. It therefore obsoleted the comment about that boilerplate, clean that up now. Signed-o

[PATCH v5 13/18] dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'

2020-07-19 Thread Jim Cromie
# wildcards still work path/to/file.c:*_foo # lead wildcard too 1st 2 examples are treated as line-ranges, 3-5 are treated as func's Doc these changes, and sprinkle in a few extra wild-card examples and trailing # explanation texts. Signed-off-by: Jim Cromie --- .../admin-guide/

[PATCH v5 10/18] dyndbg: make ddebug_tables list LIFO for add/remove_module

2020-07-19 Thread Jim Cromie
loadable modules are the last in on this list, and are the only modules that could be removed. ddebug_remove_module() searches from head, but ddebug_add_module() uses list_add_tail(). Change it to list_add() for a micro-optimization. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1

[PATCH v5 05/18] dyndbg: rename __verbose section to __dyndbg

2020-07-19 Thread Jim Cromie
dyndbg populates its callsite info into __verbose section, change that to a more specific and descriptive name, __dyndbg. Also, per checkpatch: simplify __attribute(..) to __section(__dyndbg) declaration. and 1 spelling fix, decriptor Signed-off-by: Jim Cromie --- include/asm-generic

[PATCH v5 01/18] dyndbg-docs: eschew file /full/path query in docs

2020-07-19 Thread Jim Cromie
th, and it safely does nothing otherwize. So instead, quietly deprecate "file /full/path" query form, by removing all /full/paths examples in the docs. I skipped adding a back-compat note. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 19 +---

[PATCH v5 02/18] dyndbg-docs: initialization is done early, not arch

2020-07-19 Thread Jim Cromie
since cf964976484 in 2012, initialization is done with early_initcall, update the Docs, which still say arch_initcall. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin

[PATCH v5 00/18] dynamic_debug fixes, cleanups, features, export

2020-07-19 Thread Jim Cromie
han2 could be wired to a callback which invokes ddebug_exec_queries to toggle arbitary groups of pr_debug callsites. Useful callsite groups would exploit existing message-prefix classifcation schemes: "format=^[IF_TRACE]: +p; format=^[SURFACE]: +p" >control Jim Cromie (18): dynd

Re: [PATCH v4 13/17] dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'

2020-07-16 Thread jim . cromie
> > @@ -321,6 +321,8 @@ static int parse_linerange(struct ddebug_query *query, > > const char *first) > > } else { > > query->last_lineno = query->first_lineno; > > } > > + vpr_info("parsed line %d-%d\n", query->first_lineno, > > + query->last_lineno); >

[PATCH v2] kernel/module: add name size info to pr_debug() calls

2020-06-30 Thread Jim Cromie
ding clutter or or too much info. Now a reader can know which module's info they're looking at, or which 2 modules they are comparing. -- v2 has: better commit message s/:%s/%s:/ s/final/Final/ Signed-off-by: Jim Cromie --- kernel/module.c | 14 +++--- 1 file changed, 7 insertions(+), 7 delet

Re: [PATCH] kernel/module: add name size info to pr_debug() calls

2020-06-30 Thread jim . cromie
On Tue, Jun 30, 2020 at 3:37 AM Jessica Yu wrote: > > +++ Jim Cromie [11/06/20 08:20 -0600]: > >when booted with arg: module.dyndbg=+p > >dmesg gets volumes of info about loaded modules. > >This adds module & symbol names, and sizes where pertinent. > >Now

[PATCH v4 06/17] dyndbg: fix overcounting of ram used by dyndbg

2020-06-20 Thread Jim Cromie
. Heres my overhead, on a virtme-run VM on a fedora-31 laptop: dynamic_debug:dynamic_debug_init: 260 modules, 2479 entries \ and 10400 bytes in ddebug tables, 138824 bytes in __dyndbg section Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 8 ++-- 1 file changed, 2 insertions

[PATCH v4 10/17] dyndbg: make ddebug_tables list LIFO for add/remove_module

2020-06-20 Thread Jim Cromie
loadable modules are the last in on this list, and are the only modules that could be removed. ddebug_remove_module() searches from head, but ddebug_add_module() uses list_add_tail(). Change it to list_add() for a micro-optimization. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1

[PATCH v4 11/17] dyndbg: use gcc ?: to reduce word count

2020-06-20 Thread Jim Cromie
reduce word count via gcc ?: extension, no actual code change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e879af4e66e0..6d0159075308 100644 --- a/lib

[PATCH v4 08/17] dyndbg: fix pr_err with empty string

2020-06-20 Thread Jim Cromie
this pr_err attempts to print the string after the OP, but the string has been parsed and chopped up, so looks empty. 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

[PATCH v4 02/17] dyndbg-docs: initialization is done early, not arch

2020-06-20 Thread Jim Cromie
since cf964976484 in 2012, initialization is done with early_initcall, update the Docs, which still say arch_initcall. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin

[PATCH v4 04/17] dyndbg: refine debug verbosity; 1 is basic, 2 more chatty

2020-06-20 Thread Jim Cromie
emove)_module() also print 1 line per action on a module, not needed by typical modprobe user. This leaves verbose=1 better focussed on the >control parsing process. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-)

[PATCH v4 03/17] dyndbg: drop obsolete comment on ddebug_proc_open

2020-06-20 Thread Jim Cromie
commit 4bad78c55002 ("lib/dynamic_debug.c: use seq_open_private() instead of seq_open()")' The commit was one of a tree-wide set which replaced open-coded boilerplate with a single tail-call. It therefore obsoleted the comment about that boilerplate, clean that up now. Signed-o

[PATCH v4 14/17] dyndbg: accept query terms like file=bar and module=foo

2020-06-20 Thread Jim Cromie
Current code expects "keyword" "arg" as 2 space separated words. Change to also accept "keyword=arg" form as well, and drop !(nwords%2) requirement. Then in rest of function, use new keyword, arg variables instead of word[i], word[i+1] Signed-off-by: Jim Cromie

[PATCH v4 07/17] dyndbg: fix a BUG_ON in ddebug_describe_flags

2020-06-20 Thread Jim Cromie
a struct to a member in that struct, and hoist the member deref up to the caller. This makes the function reusable (soon) where flags are unpacked. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib

[PATCH v4 17/17] dyndbg: combine flags & mask into a struct, simplify with it

2020-06-20 Thread Jim Cromie
er, less stack overhead no functional changes Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 45 - 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d737c733967a..c0bc78d67b36 100644 -

[PATCH v4 16/17] dyndbg: allow anchored match on format query term

2020-06-20 Thread Jim Cromie
ason to prefer either of forms 1 or 2. Its case-by-case, judging brevity, clarity, and query specificity and robustness. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c in

[PATCH v4 09/17] dyndbg: prefer declarative init in caller, to memset in callee

2020-06-20 Thread Jim Cromie
ddebug_exec_query declares an auto var, and passes it to ddebug_parse_query, which memsets it before using it. Drop that memset, instead initialize the variable in the caller; let the compiler decide how to do it. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 3 +-- 1 file changed, 1

[PATCH v4 00/17] dynamic_debug cleanups, query features, export

2020-06-20 Thread Jim Cromie
://lore.kernel.org/lkml/20200613155738.2249399-1-jim.cro...@gmail.com/ v1: https://lore.kernel.org/lkml/20200605162645.289174-1-jim.cro...@gmail.com/ Jim Cromie (17): Patchset starts with 11 cleanups; - change section name from vague "__verbose" to "__dyndbg" - cleaner docs, d

[PATCH v4 13/17] dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'

2020-06-20 Thread Jim Cromie
# wildcards still work path/to/file.c:*_foo # lead wildcard too 1st 2 examples are treated as line-ranges, 3,4 are treated as func's Doc these changes, and sprinkle in a few extra wild-card examples and trailing # explanation texts. Signed-off-by: Jim Cromie --- .../admin-guide/

[PATCH v4 15/17] dyndbg: export ddebug_exec_queries

2020-06-20 Thread Jim Cromie
submitted via export will have module specified, which dramatically cuts matching work done by ddebug_change vs "module=* +p". ISTM this proposed export presents no locking problems. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH v4 05/17] dyndbg: rename __verbose section to __dyndbg

2020-06-20 Thread Jim Cromie
dyndbg populates its callsite info into __verbose section, change that to a more specific and descriptive name, __dyndbg. Also, per checkpatch: simplify __attribute(..) to __section(__dyndbg) declaration. and 1 spelling fix, decriptor Signed-off-by: Jim Cromie --- include/asm-generic

[PATCH v4 12/17] dyndbg: refactor parse_linerange out of ddebug_parse_query

2020-06-20 Thread Jim Cromie
Make the code-block reusable to later handle "file foo.c:101-200" etc. This is a 99% code move, with reindent, function wrap & call, etc. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 61 + 1 file changed, 34 insertions(+), 27 dele

[PATCH v4 01/17] dyndbg-docs: eschew file /full/path query in docs

2020-06-20 Thread Jim Cromie
th, and it safely does nothing otherwize. So instead, quietly deprecate "file /full/path" query form, by removing all /full/paths examples in the docs. I skipped adding a back-compat note. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 19 +---

Re: [PATCH v3 20/21] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-18 Thread jim . cromie
On Thu, Jun 18, 2020 at 4:34 PM Stanimir Varbanov wrote: > > Hi Jason, Jim, > > > I would be curious to see what Stanimir thinks of this proposal > > and whether it would work for his venus driver, which is what > > prompted this module group discussion. > > Hmm, we spin in a circle :) > >

Re: [PATCH v3 14/21] dyndbg: accept query terms like file=bar and module=foo

2020-06-18 Thread jim . cromie
oops. got 3 copies of 14/21, this is the good one. with module=foo AND file=bar On Wed, Jun 17, 2020 at 10:26 AM Jim Cromie wrote: > > Current code expects "keyword" "arg" as 2 space separated words. > Change to also accept "keyword=arg" form as w

Re: [PATCH v3 20/21] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-18 Thread jim . cromie
On Thu, Jun 18, 2020 at 1:40 PM Jason Baron wrote: > > > > On 6/18/20 3:11 PM, jim.cro...@gmail.com wrote: > > On Thu, Jun 18, 2020 at 12:17 PM Jason Baron wrote: > >> > > > >> The grouping stuff is already being used by lots of modules so > >> that seems useful. > > > > I now dont see the

Re: [PATCH v3 20/21] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-18 Thread jim . cromie
On Thu, Jun 18, 2020 at 12:17 PM Jason Baron wrote: > > > > On 6/18/20 1:40 PM, Petr Mladek wrote: > > On Thu 2020-06-18 18:19:12, Petr Mladek wrote: > >> On Wed 2020-06-17 10:25:35, Jim Cromie wrote: > >>> 1. Add a user-flag [u] which works like the

Re: [PATCH v3 20/21] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-18 Thread jim . cromie
On Thu, Jun 18, 2020 at 10:19 AM Petr Mladek wrote: > > On Wed 2020-06-17 10:25:35, Jim Cromie wrote: OK. Please tell me how this chunk of prose fails to explain a use case for the u-flag we can differ on how useful it looks. if u-flag is useful, then filtering on flags is also needed,

Re: [PATCH v3 19/21] dyndbg: extend ddebug_parse_flags to accept optional leading filter-flags

2020-06-18 Thread jim . cromie
On Thu, Jun 18, 2020 at 6:44 AM Petr Mladek wrote: > > On Wed 2020-06-17 10:25:34, Jim Cromie wrote: > > Change ddebug_parse_flags to accept optional filterflags before the > > required operator [-+=]. Read the flags into the filter_flags > > parameter added in the prev

Re: [PATCH v3 20/21] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-17 Thread jim . cromie
On Wed, Jun 17, 2020 at 4:13 PM Joe Perches wrote: > > On Wed, 2020-06-17 at 10:25 -0600, Jim Cromie wrote: > > 1. Add a user-flag [u] which works like the [pfmlt] flags, but has no > > effect on callsite behavior; it allows incremental marking of > > arbitrary sets of c

[PATCH v3 19/21] dyndbg: extend ddebug_parse_flags to accept optional leading filter-flags

2020-06-17 Thread Jim Cromie
t+p; lt+p;' >control You just can't prohibit true flags. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 18 lib/dynamic_debug.c | 29 ++- 2 files changed, 28 insertions(+), 19 deletions(-) diff

[PATCH v3 20/21] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-17 Thread Jim Cromie
te subgroups of callsites, then enable those groups by filtering on just their flagstates, or you could add further constraints on callsite selection. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 31 --- include/linux/dynamic_debug.h

[PATCH v3 13/21] dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'

2020-06-17 Thread Jim Cromie
# wildcards still work path/to/file.c:*_foo # lead wildcard too 1st 2 examples are treated as line-ranges, 3,4 are treated as func's Doc these changes, and sprinkle in a few extra wild-card examples and trailing # explanation texts. Signed-off-by: Jim Cromie --- .../admin-guide/

[PATCH v3 07/21] dyndbg: fix a BUG_ON in ddebug_describe_flags

2020-06-17 Thread Jim Cromie
a struct to a member in that struct, and hoist the member deref up to the caller. This makes the function reusable (soon) where flags are unpacked. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib

[PATCH v3 21/21] dyndbg: allow negating flag-chars in modifier flags

2020-06-17 Thread Jim Cromie
$qtrms f-ft > control # for a callsite subset, if f-bit is true, clear 2 bits, preserve others Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++ lib/dynamic_debug.c | 6 -- 2 files changed, 10 insertions(+),

[PATCH v3 15/21] dyndbg: export ddebug_exec_queries

2020-06-17 Thread Jim Cromie
s each. Any arbitrary subset is. drm.dyndbg='file drm_gem_* +p' # gem debug drm.dyndbg='file *_gem_* +p' # *gem debug With this proposed export, drm authors could exec these examples, most likely in the callback that handles updates to the drm.debug variable. Signed-off-by: Jim Cro

[PATCH v3 14/21] dyndbg: accept query terms like file=bar module=foo

2020-06-17 Thread Jim Cromie
Current code expects "keyword" "arg" as 2 space separated words. Change to also accept "keyword=arg" form as well, and drop !(nwords%2) requirement. Then in rest of function, use new keyword, arg variables instead of word[i], word[i+1] Signed-off-by: Jim Cromie

[PATCH v3 02/21] dyndbg-docs: initialization is done early, not arch

2020-06-17 Thread Jim Cromie
since cf964976484 in 2012, initialization is done with early_initcall, update the Docs, which still say arch_initcall. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin

[PATCH v3 04/21] dyndbg: refine debug verbosity; 1 is basic, 2 more chatty

2020-06-17 Thread Jim Cromie
emove)_module() also print 1 line per action on a module, not needed by typical modprobe user. This leaves verbose=1 better focussed on the >control parsing process. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-)

[PATCH v3 12/21] dyndbg: refactor parse_linerange out of ddebug_parse_query

2020-06-17 Thread Jim Cromie
Make the code-block reusable to later handle "file foo.c:101-200" etc. This is a 99% code move, with reindent, function wrap & call, etc. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 61 + 1 file changed, 34 insertions(+), 27 dele

[PATCH v3 17/21] dyndbg: refactor ddebug_read_flags out of ddebug_parse_flags

2020-06-17 Thread Jim Cromie
Move flag-char reading and validating code to a separate function. This will allow later reuse to read 2 sets of flags: 1- flags to set or clear (after the [=-+] Operator) 2- flags to require or prohibit before changing a callsite's flagstate Signed-off-by: Jim Cromie --- lib

[PATCH v3 14/21] dyndbg: accept query terms like file=bar and module=foo

2020-06-17 Thread Jim Cromie
Current code expects "keyword" "arg" as 2 space separated words. Change to also accept "keyword=arg" form as well, and drop !(nwords%2) requirement. Then in rest of function, use new keyword, arg variables instead of word[i], word[i+1] Signed-off-by: Jim Cromie

[PATCH v3 11/21] dyndbg: use gcc ?: to reduce word count

2020-06-17 Thread Jim Cromie
reduce word count via gcc ?: extension, no actual code change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e879af4e66e0..6d0159075308 100644 --- a/lib

[PATCH v3 06/21] dyndbg: fix overcounting of ram used by dyndbg

2020-06-17 Thread Jim Cromie
. Heres my overhead, on a virtme-run VM on a fedora-31 laptop: dynamic_debug:dynamic_debug_init: 260 modules, 2479 entries \ and 10400 bytes in ddebug tables, 138824 bytes in __dyndbg section Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 8 ++-- 1 file changed, 2 insertions

[PATCH v3 09/21] dyndbg: prefer declarative init in caller, to memset in callee

2020-06-17 Thread Jim Cromie
ddebug_exec_query declares an auto var, and passes it to ddebug_parse_query, which memsets it before using it. Drop that memset, instead initialize the variable in the caller; let the compiler decide how to do it. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 3 +-- 1 file changed, 1

[PATCH v3 10/21] dyndbg: make ddebug_tables list LIFO for add/remove_module

2020-06-17 Thread Jim Cromie
loadable modules are the last in on this list, and are the only modules that could be removed. ddebug_remove_module() searches from head, but ddebug_add_module() uses list_add_tail(). Change it to list_add() for a micro-optimization. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1

[PATCH v3 18/21] dyndbg: add filter channel to the internals

2020-06-17 Thread Jim Cromie
doesn't alter any of its arguments, including its 2 new ones; mods, filter. Say so by adding const modifier to them. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c

[PATCH v3 16/21] dyndbg: combine flags & mask into a struct, simplify with it

2020-06-17 Thread Jim Cromie
ings and returns - ddebug_change - test all callsites against query, modify passing sites. benefits: - bit-banging always needs flags & mask, best together. - simpler function signatures - 1 less parameter, less stack overhead Signed-off-by: Jim Cromie --- lib/dynamic

[PATCH v3 14/21] dyndbg: accept query terms like module:foo and file=bar

2020-06-17 Thread Jim Cromie
Current code expects "keyword" "arg" as 2 space separated words. Change to also accept "keyword=arg" form as well, and drop !(nwords%2) requirement. Then in rest of function, use new keyword,arg variables instead of word[i],word[i+1] Signed-off-by: Jim Cromie

[PATCH v3 08/21] dyndbg: fix pr_err with empty string

2020-06-17 Thread Jim Cromie
this pr_err attempts to print the string after the OP, but the string has been parsed and chopped up, so looks empty. 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

[PATCH v3 05/21] dyndbg: rename __verbose section to __dyndbg

2020-06-17 Thread Jim Cromie
dyndbg populates its callsite info into __verbose section, change that to a more specific and descriptive name, __dyndbg. Also, per checkpatch: simplify __attribute(..) to __section(__dyndbg) declaration. and 1 spelling fix, decriptor Signed-off-by: Jim Cromie --- include/asm-generic

[PATCH v3 03/21] dyndbg: drop obsolete comment on ddebug_proc_open

2020-06-17 Thread Jim Cromie
commit 4bad78c55002 ("lib/dynamic_debug.c: use seq_open_private() instead of seq_open()")' The commit was one of a tree-wide set which replaced open-coded boilerplate with a single tail-call. It therefore obsoleted the comment about that boilerplate, clean that up now. Signed-o

[PATCH v3 00/21] dynamic_debug cleanups, query features, export

2020-06-17 Thread Jim Cromie
e-by-cleanups up front, which also decluttered these controversial patches; I think theres a cleanup value to the early rework patches, even if filterflags doesnt make it in. Ive reworked all the flag-features commit messages to improve the usefulness argument, hopefully well enough now. Jim Cromie (21

[PATCH v3 01/21] dyndbg-docs: eschew file /full/path query in docs

2020-06-17 Thread Jim Cromie
th, and it safely does nothing otherwize. So instead, quietly deprecate "file /full/path" query form, by removing all /full/paths examples in the docs. I skipped adding a back-compat note. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 19 +---

Re: [PATCH v2 19/24] dyndbg: accept query terms like module:foo and file=bar

2020-06-17 Thread jim . cromie
hi Petr > You made to do some research and I was wrong. For example, getopt() > operates with options and their arguments. So, 'keyword' and 'arg' names > look good after all. > > Well, I still think that only one syntax should be supported. And it > is better to distinguish keywords and

Re: [PATCH v2 20/24] dyndbg: WIP towards debug-print-class based callsite controls

2020-06-17 Thread jim . cromie
On Wed, Jun 17, 2020 at 3:52 AM Petr Mladek wrote: > > On Wed 2020-06-17 10:31:54, Daniel Thompson wrote: > > On Tue, Jun 16, 2020 at 02:05:27PM -0700, Joe Perches wrote: > > > On Tue, 2020-06-16 at 15:45 +0200, Petr Mladek wrote: > > > > On Sat 2020

Re: [PATCH v2 20/24] dyndbg: WIP towards debug-print-class based callsite controls

2020-06-16 Thread jim . cromie
> Or that meaning could be handled by merely issuing the fill-in activations. > In the module that wants debug levels > > echo module foo mflags 4 >control > auto generates same query 3 more times, with mflags 3 flags 2 mflags:1 > let me also note that just because a module might do the

Re: [PATCH v2 20/24] dyndbg: WIP towards debug-print-class based callsite controls

2020-06-16 Thread jim . cromie
hi Petr, On Tue, Jun 16, 2020 at 7:45 AM Petr Mladek wrote: > > On Sat 2020-06-13 09:57:34, Jim Cromie wrote: > > There are *lots* of ad-hoc debug printing solutions in kernel, > > this is a 1st attempt at providing a common mechanism for many of them. > > I agree

Re: [PATCH v2 19/24] dyndbg: accept query terms like module:foo and file=bar

2020-06-16 Thread jim . cromie
On Tue, Jun 16, 2020 at 5:57 AM Petr Mladek wrote: > > On Sat 2020-06-13 09:57:33, Jim Cromie wrote: > > Current code expects "keyword" "arg" as 2 space separated words. > > Change to also accept "keyword:arg" and "keyword=arg

Re: [PATCH v2 13/24] dyndbg: combine flags & mask into a struct, use that

2020-06-15 Thread jim . cromie
On Mon, Jun 15, 2020 at 9:14 AM Petr Mladek wrote: > > On Sat 2020-06-13 09:57:27, Jim Cromie wrote: > > combine flags & mask into a struct, and replace those 2 parameters in > > 3 functions: ddebug_change, ddebug_parse_flags, ddebug_read_flags, > > altering th

Re: [PATCH v2 10/24] dyndbg: refactor parse_linerange out of ddebug_parse_query

2020-06-15 Thread jim . cromie
On Mon, Jun 15, 2020 at 7:37 AM Petr Mladek wrote: > > On Sat 2020-06-13 09:57:24, Jim Cromie wrote: > > make the code-block reusable to later handle "file foo.c:101-200" etc. > > > This should be a 90%+ code-move, with minimal adaptations; reindent, > > and

Re: [PATCH v2 23/24] kset-example: add pr_debug()s for easy visibility of its operation

2020-06-15 Thread jim . cromie
On Sun, Jun 14, 2020 at 12:05 AM Greg KH wrote: > > On Sat, Jun 13, 2020 at 09:57:37AM -0600, Jim Cromie wrote: > > put pr_debug()s into most functions, to easily see code operate when > > module is loaded and used. > > > > #> dmesg -w & > > #> m

Re: [PATCH v2 07/24] dyndbg: fix a BUG_ON in ddebug_describe_flags

2020-06-15 Thread jim . cromie
On Mon, Jun 15, 2020 at 7:20 AM Petr Mladek wrote: > > On Sat 2020-06-13 09:57:21, Jim Cromie wrote: > In all patches is missing: > > Signed-off-by: Jim Cromie right, I missed the -s invoking format-patch, v3 will have them > > > --- >

Re: [PATCH v2 09/24] dyndbg: add maybe(str,"") macro to reduce code

2020-06-15 Thread jim . cromie
On Mon, Jun 15, 2020 at 7:28 AM Petr Mladek wrote: > > On Sat 2020-06-13 09:57:23, Jim Cromie wrote: > From my POV this makes the code less readable. Open coding is much > more clear than an ambiguous macro name. > > Best Regards, > Petr Im going with Joes approach,

<    1   2   3   4   >