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

2020-06-15 Thread jim . cromie
On Sat, Jun 13, 2020 at 10:14 AM Joe Perches wrote: > > On Sat, 2020-06-13 at 09:57 -0600, Jim Cromie wrote: > > +#define maybe(str, empty)( str ? str : empty ) > > This macro is unnecessary. > > An even shorter very commonly used gcc extension would be > >

Re: [PATCH v2 01/24] dyndbg-docs: eschew file /full/path query in docs

2020-06-14 Thread jim . cromie
On Sun, Jun 14, 2020 at 12:04 AM Greg KH wrote: > > On Sat, Jun 13, 2020 at 09:57:15AM -0600, Jim Cromie wrote: > > Regarding: > > --- > > .../admin-guide/dynamic-debug-howto.rst | 19 +-- > > 1 file changed, 9 insertions(+), 10 deletions(-)

[PATCH v2 16/24] dyndbg: prefer declarative init in caller, to memset in callee

2020-06-13 Thread Jim Cromie
drop memset in ddebug_parse_query, instead initialize the stack variable in the caller; let the compiler decide how to do it. --- lib/dynamic_debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 40436270d38a..b3c262c009d2

[PATCH v2 03/24] dyndbg: drop obsolete comment on ddebug_proc_open

2020-06-13 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. --- lib/dynamic_debug.c

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

2020-06-13 Thread Jim Cromie
ddebug_describe_flags currently fills a caller provided string buffer, after testing its size (also passed) in a BUG_ON. Fix this by replacing them with a known-big-enough string buffer wrapped in a struct, and passing that instead. Also simplify the flags parameter, and instead de-ref the flags

[PATCH v2 06/24] dyndbg: fix overcounting of ram used by dyndbg

2020-06-13 Thread Jim Cromie
during dyndbg init, verbose logging prints its ram overhead. It counted strlens of struct _ddebug's 4 string members, in all callsite entries, which would be approximately correct if each had been mallocd. But they are pointers into shared .rodata; for example, all 10 kobject callsites have

[PATCH v2 08/24] dyndbg: make ddebug_tables list LIFO for add/remove_module

2020-06-13 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. --- lib/dynamic_debug.c | 2 +- 1 file changed, 1

[PATCH v2 14/24] dyndbg: add filter parameter to ddebug_parse_flags

2020-06-13 Thread Jim Cromie
Add a new local *filter variable to ddebug_exec_query(), pass it into ddebug_parse_flags(), which fills it, communicating optional filter flags back to its caller. Then caller passes same to ddebug_change() to effect the changes. Also, ddebug_change doesn't alter any of its arguments, including

[PATCH v2 17/24] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-13 Thread Jim Cromie
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 callsites. 2. Add [PFMLTU] flags, which negate their counterparts; P===!p etc. And in ddebug_read_flags(): current code does: [pfmltu_] ->

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

2020-06-13 Thread Jim Cromie
put pr_debug()s into most functions, to easily see code operate when module is loaded and used. #> dmesg -w & #> modprobe kset-example dyndbg=+pfml #> cat /sys/kernel/kset-example/*/* --- samples/kobject/kset-example.c | 11 +++ 1 file changed, 11 insertions(+) diff --git

[PATCH v2 21/24] dyndbg: adapt header macros to pass print-class

2020-06-13 Thread Jim Cromie
derive DEFINE_DYNAMIC_DEBUG_METADATA_CL from DEFINE_DYNAMIC_DEBUG_METADATA then redefine latter as former(0, ...) Also rework /(_?_?dynamic_.+)/ macros, adding _cl suffix & cl arg1 and redefine them in terms of _cl version. in printk.h: add pr_debug_n, fix pr_debug use it with pr_cls=0 ---

[PATCH v2 15/24] dyndbg: extend ddebug_parse_flags to accept optional leading filter-flags

2020-06-13 Thread Jim Cromie
change ddebug_parse_flags to accept optional filterflags before OP. this now sets the parameter added in ~1 --- .../admin-guide/dynamic-debug-howto.rst | 18 +++ lib/dynamic_debug.c | 30 ++- 2 files changed, 28 insertions(+), 20

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

