JamesThomasMoon
JamesThomasMoon

Reputation: 7144

missing Linux /sys/kernel/debug/dynamic_debug , how to enable?

tl;dr I want to use Linux "Dynamic Debug" but the path /sys/kernel/debug/dynamic_debug/ is not found.

I want to use the "Dynamic Debug" feature of Linux to enable debug messages for a particular kernel module (wireguard). To enable this kernel module, the kernel must be able to write to file /sys/kernel/debug/dynamic_debug/control,

echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control

But there is no directory /sys/kernel/debug/dynamic_debug/ and thus no file /sys/kernel/debug/dynamic_debug/control. The debugfs is mounted to /sys/kernel/debug/ (as is typical) and it has other files (so it's not like debugfs is mounted unexpectedly). Nor does alternative path /proc/dynamic_debug/ exist.

Running Linux kernel 5.15.

Upvotes: 2

Views: 1620

Answers (1)

JamesThomasMoon
JamesThomasMoon

Reputation: 7144

Enabling "Dynamic Debug" requires setting Linux compilation option CONFIG_DYNAMIC_DEBUG. In my case, I'm using Raspbian, and that project decided not to enable CONFIG_DYNAMIC_DEBUG during Linux builds.

I could "roll my own" (compile Raspbian with CONFIG_DYNAMIC_DEBUG) but that's a lot of work and likely will upset the apt package management.

🙁

Upvotes: 2

Related Questions