Kernel Dynamic Debugging Control

Dynamic debug is designed to allow you to dynamically enable/disable kernel code to obtain additional kernel information.  Currently, if CONFIG_DYNAMIC_DEBUG is set, then all pr_debug()/dev_dbg() and print_hex_dump_debug()/print_hex_dump_bytes() calls can be dynamically enabled per-callsite.

The behaviour of pr_debug()/dev_dbg()s are controlled via writing to a control file in the ‘debugfs’ filesystem. Thus, you must first mount the debugfs filesystem, in order to make use of this feature.

    • Mount debug fs (one time only)
      # mount -t debugfs debugfs /sys/kernel/debug
    • Enable Debug from a file
      # echo -n ‘file slim-msm-ngd.c +p’ > /sys/kernel/debug/dynamic_debug/control
    • Enable debug from a line
      # echo ‘file svcsock.c line 1603 +p’ > /sys/kernel/debug/dynamic_debug/control
    • Disable debug from a file
      # echo -n ‘file slim-msm-ngd.c -p’ > /sys/kernel/debug/dynamic_debug/control

original document can be found in kernel source tree:Documentation/dynamic-debug-howto.txt


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s