2020-06-13 Thread Jim Cromie
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 scafolding. --- lib/dynamic_debug.c | 61 + 1 file changed, 34 insertions(+), 27 deletions(-) diff --git

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

2020-06-13 Thread Jim Cromie
combine flags & mask into a struct, and replace those 2 parameters in 3 functions: ddebug_change, ddebug_parse_flags, ddebug_read_flags, altering the derefs in them accordingly. This simplifies the 3 function sigs, preparing for more changes. We dont yet need mask from ddebug_read_flags, but will

[PATCH v2 22/24] dyndbg: add print-class as trailing number to control output

2020-06-13 Thread Jim Cromie
This change adds trailing 0 for all existing callsites, and N>0 for any uses of pr_debug_n(). subsequent patches add pr_debug_n(1) & pr_debug_n(2) to kset-example, demonstrating that the callsite descriptors are getting initialized properly by the *_cl adaptations done previously. bash-5.0#

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

2020-06-13 Thread Jim Cromie
The verbose/debug logging done for `cat $MNT/dynamic_debug/control` is voluminous (2 per control file entry + 2 per PAGE). Moreover, it just prints pointer and sequence, which is not useful to a dyndbg user. So just drop them. Also require verbose>=2 for several other debug printks that are a

[PATCH v2 24/24] kset-example: use pr_debug_n to create example print-classes

2020-06-13 Thread Jim Cromie
Here is a (counter?) use-case for debug-print-classes. It adds read,write print-classes, and marks all pr_debugs in *_show and *_store functions accordingly. this allows manipulation of those categories as: echo "module kset-example mflags 1 +p" > /proc/dynamic_debug/control echo "module

[PATCH v2 12/24] dyndbg: refactor ddebug_read_flags out of ddebug_parse_flags

2020-06-13 Thread Jim Cromie
Currently, ddebug_parse_flags accepts [+-=][pflmt_]+ as flag-spec strings. If we allow [pflmt_]*[+-=][pflmt_]+ instead, the (new) 1st flagset can be used as a filter to select callsites, before applying changes in the 2nd flagset. 1st step is to split out the flags-reader so we can use it again.

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

2020-06-13 Thread Jim Cromie
Current code expects "keyword" "arg" as 2 space separated words. Change to also accept "keyword:arg" and "keyword=arg" forms as well, and drop !(nwords%2) requirement. Then in rest of function, use new keyword,arg variables instead of word[i],word[i+1] --- lib/dynamic_debug.c | 49

[PATCH v2 18/24] dyndbg: allow negating flag-chars in modflags

2020-06-13 Thread Jim Cromie
Extend flags modifications to allow [PFMLTU] negating flags. This allows control-queries like: #> Q () { echo file inode.c $* > control } # to type less #> Q -P # same as +p #> Q +U # same as -u #> Q u-P # same as u+p This allows flags in a callsite to be simultaneously

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

2020-06-13 Thread Jim Cromie
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. Basically, there are 2 styles of debug printing: - levels, with increasing verbosity, 1-10 forex - bits/flags, independently controlling separate groups of

[PATCH v2 11/24] dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'

2020-06-13 Thread Jim Cromie
Accept these additional query forms: echo "file $filestr +_" > control path/to/file.c:100 # as from control, column 1 path/to/file.c:1-100 # or any legal line-range path/to/file.c:func_A# as from an editor/browser path/to/file.c:drm_\*# wildcards

[PATCH v2 05/24] dyndbg: rename __verbose section to __dyndbg

2020-06-13 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 --- include/asm-generic/vmlinux.lds.h | 6 +++---

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

2020-06-13 Thread Jim Cromie
reduce word count via macro, no actual object change. OTOH, maybe() could be scrubbed if printk's default printing (iirc) of "(null)" pointers is deemed appropriate for the log-msg. --- lib/dynamic_debug.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH v2 01/24] dyndbg-docs: eschew file /full/path query in docs

2020-06-13 Thread Jim Cromie
Regarding: commit 2b6783191da7 ("dynamic_debug: add trim_prefix() to provide source-root relative paths") commit a73619a845d5 ("kbuild: use -fmacro-prefix-map to make __FILE__ a relative path") 2nd commit broke dynamic-debug's "file $fullpath" query form, but nobody noticed because 1st commit

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

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

