How to enable dynamic debugging in the Linux kernel?

Viewed 8103

I have enabled the CONFIG_DYNAMIC_DEBUG flag in kernel config file. when I boot in my system I am able to mount the/sys/kernel/debug and there is dynamic_debug/control file too.

But when I issue any command like

echo -n 'module nfsd +p' > <debugfs>/dynamic_debug/control

it does not shows any output in dmesg OR syslogd. What am I doing wrong?

3 Answers

The <debugfs> is only a placeholder in the documentation. For whatever reason, the docs don't mention the actual path were debugfs is mounted. You can find the path with mount | grep debugfs.

For example, on my system:

$ mount | grep debug
debugfs on /sys/kernel/debug type debugfs (rw,relatime)

$ mount | grep debug | awk '{print $3}'
/sys/kernel/debug

I doubt it gets mounted to another path on other systems, but I could be wrong.

This command/path should work for you:

echo -n 'module nfsd +p' > /sys/kernel/debug/dynamic_debug/control

Related