1

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 a kernel module kernel debug messages requires writing instructions 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.

JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63
  • Similar to question [How to enable dynamic debugging in the Linux kernel?](https://stackoverflow.com/questions/11631968/how-to-enable-dynamic-debugging-in-the-linux-kernel), but that question already has path `/sys/kernel/debug/dynamic_debug` available. This question occurs "before" that other question. – JamesThomasMoon Oct 30 '22 at 02:39
  • [`kernel.org`](https://www.kernel.org/doc/html/v5.15/admin-guide/dynamic-debug-howto.html) mentions setting `CONFIG_DYNAMIC_DEBUG`. I think I have to get a Linux built with that enabled. – JamesThomasMoon Oct 30 '22 at 04:48

1 Answers1

1

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.

JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63