[PATCH v2 00/24] dynamic_debug cleanups, query features, WIP print-classes

2020-06-13 Thread Jim Cromie
anges since: WIP print-classes rebase over a recent conflict in master 2 more "cleanups": Docs ~= s/arch_init/early_init/, maybe macro else coding style fix. thx JB commit message corrections, improvements based on comments Jim Cromie (24): cleanups: dyndbg-doc

Re: [PATCH 00/16] dynamic_debug: cleanups, 2 features

2020-06-12 Thread jim . cromie
On Fri, Jun 12, 2020 at 3:31 PM Jason Baron wrote: > > > > On 6/5/20 12:26 PM, Jim Cromie wrote: > > Patchset starts with 7 "cleanups"; > > - it changes section name from vague "__verbose" to "__dyndbg" > > - cleaner docs, drop obsolete

Re: [PATCH v3 6/7] venus: Make debug infrastructure more flexible

2020-06-11 Thread jim . cromie
calling out some thinkos On Thu, Jun 11, 2020 at 3:19 PM wrote: > > heres what I have in mind. whats described here is working. > I'll send it out soon > > commit 20298ec88cc2ed64269c8be7b287a24e60a5347e > Author: Jim Cromie > Date: Wed Jun 10 12:55:08 2020 -0600 > &

Re: [PATCH v3 6/7] venus: Make debug infrastructure more flexible

2020-06-11 Thread jim . cromie
d into a mask when we compare them to the mask provided > by the user. > > > Daniel. heres what I have in mind. whats described here is working. I'll send it out soon commit 20298ec88cc2ed64269c8be7b287a24e60a5347e Author: Jim Cromie Date: Wed Jun 10 12:55:08 2020 -0600

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

2020-06-11 Thread Jim Cromie
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 I can know which module's info Im looking at. --- kernel/module.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

Re: WIP generic module->debug_flags and dynamic_debug

2020-06-11 Thread jim . cromie
> > can anyone diagnose my problem ? > > Sorry, I have not the faintest idea of what you're trying to achieve. > Can you spell that out? > > Rasmus hey, sorry for the lack of context. Ive solved my problem, by adding (void*) to my container_of usage. WIP code now "works", but still incomplete.

WIP generic module->debug_flags and dynamic_debug

2020-06-10 Thread jim . cromie
so Ive got a WIP / broken / partial approach to giving all modules a u32 flagset, and enabling pr_debug based upon it. I leave out the "pr_debug_typed( bitpos )" for now. For Stanimir, bits 1,2,3 could be high, middle, low. ATM its broken on my lack of container_of() skills. Im trying to use

Re: [PATCH 03/16] dyndbg: refine debug verbosity; 1 is basic, 2 more chatty

2020-06-10 Thread jim . cromie
On Wed, Jun 10, 2020 at 5:16 AM Daniel Thompson wrote: > > On Tue, Jun 09, 2020 at 01:59:41PM -0600, jim.cro...@gmail.com wrote: > > On Mon, Jun 8, 2020 at 5:21 AM Daniel Thompson > > wrote: > > > > > > On Fri, Jun 05, 2020 at 10:26:32AM -0600, Jim Cromie wrot

Re: [PATCH v3 0/7] Venus dynamic debug

2020-06-09 Thread jim . cromie
On Tue, Jun 9, 2020 at 4:23 PM Joe Perches wrote: > > On Tue, 2020-06-09 at 15:21 -0600, jim.cro...@gmail.com wrote: > > > > As Joe noted, there is a lot of ad-hockery to possibly clean up, > > but I dont grok how these levels should be distinguished from > > KERN_(WARN|INFO|DEBUG) constants. > >

Re: [PATCH v3 0/7] Venus dynamic debug

2020-06-09 Thread jim . cromie
On Tue, Jun 9, 2020 at 10:49 AM Joe Perches wrote: > > (adding Jim Cromie and comments) > thanks for bringing me in... > On Tue, 2020-06-09 at 09:03 -0700, Randy Dunlap wrote: > > On 6/9/20 4:13 AM, Matthew Wilcox wrote: > > > On Tue, Jun 09, 2020 at 01:45:57PM +03

