Skip to content

dynamic_printk: new feature

Jason Baron lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dynamic_printk: coreinclude/linux/device.h include/linux/kernel.h lib/Kconfig.debug +2 more+312 -02 replies
2/3dyanmic_printk: compile fixnet/netfilter/nf_conntrack_pptp.c+1 -10 replies
3/3dynamic_printk: docs updateDocumentation/kernel-parameters.txt+5 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/3] dynamic_printk: new feature

hi,

Add the ability to dynamically enable/disable pr_debug()/dev_dbg() in the kernel. Yes, these calls could be converted to printk(KERN_DEBUG), but there are enough to cause overhead. Additionally, the logs become difficult to read. This work is dependent on the CONFIG_DYNAMIC_PRINTK, which when enabled adds about 1% to the text size of the kernel. Mssages can be dynamically controlled by module:

echo "add module_name" > /sys/kernel/debug/dynamic_printk/modules echo "remove module_name" > /sys/kernel/debug/dynamic_printk/modules

There is also a special 'all' value that turns on all the debugging messages. This 'all' value can also be enabled during boot by passing 'dynamic_printk' on the kernel command line.

I hope that these patches are useful for people writing new kernel code, for system debugging and testing. In enabling the 'all' feature on the kernel I was running i got a bunch of messages...they are pretty interesting in and of themselves...they could point to error conditions, or further optimizations.

If this patch is accepted, i'd like to convert the myriad 'debug' printks - DEBUGP(), dprintk(), to a standard format, either pr_debug() or dev_dbg(), to hook into this mechanism.

thanks,

-Jason