2

My system:

mik@michaelUbuntu:~$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
mik@michaelUbuntu:~$ uname -r
5.15.0-78-generic

I would like to debug a kernel driver module (mceusb.c). The code uses the dev_dbg function to output debug messages.

Googling I found, that the output can be enabled by using dynamic debug.

mik@michaelUbuntu:~$ cat /boot/config-5.15.0-78-generic | grep DYNAMIC_DEBUG
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DYNAMIC_DEBUG_CORE=y

So the ubuntu kernel is compiled with the needed option.

I tried to enable dynamic debug for kernel module mceusb as described here: https://stackoverflow.com/questions/50504516/enable-linux-kernel-driver-dev-dbg-debug-messages

but without success:

mik@michaelUbuntu:~$ sudo su
[sudo] password for mik: 
root@michaelUbuntu:/home/mik# echo 'file mceusb +p' > /sys/kernel/debug/dynamic_debug/control 
bash: /sys/kernel/debug/dynamic_debug/control: Operation not permitted
mik@michaelUbuntu:~$ dmsg
Lockdown: bash: debugfs access is restricted; see man kernel_lockdown.7

Accoring to https://www.kernel.org/doc/html/v4.14/admin-guide/dynamic-debug-howto.html it is possible to enable the debug output as a parameter for modprobe. But this does not seam to work either.

root@michaelUbuntu:/home/mik# modprobe mceusb dyndbg="+pmf"

No output in syslog, dmesg or command line.

So how can I enable dynamic_debug logging for the driver mceusb in ubuntu 20.04?

Thanks for your help!

2
  • try the documentation version for the proper kernel version. I think you will find the syntax has changed a little. Commented Aug 17, 2023 at 23:45
  • If I use the correct syntax for your 2nd method, modprobe mceusb dyndbg==pmf then it works for me and I can see it in the list, cat /sys/kernel/debug/dynamic_debug/control | grep mceusb. For example (one of many): drivers/media/rc/mceusb.c:1711 [mceusb]mceusb_dev_probe =pmf "acceptable interrupt outbound endpoint found\n" Commented Aug 17, 2023 at 23:59

0

You must log in to answer this question.

Browse other questions tagged .