Re: [PATCH 03/16] dyndbg: refine debug verbosity; 1 is basic, 2 more chatty

2020-06-09 Thread jim . cromie
On Mon, Jun 8, 2020 at 5:21 AM Daniel Thompson wrote: > > On Fri, Jun 05, 2020 at 10:26:32AM -0600, Jim Cromie wrote: > > The verbose/debug logging done for `cat $MNT/dynamic_debug/control` is > > voluminous (2 per control file entry + 2 per PAGE). Moreover, it just

[PATCH 04/16] dyndbg: rename __verbose section to __dyndbg

2020-06-05 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 Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h

[PATCH 08/16] dyndbg: refactor parse_linerange out of ddebug_parse_query

2020-06-05 Thread Jim Cromie
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 scafolding. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 61 + 1 file changed, 34 inserti

[PATCH 14/16] dyndbg: prefer declarative init in caller, to memset in callee

2020-06-05 Thread Jim Cromie
drop memset in ddebug_parse_query, instead initialize the stack 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 insertion(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index

[PATCH 12/16] dyndbg: add filter parameter to ddebug_parse_flags

2020-06-05 Thread Jim Cromie
Add a new *filter param to ddebug_parse_flags(), allowing it to communicate optional filter flags back to its caller: ddebug_change() Also, ddebug_change 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

[PATCH 15/16] dyndbg: add user-flag, negating-flags, and filtering on flags

2020-06-05 Thread Jim Cromie
er flag isn't strictly needed, but with it you can avoid using [fmlt] flags for marking, which would alter logging when enabled. The negating flags allow filtering on either 0/1 for each flag. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 31 --- include

[PATCH 13/16] dyndbg: extend ddebug_parse_flags to accept optional leading filter-flags

2020-06-05 Thread Jim Cromie
change ddebug_parse_flags to accept optional filterflags before OP. this now sets the parameter added in ~1 Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 18 +++ lib/dynamic_debug.c | 30 ++- 2 files changed, 28

[PATCH 11/16] dyndbg: combine flags & mask into a struct, use that

2020-06-05 Thread Jim Cromie
lags, but will soon. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 46 +++-- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 005b8221a9d6..2ecabfd3f432 100644 --- a/lib/dynamic_debug.c +++ b

[PATCH 16/16] dyndbg: allow negating flag-chars in modflags

2020-06-05 Thread Jim Cromie
simultaneously set and cleared, while still starting with the current flagstate (with +- ops). Generally, you chose -p or +p 1st, then set or clear flags accordingly. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++ lib/

[PATCH 10/16] dyndbg: refactor ddebug_read_flags out of ddebug_parse_flags

2020-06-05 Thread Jim Cromie
e marked set, repeat #> echo 'fmlt+p' > control # activate Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 37 +++-- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8f250c67acbe..0

[PATCH 06/16] dyndbg: fix a BUG_ON in ddebug_describe_flags

2020-06-05 Thread Jim Cromie
struct in the caller; this makes the function reusable (soon) where flags are unpacked. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index

[PATCH 09/16] dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'

2020-06-05 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 07/16] dyndbg: make ddebug_tables list LIFO for add/remove_module

2020-06-05 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 02/16] dyndbg: drop obsolete comment on ddebug_proc_open

2020-06-05 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 01/16] dyndbg-docs: eschew file /full/path query in docs

2020-06-05 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 05/16] dyndbg: fix overcounting of ram used by dyndbg

2020-06-05 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 03/16] dyndbg: refine debug verbosity; 1 is basic, 2 more chatty

2020-06-05 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 00/16] dynamic_debug: cleanups, 2 features

2020-06-05 Thread Jim Cromie
gt; control This was previously submitted before events overtook. v1: https://lkml.org/lkml/2019/10/29/989 v2: https://lkml.org/lkml/2019/11/27/547 Jim Cromie (16): cleanups: dyndbg-docs: eschew file /full/path query in docs dyndbg: drop obsolete comment on ddebug_proc_open dyndbg: refine d

