Dynamic Debugging (CONFIG_DYNAMIC_DEBUG) in the Linux kernel allows developers to turn pr_debug() print statements on or off at runtime per file, line, or module without recompiling the kernel.

Dynamic Debugging Control Commands

Terminal Control Commandsbash
# Enable pr_debug logs for a specific kernel driver file (e.g. mydriver.c)
echo "file mydriver.c +p" > /sys/kernel/debug/dynamic_debug/control
 
# View active dmesg kernel output stream
dmesg -w