<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/include/linux/dynamic_printk.h, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/include/linux/dynamic_printk.h?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/include/linux/dynamic_printk.h?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2009-03-24T23:38:26Z</updated>
<entry>
<title>dynamic debug: combine dprintk and dynamic printk</title>
<updated>2009-03-24T23:38:26Z</updated>
<author>
<name>Jason Baron</name>
<email>jbaron@redhat.com</email>
</author>
<published>2009-02-05T16:51:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e9d376f0fa66bd630fe27403669c6ae6c22a868f'/>
<id>urn:sha1:e9d376f0fa66bd630fe27403669c6ae6c22a868f</id>
<content type='text'>
This patch combines Greg Bank's dprintk() work with the existing dynamic
printk patchset, we are now calling it 'dynamic debug'.

The new feature of this patchset is a richer /debugfs control file interface,
(an example output from my system is at the bottom), which allows fined grained
control over the the debug output. The output can be controlled by function,
file, module, format string, and line number.

for example, enabled all debug messages in module 'nf_conntrack':

echo -n 'module nf_conntrack +p' &gt; /mnt/debugfs/dynamic_debug/control

to disable them:

echo -n 'module nf_conntrack -p' &gt; /mnt/debugfs/dynamic_debug/control

A further explanation can be found in the documentation patch.

Signed-off-by: Greg Banks &lt;gnb@sgi.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>driver core: basic infrastructure for per-module dynamic debug messages</title>
<updated>2008-10-16T16:24:47Z</updated>
<author>
<name>Jason Baron</name>
<email>jbaron@redhat.com</email>
</author>
<published>2008-08-12T20:46:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=346e15beb5343c2eb8216d820f2ed8f150822b08'/>
<id>urn:sha1:346e15beb5343c2eb8216d820f2ed8f150822b08</id>
<content type='text'>
Base infrastructure to enable per-module debug messages.

I've introduced CONFIG_DYNAMIC_PRINTK_DEBUG, which when enabled centralizes
control of debugging statements on a per-module basis in one /proc file,
currently, &lt;debugfs&gt;/dynamic_printk/modules. When, CONFIG_DYNAMIC_PRINTK_DEBUG,
is not set, debugging statements can still be enabled as before, often by
defining 'DEBUG' for the proper compilation unit. Thus, this patch set has no
affect when CONFIG_DYNAMIC_PRINTK_DEBUG is not set.

The infrastructure currently ties into all pr_debug() and dev_dbg() calls. That
is, if CONFIG_DYNAMIC_PRINTK_DEBUG is set, all pr_debug() and dev_dbg() calls
can be dynamically enabled/disabled on a per-module basis.

Future plans include extending this functionality to subsystems, that define 
their own debug levels and flags.

Usage:

Dynamic debugging is controlled by the debugfs file, 
&lt;debugfs&gt;/dynamic_printk/modules. This file contains a list of the modules that
can be enabled. The format of the file is as follows:

	&lt;module_name&gt; &lt;enabled=0/1&gt;
		.
		.
		.

	&lt;module_name&gt; : Name of the module in which the debug call resides
	&lt;enabled=0/1&gt; : whether the messages are enabled or not

For example:

	snd_hda_intel enabled=0
	fixup enabled=1
	driver enabled=0

Enable a module:

	$echo "set enabled=1 &lt;module_name&gt;" &gt; dynamic_printk/modules

Disable a module:

	$echo "set enabled=0 &lt;module_name&gt;" &gt; dynamic_printk/modules

Enable all modules:

	$echo "set enabled=1 all" &gt; dynamic_printk/modules

Disable all modules:

	$echo "set enabled=0 all" &gt; dynamic_printk/modules

Finally, passing "dynamic_printk" at the command line enables
debugging for all modules. This mode can be turned off via the above
disable command.

[gkh: minor cleanups and tweaks to make the build work quietly]

Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
</feed>