rcX probs, UBSAN complaints. one complaint about BIOS

2016-04-27 Thread Jim Cromie
hello good folks, recent rcXs have been misbehaving on my old Core-2 Duo box [jimc@popeye log]$ more /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz stepping : 10 microcode : 0xa0b the box seems to

rcX probs, UBSAN complaints. one complaint about BIOS

2016-04-27 Thread Jim Cromie
hello good folks, recent rcXs have been misbehaving on my old Core-2 Duo box [jimc@popeye log]$ more /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz stepping : 10 microcode : 0xa0b the box seems to

[PATCH] dyndbg: add pr_errs before -EINVALs

2012-11-14 Thread Jim Cromie
Ma noted that dynamic-debug is silent about many query errors, so add pr_err()s to explain those errors, and tweak a few others. Also parse flags 1st, so that match-spec errs are slightly clearer. To: Jason Baron CC: Jianpeng Ma CC: Joe Perches CC: Greg KH Signed-off-by: Jim Cromie --- lib

[PATCH] dyndbg: add pr_errs before -EINVALs

2012-11-14 Thread Jim Cromie
...@perches.com CC: Greg KH gre...@linuxfoundation.org Signed-off-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 51 +-- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e7f7d99

Re: [PATCH 3/6] dyndbg: add more info to -E2BIG log warning

