From: jim.cromie@gmail.com
To: jbaron@redhat.com
Cc: greg@kroah.com, joe@perches.com, bart.vanassche@gmail.com,
linux-kernel@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 23/25] dynamic_debug: update Documentation/kernel-parameters.txt, Kconfig.debug
Date: Tue, 6 Dec 2011 12:11:33 -0700 [thread overview]
Message-ID: <1323198694-7186-24-git-send-email-jim.cromie@gmail.com> (raw)
In-Reply-To: <1323198694-7186-1-git-send-email-jim.cromie@gmail.com>
From: Jim Cromie <jim.cromie@gmail.com>
In kernel-parameters.txt:
- update flags indicators in example output, from '-' to '=_'.
- add sentence on _ flag-char
- more info in Module Initialization section
$module.dyndbg, *.dyndbg
In Kconfig.debug, note enabled-by-default effect of -DDEBUG
compilation.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
Documentation/dynamic-debug-howto.txt | 52 ++++++++++++++++++++++-----------
Documentation/kernel-parameters.txt | 9 ++++++
lib/Kconfig.debug | 15 ++++++----
3 files changed, 53 insertions(+), 23 deletions(-)
diff --git a/Documentation/dynamic-debug-howto.txt b/Documentation/dynamic-debug-howto.txt
index 56e496a..2a9da50 100644
--- a/Documentation/dynamic-debug-howto.txt
+++ b/Documentation/dynamic-debug-howto.txt
@@ -49,10 +49,10 @@ via:
nullarbor:~ # cat <debugfs>/dynamic_debug/control
# filename:lineno [module]function flags format
-/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:323 [svcxprt_rdma]svc_rdma_cleanup - "SVCRDMA Module Removed, deregister RPC RDMA transport\012"
-/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:341 [svcxprt_rdma]svc_rdma_init - "\011max_inline : %d\012"
-/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:340 [svcxprt_rdma]svc_rdma_init - "\011sq_depth : %d\012"
-/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:338 [svcxprt_rdma]svc_rdma_init - "\011max_requests : %d\012"
+/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:323 [svcxprt_rdma]svc_rdma_cleanup =_ "SVCRDMA Module Removed, deregister RPC RDMA transport\012"
+/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:341 [svcxprt_rdma]svc_rdma_init =_ "\011max_inline : %d\012"
+/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:340 [svcxprt_rdma]svc_rdma_init =_ "\011sq_depth : %d\012"
+/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:338 [svcxprt_rdma]svc_rdma_init =_ "\011max_requests : %d\012"
...
@@ -70,7 +70,7 @@ flags for each debug statement callsite (see below for definitions of the
flags). The default value, no extra behaviour enabled, is "-". So
you can view all the debug statement callsites with any non-default flags:
-nullarbor:~ # awk '$3 != "-"' <debugfs>/dynamic_debug/control
+nullarbor:~ # awk '$3 != "=_"' <debugfs>/dynamic_debug/control
# filename:lineno [module]function flags format
/usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svcsock.c:1603 [sunrpc]svc_send p "svc_process: st_sendto returned %d\012"
@@ -213,10 +213,11 @@ p
Causes a printk() message to be emitted to dmesg
t
Include thread ID in messages not generated from interrupt context
+_
+ No flags are set
-Note the regexp ^[-+=][flmpt]+$ matches a flags specification.
-Note also that there is no convenient syntax to remove all
-the flags at once, you need to use "-flmpt".
+Note the regexp ^[-+=][flmpt_]+$ matches a flags specification.
+To clear all flags at once, use "=_" or "-flmpt".
Debug messages during Boot Process
@@ -237,6 +238,8 @@ your machine (typically a laptop) has an Embedded Controller.
PCI (or other devices) initialization also is a hot candidate for using
this boot parameter for debugging purposes.
+Note: ddebug_query= is supplanted by the feature in the next section,
+and will be deprecated later.
Debug Messages at Module Initialization Time
============================================
@@ -258,10 +261,16 @@ lost. Instead, a "dyndbg" module parameter can be passed:
options module dyndbg=+pmflt
options module dyndbg # defaults to +p
-The $modname.dyndbg="value" should exclude "module $modname", as the
+The $modname.dyndbg="value" must exclude "module $modname", as the
$modname is taken from the param-name, and only 1 spec of each type is
allowed.
+*.dyndbg="+p" can be used to enable all builtin (only) debug
+callsites, or to set print-format defaults (="+mf") for those enabled
+separately. Loadable modules are not affected by wildcard rules, the
+module loader selects only boot options whose module name matches that
+being loaded.
+
The dyndbg option is not implemented as an ordinary module parameter
and thus will not show up in /sys/module/module_name/parameters/dyndbg
The settings can be reverted later via the sysfs interface if the
@@ -273,9 +282,12 @@ $module.dyndbg="..." on boot-line works on built-in modules as well as
those loaded by modprobe (from either early or normal userspace), and
somewhat overlaps debug_query functionality.
-Modprobed modules get dyndbg flags given on boot-line after those
-given via modprobe (either explicitly, or from /etc/modprobe.d/*).
-This can surprise if boot-line arg subtracts flags.
+When a module is loaded, dyndbg flags are applied in following order,
+with last having final say:
+
+ - as given in /etc/modprobe.d/* system-wide settings
+ - as given on boot-line kernel, boot-time specific
+ - as given in modprobe command explicit at load
Examples
========
@@ -304,13 +316,19 @@ nullarbor:~ # echo -n 'func svc_process -p' >
nullarbor:~ # echo -n 'format "nfsd: READ" +p' >
<debugfs>/dynamic_debug/control
+// enable all messages
+nullarbor:~ # echo -n '+p' > <debugfs>/dynamic_debug/control
+
+// add module, function to all enabled messages
+nullarbor:~ # echo -n '+mf' > <debugfs>/dynamic_debug/control
+
// boot-args example, with newlines and comments
Kernel command line: ...
ddebug_query="func i2c_del_adapter +p; func tboot_probe +p"
- dynamic_debug.verbose=1 // see whats going on
- nouveau.dyndbg // implicit =+p
- tsc_sync.dyndbg=+p // builtin on my kernel
- i2c_core.dyndbg=+p // loaded by udev
- *.dyndbg="=_" // wildcard applies to builtins
+ dynamic_debug.verbose=1 // see whats going on
+ nouveau.dyndbg // implicit =+p
+ tsc_sync.dyndbg=+p // builtin on my kernel
+ i2c_core.dyndbg=+p // loaded by udev
+ *.dyndbg="+mf" // print module, function for enabled sites
k10temp.dyndbg="+p # comment in query is stripped "
pnp.dyndbg="func pnpacpi_get_resources +p; func pnp_assign_mem +p" # multi
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 81c27b1..387443d 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -691,6 +691,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
dscc4.setup= [NET]
+ $modulename.dyndbg[=string]
+ [KNL,DYNAMIC_DEBUG] Enable debug messages in
+ $modulename for builtin or loadable modules. Debug
+ during module initialization is supported.
+ These parameters are not exposed in
+ /sys/module/${modnm}/parameters/dyndbg.
+ See Documentation/dynamic-debug-howto.txt for
+ details of allowed strings, etc.
+
earlycon= [KNL] Output early console device and options.
uart[8250],io,<addr>[,options]
uart[8250],mmio,<addr>[,options]
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 82928f5..f6fbd92 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1184,8 +1184,11 @@ config DYNAMIC_DEBUG
otherwise be available at runtime. These messages can then be
enabled/disabled based on various levels of scope - per source file,
function, module, format string, and line number. This mechanism
- implicitly enables all pr_debug() and dev_dbg() calls. The impact of
- this compile option is a larger kernel text size of about 2%.
+ implicitly compiles in all pr_debug() and dev_dbg() calls, which
+ enlarges the kernel text size by about 2%.
+
+ If a source file is compiled with DEBUG flag set, any pr_debug()
+ calls in it are enabled by default, but can be disabled as below.
Usage:
@@ -1202,16 +1205,16 @@ config DYNAMIC_DEBUG
lineno : line number of the debug statement
module : module that contains the debug statement
function : function that contains the debug statement
- flags : 'p' means the line is turned 'on' for printing
+ flags : '=p' means the line is turned 'on' for printing
format : the format used for the debug statement
From a live system:
nullarbor:~ # cat <debugfs>/dynamic_debug/control
# filename:lineno [module]function flags format
- fs/aio.c:222 [aio]__put_ioctx - "__put_ioctx:\040freeing\040%p\012"
- fs/aio.c:248 [aio]ioctx_alloc - "ENOMEM:\040nr_events\040too\040high\012"
- fs/aio.c:1770 [aio]sys_io_cancel - "calling\040cancel\012"
+ fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
+ fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
+ fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
Example usage:
--
1.7.7.3
next prev parent reply other threads:[~2011-12-06 19:13 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 20:27 [patch 00/25] dynamic-debug enhancements Jim Cromie
2011-12-06 18:59 ` Jim Cromie
2011-12-06 19:11 ` [patch 00/24 ] dynamic debug enhancements: multi-queries during mod-init jim.cromie
2011-12-06 19:11 ` [PATCH 01/25] kernel/module.c: fix compile err, warnings under ifdef DEBUGP jim.cromie
2011-12-06 19:11 ` [PATCH 02/25] dynamic_debug: fix whitespace complaints from scripts/cleanfile jim.cromie
2011-12-06 19:11 ` [PATCH 03/25] dynamic_debug: drop enabled field from struct _ddebug, use _DPRINTK_FLAGS_PRINT jim.cromie
2011-12-06 19:11 ` [PATCH 04/25] dynamic_debug: make dynamic-debug supersede DEBUG ccflag jim.cromie
2011-12-06 19:11 ` [PATCH 05/25] dynamic_debug: change verbosity at runtime jim.cromie
2011-12-06 19:11 ` [PATCH 06/25] dynamic_debug: replace strcpy with strlcpy, in ddebug_setup_query() jim.cromie
2011-12-06 19:11 ` [PATCH 07/25] dynamic_debug: pr_err() call should not depend upon verbosity jim.cromie
2011-12-06 19:11 ` [PATCH 08/25] dynamic_debug: drop explicit !=NULL checks jim.cromie
2011-12-06 19:11 ` [PATCH 09/25] dynamic_debug: describe_flags with '=[pmflt_]*' jim.cromie
2011-12-06 19:11 ` [PATCH 10/25] dynamic_debug: tighten up error checking on debug queries jim.cromie
2011-12-06 19:11 ` [PATCH 11/25] dynamic_debug: early return if _ddebug table is empty jim.cromie
2011-12-06 19:11 ` [PATCH 12/25] dynamic_debug: reduce lineno field to a saner 18 bits jim.cromie
2011-12-06 19:11 ` [PATCH 13/25] dynamic_debug: chop off comments in ddebug_tokenize jim.cromie
2011-12-06 19:11 ` [PATCH 14/25] dynamic_debug: enlarge command/query write buffer jim.cromie
2011-12-06 19:11 ` [PATCH 15/25] dynamic_debug: add trim_prefix() to provide source-root relative paths jim.cromie
2011-12-06 19:11 ` [PATCH 16/25] dynamic_debug: factor vpr_info_dq out of ddebug_parse_query jim.cromie
2011-12-06 19:11 ` [PATCH 17/25] dynamic_debug: process multiple debug-queries on a line jim.cromie
2011-12-06 19:11 ` [PATCH 18/25] dynamic_debug: Introduce global fake module param $module.dyndbg jim.cromie
2011-12-07 1:01 ` Rusty Russell
2011-12-07 8:33 ` Jim Cromie
2011-12-07 10:59 ` Rusty Russell
2011-12-08 17:10 ` Jason Baron
2011-12-08 18:12 ` Jim Cromie
2011-12-06 19:11 ` [PATCH 19/25] pnp: if CONFIG_DYNAMIC_DEBUG, use pnp.dyndbg instead of pnp.debug jim.cromie
2011-12-06 19:11 ` [PATCH 20/25] dynamic_debug: add modname arg to exec_query callchain jim.cromie
2011-12-06 19:11 ` [PATCH 21/25] kernel/module: replace DEBUGP with pr_debug jim.cromie
2011-12-07 1:07 ` Rusty Russell
2011-12-08 15:41 ` Jason Baron
2011-12-08 18:17 ` Jim Cromie
2011-12-06 19:11 ` [PATCH 22/25] dynamic_debug: protect "dyndbg" fake module param name at compile-time jim.cromie
2011-12-06 19:11 ` jim.cromie [this message]
2011-12-06 19:11 ` [PATCH 24/25] dynamic_debug: remove unneeded includes jim.cromie
2011-12-12 22:05 ` [patch 00/24 ] dynamic debug enhancements: multi-queries during mod-init Greg KH
[not found] ` <CAJfuBxzeKzmOCo00Ew8xAp9EmU0QZ3zjOkRcdEMzYrtx_b9+kA@mail.gmail.com>
2011-12-13 4:17 ` Jim Cromie
2011-12-13 4:25 ` Greg KH
2011-12-13 7:00 ` Jim Cromie
2011-12-13 7:44 ` Greg KH
2011-12-13 14:48 ` Jason Baron
2011-12-12 23:12 ` [patch 00/23] dynamic-debug enhancements Jim Cromie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323198694-7186-24-git-send-email-jim.cromie@gmail.com \
--to=jim.cromie@gmail.com \
--cc=bart.vanassche@gmail.com \
--cc=greg@kroah.com \
--cc=jbaron@redhat.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®