Embedded Linux Dynamic Debug in Linux How to enable targeted kernel debug messages without rebuilding the kernel.
This English edition keeps the original illustrations and reproducible command or configuration examples.
Commands and configuration CONFIG_DYNAMIC_DEBUG = y
CONFIG_DEBUG_FS = y
cat /sys/kernel/debug/dynamic_debug/control
echo 'file driver.c +p' > /sys/kernel/debug/dynamic_debug/control
echo 'file driver.c -p' > /sys/kernel/debug/dynamic_debug/control
echo 'func my_function +p' > /sys/kernel/debug/dynamic_debug/control
echo 'module my_module +p' > /sys/kernel/debug/dynamic_debug/control
pr_debug( "Packet sent: %s\n" , packet_data) ;
echo 'file net_driver.c +p' > /sys/kernel/debug/dynamic_debug/control
Practical notes Test each change on a recoverable target, keep logs from the boot or failure path, and record the exact kernel and userspace versions used in the result.