2012-09-24 Thread Jim Cromie
On Mon, Sep 24, 2012 at 1:04 PM, Geert Uytterhoeven wrote: > On Mon, Sep 24, 2012 at 9:00 PM, Jason Baron wrote: >>> - pr_warn("expected <%d bytes into control\n", USER_BUF_PAGE); > > %u? > >>> + pr_warn("expected <%d bytes into control, you wrote %d\n", >>> +

Re: [PATCH 3/6] dyndbg: add more info to -E2BIG log warning

2012-09-24 Thread Jim Cromie
On Mon, Sep 24, 2012 at 1:04 PM, Geert Uytterhoeven ge...@linux-m68k.org wrote: On Mon, Sep 24, 2012 at 9:00 PM, Jason Baron jba...@redhat.com wrote: - pr_warn(expected %d bytes into control\n, USER_BUF_PAGE); %u? + pr_warn(expected %d bytes into control, you wrote

[PATCH 5/6] dyndbg: in dynamic_emit_prefix, change inter-field separator

2012-09-18 Thread Jim Cromie
wasnt a fan of this, but his complaint was essentially that cut -d: was a poor way to do this kind of thing. I concede that point, but note that the kernel is not in the habit of needlessly confounding users work, at least when accommodating them is so trivial. cc: Joe Perches Signed-off-by: Jim

[PATCH 4/6] dyndbg: increase verbosity for proc-show, proc-next

2012-09-18 Thread Jim Cromie
available should that appear useful later. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 85258a8..11a8897 100644 --- a/lib/dynamic_debug.c +++ b/lib

[PATCH 2/6] dyndbg: spelling fix s/conrol/control/

2012-09-18 Thread Jim Cromie
fix name of control file in comment 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 ceda053..43ae319 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -680,7 +680,7

[PATCH 1/6] dyndbg: fix usability bug by adding pr_errs for -EINVALs

2012-09-18 Thread Jim Cromie
A recent usability grumble on LKML prompted a review of error reporting when writing dyndbg queries. For each -EINVAL, this adds pr_err()s to explain the error. To: Jason Baron To: Greg Kroah-Hartman CC: Jianpeng Ma Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 40

[PATCH 6/6] dyndbg: change varname verbose_bytes to bytes_used

2012-09-18 Thread Jim Cromie
New name reflects purpose (count bytes used), verbose is just print condition, and counting proceeds either way. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index f1f7467

[PATCH 3/6] dyndbg: add more info to -E2BIG log warning

2012-09-18 Thread Jim Cromie
Tell user how big the attempted write was, in case its not obvious. This helped identify a missing flush in my stress-test script. 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

[PATCH 3/6] dyndbg: add more info to -E2BIG log warning

2012-09-18 Thread Jim Cromie
Tell user how big the attempted write was, in case its not obvious. This helped identify a missing flush in my stress-test script. Signed-off-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b

[PATCH 6/6] dyndbg: change varname verbose_bytes to bytes_used

2012-09-18 Thread Jim Cromie
New name reflects purpose (count bytes used), verbose is just print condition, and counting proceeds either way. Signed-off-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dynamic_debug.c b/lib

[PATCH 1/6] dyndbg: fix usability bug by adding pr_errs for -EINVALs

2012-09-18 Thread Jim Cromie
-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 40 ++-- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e7f7d99..ceda053 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c

[PATCH 2/6] dyndbg: spelling fix s/conrol/control/

2012-09-18 Thread Jim Cromie
fix name of control file in comment Signed-off-by: Jim Cromie jim.cro...@gmail.com --- 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 ceda053..43ae319 100644 --- a/lib/dynamic_debug.c +++ b/lib

[PATCH 4/6] dyndbg: increase verbosity for proc-show, proc-next

2012-09-18 Thread Jim Cromie
available should that appear useful later. Signed-off-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 85258a8..11a8897 100644 --- a/lib/dynamic_debug.c

[PATCH 5/6] dyndbg: in dynamic_emit_prefix, change inter-field separator

2012-09-18 Thread Jim Cromie
...@perches.com Signed-off-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 11a8897..f1f7467 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -556,16 +556,18

[PATCH] i2c/scx200_*: replace printks with pr_s

2012-09-14 Thread Jim Cromie
Replace printks with pr_s, add pr_fmt()s to replace NAMEs Signed-off-by: Jim Cromie --- drivers/i2c/busses/scx200_acb.c | 18 ++ drivers/i2c/busses/scx200_i2c.c | 12 +++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/scx200_acb.c b

[PATCH] i2c/scx200_*: replace printks with pr_levels

2012-09-14 Thread Jim Cromie
Replace printks with pr_levels, add pr_fmt()s to replace NAMEs Signed-off-by: Jim Cromie jim.cro...@gmail.com --- drivers/i2c/busses/scx200_acb.c | 18 ++ drivers/i2c/busses/scx200_i2c.c | 12 +++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH] dyndbg: fix usability bug by adding pr_errs for -EINVALs

2012-08-31 Thread Jim Cromie
A recent usability grumble on LKML prompted a review of error reporting when writing dyndbg queries. For each -EINVAL, this adds pr_err()s to explain the error. To: Jason Baron To: Greg Kroah-Hartman CC: Jianpeng Ma Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 40

[PATCH] dyndbg: fix usability bug by adding pr_errs for -EINVALs

2012-08-31 Thread Jim Cromie
-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 40 ++-- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 7ca29a0..dd477ab 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c

Re: [PATCH 0/5] dev_ and dynamic_debug cleanups

2012-08-30 Thread Jim Cromie
On Thu, Aug 30, 2012 at 11:43 AM, Jim Cromie wrote: > On Sun, Aug 26, 2012 at 5:25 AM, Joe Perches wrote: >> The recent commit to fix dynamic_debug was a bit unclean. >> Neaten the style for dynamic_debug. >> Reduce the stack use of message logging that uses netdev_

Re: [PATCH 0/5] dev_ and dynamic_debug cleanups

2012-08-30 Thread Jim Cromie
On Sun, Aug 26, 2012 at 5:25 AM, Joe Perches wrote: > The recent commit to fix dynamic_debug was a bit unclean. > Neaten the style for dynamic_debug. > Reduce the stack use of message logging that uses netdev_printk > Add utility functions dev_printk_emit and dev_vprintk_emit for /dev/kmsg. > >

Re: [PATCH 0/5] dev_level and dynamic_debug cleanups

2012-08-30 Thread Jim Cromie
On Sun, Aug 26, 2012 at 5:25 AM, Joe Perches j...@perches.com wrote: The recent commit to fix dynamic_debug was a bit unclean. Neaten the style for dynamic_debug. Reduce the stack use of message logging that uses netdev_printk Add utility functions dev_printk_emit and dev_vprintk_emit for

Re: [PATCH 0/5] dev_level and dynamic_debug cleanups

2012-08-30 Thread Jim Cromie
On Thu, Aug 30, 2012 at 11:43 AM, Jim Cromie jim.cro...@gmail.com wrote: On Sun, Aug 26, 2012 at 5:25 AM, Joe Perches j...@perches.com wrote: The recent commit to fix dynamic_debug was a bit unclean. Neaten the style for dynamic_debug. Reduce the stack use of message logging that uses

[PATCH] dyndbg: fix for SOH in logging messages

2012-08-18 Thread Jim Cromie
commit af7f2158fde was done against master, and clashed with structured logging's change of KERN_LEVEL to SOH. Bisected and fixed by Markus Trippelsdorf. CC: Markus Trippelsdorf Signed-off-by: Jim Cromie --- drivers/base/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] dyndbg: fix for SOH in logging messages

2012-08-18 Thread Jim Cromie
commit af7f2158fde was done against master, and clashed with structured logging's change of KERN_LEVEL to SOH. Bisected and fixed by Markus Trippelsdorf. CC: Markus Trippelsdorf mar...@trippelsdorf.de Signed-off-by: Jim Cromie jim.cro...@gmail.com --- drivers/base/core.c | 4 ++-- 1 file

[PATCH 2/2] dyndbg: add more info to -E2BIG log warning

2012-08-16 Thread Jim Cromie
ddebug_proc_write() warns if the written buffer is >4096 bytes. Might as well tell user how much was attempted, in case its not obvious. 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/

[PATCH 1/2] dyndbg: spelling fix in comment

2012-08-16 Thread Jim Cromie
Fix a comment referring to /dynamic_debug/conrol. It should be control. 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 7ca29a0..86d4065 100644 --- a/lib/dynamic_debug.c +++ b

[PATCH 0/2] dyndbg: trivial fixes

2012-08-16 Thread Jim Cromie
2 trivial patches here, suitable for 3.6: - fix spelling error in comment s/control/control - add write size attempted to log warning issued for E2BIG error -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More

[PATCH 0/2] dyndbg: trivial fixes

2012-08-16 Thread Jim Cromie
2 trivial patches here, suitable for 3.6: - fix spelling error in comment s/control/control - add write size attempted to log warning issued for E2BIG error -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More

[PATCH 1/2] dyndbg: spelling fix in comment

2012-08-16 Thread Jim Cromie
Fix a comment referring to debugfs/dynamic_debug/conrol. It should be control. Signed-off-by: Jim Cromie jim.cro...@gmail.com --- 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 7ca29a0..86d4065 100644

[PATCH 2/2] dyndbg: add more info to -E2BIG log warning

2012-08-16 Thread Jim Cromie
ddebug_proc_write() warns if the written buffer is 4096 bytes. Might as well tell user how much was attempted, in case its not obvious. Signed-off-by: Jim Cromie jim.cro...@gmail.com --- lib/dynamic_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c

Re: [PATCH 0/3] dyndbg: dev_dbg bugfix + 2 trivials

2012-07-24 Thread Jim Cromie
hi Jason ( Kay, I previously mis-addressed you at vrfy.com, so you havent received the thread directly until now. sorry about that) On Fri, Jul 20, 2012 at 2:38 PM, Jason Baron wrote: > On Thu, Jul 19, 2012 at 01:46:19PM -0600, Jim Cromie wrote: >> 3 patches here, 1st is bugfi

Re: [PATCH 0/3] dyndbg: dev_dbg bugfix + 2 trivials

2012-07-24 Thread Jim Cromie
hi Jason ( Kay, I previously mis-addressed you at vrfy.com, so you havent received the thread directly until now. sorry about that) On Fri, Jul 20, 2012 at 2:38 PM, Jason Baron jba...@redhat.com wrote: On Thu, Jul 19, 2012 at 01:46:19PM -0600, Jim Cromie wrote: 3 patches here, 1st is bugfix

Re: [PATCH 1/3] drivers-core: make structured logging play nice with dynamic-debug

2012-07-23 Thread Jim Cromie
On Mon, Jul 23, 2012 at 11:09 AM, Joe Perches wrote: > On Mon, 2012-07-23 at 09:07 -0400, Jason Baron wrote: >> On Thu, Jul 19, 2012 at 01:46:20PM -0600, Jim Cromie wrote: >> > commit c4e00daaa96d3a0786f1f4fe6456281c60ef9a16 changed __dev_printk >> > in a way that br

Re: [PATCH 1/3] drivers-core: make structured logging play nice with dynamic-debug

2012-07-23 Thread Jim Cromie
On Mon, Jul 23, 2012 at 11:09 AM, Joe Perches j...@perches.com wrote: On Mon, 2012-07-23 at 09:07 -0400, Jason Baron wrote: On Thu, Jul 19, 2012 at 01:46:20PM -0600, Jim Cromie wrote: commit c4e00daaa96d3a0786f1f4fe6456281c60ef9a16 changed __dev_printk in a way that broke dynamic-debug's

[PATCH 3/3] dyndbg: change varname verbose_bytes to sz_used

2012-07-19 Thread Jim Cromie
New name reflects purpose (count mem used), verbose is just print condition, and bytes is too generic. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 6bc34aa..0cc715c

[PATCH 2/3] dyndbg: in dynamic_emit_prefix, change inter-field separator

2012-07-19 Thread Jim Cromie
, but doesnt solve it entirely; if dyndbg==p is used, the callsite is enabled but no prefix is added, so theres one less ':' in the message. Changing the terminator to ',' would fix this, and might be warranted. pr_fmt(fmt) KBUILD_MODNAME ": " fmt, also adds another ':'. Signed-off-by:

[PATCH 1/3] drivers-core: make structured logging play nice with dynamic-debug

2012-07-19 Thread Jim Cromie
(), which just works. But otherwise, it assumed that level was always a string like "" and just plucked out the 'L', ignoring the rest. However, dynamic_emit_prefix() adds "[tid] module:func:line:" to the string, those additions all got lost. Signed-off-by: Jim Cromie --- driver

[PATCH 1/3] drivers-core: make structured logging play nice with dynamic-debug

2012-07-19 Thread Jim Cromie
(), which just works. But otherwise, it assumed that level was always a string like "" and just plucked out the 'L', ignoring the rest. However, dynamic_emit_prefix() adds "[tid] module:func:line:" to the string, those additions all got lost. Signed-off-by: Jim Cromie --- driver

[PATCH 0/3] dyndbg: dev_dbg bugfix + 2 trivials

2012-07-19 Thread Jim Cromie
3 patches here, 1st is bugfix, others are trivial. 1- fix __dev_printk, which broke dev_dbg() prefix under CONFIG_DYNAMIC_DEBUG. 2- change dyndbg prefix interfield separator from ':' to '.' for example (output from test-code, not submitted): r8169 :02:00.0: r8169.rtl_init_one: set-drvdata

[PATCH 0/3] dyndbg: dev_dbg bugfix + 2 trivials

2012-07-19 Thread Jim Cromie
3 patches here, 1st is bugfix, others are trivial. 1- fix __dev_printk, which broke dev_dbg() prefix under CONFIG_DYNAMIC_DEBUG. 2- change dyndbg prefix interfield separator from ':' to '.' for example (output from test-code, not submitted): r8169 :02:00.0: r8169.rtl_init_one: set-drvdata

[PATCH 1/3] drivers-core: make structured logging play nice with dynamic-debug

2012-07-19 Thread Jim Cromie
(), which just works. But otherwise, it assumed that level was always a string like L and just plucked out the 'L', ignoring the rest. However, dynamic_emit_prefix() adds [tid] module:func:line: to the string, those additions all got lost. Signed-off-by: Jim Cromie jim.cro...@gmail.com --- drivers/base

[PATCH 1/3] drivers-core: make structured logging play nice with dynamic-debug

2012-07-19 Thread Jim Cromie
(), which just works. But otherwise, it assumed that level was always a string like L and just plucked out the 'L', ignoring the rest. However, dynamic_emit_prefix() adds [tid] module:func:line: to the string, those additions all got lost. Signed-off-by: Jim Cromie jim.cro...@gmail.com --- drivers/base

<    1   2   3   4   >