为什么动态调试控制不打印任何变量?

为什么动态调试控制不打印任何变量?

netdev_dbg我已检查文件中动态调试函数(更具体地说)的输出sys/kernel/debug/dynamic_debug/control。输出在格式化字符串(如%d整数)中包含所有静态字符,但预期数据类型的字符串未被实际值替换。如能提供任何帮助,我们将不胜感激。以下是文件部分内容:

drivers/misc/mei/hw-me.c:994 [mei_me]mei_me_d0i3_exit_sync =_ "d0i3 exit ret = %d\012"
drivers/misc/mei/hw-me.c:970 [mei_me]mei_me_d0i3_exit_sync =_ "d0i3 exit wait not needed\012"
drivers/misc/mei/hw-me.c:963 [mei_me]mei_me_d0i3_exit_sync =_ "d0i3 exit not needed\012"
drivers/misc/mei/hw-me.c:940 [mei_me]mei_me_d0i3_enter =_ "d0i3 enter\012"
drivers/misc/mei/hw-me.c:932 [mei_me]mei_me_d0i3_enter =_ "already d0i3 : set not needed\012"
drivers/misc/mei/hw-me.c:910 [mei_me]mei_me_d0i3_enter_sync =_ "d0i3 enter ret = %d\012"
drivers/misc/mei/hw-me.c:887 [mei_me]mei_me_d0i3_enter_sync =_ "d0i3 enter wait not needed\012"
drivers/misc/mei/hw-me.c:859 [mei_me]mei_me_d0i3_enter_sync =_ "d0i3 set not needed\012"
drivers/misc/mei/hw-me.c:794 [mei_me]mei_me_pg_is_enabled =_ "pg: not supported: d0i3 = %d HGP = %d hbm version %d.%d ?= %d.%d\012"
drivers/misc/mei/hw-me.c:590 [mei_me]mei_me_count_full_read_slots =_ "filled_slots =%08x\012"
drivers/misc/mei/hw-me.c:541 [mei_me]mei_me_hbuf_write =_ "empty slots = %hu.\012"
drivers/misc/mei/hw-me.c:538 [mei_me]mei_me_hbuf_write =_ "hdr:host=%02d me=%02d len=%d internal=%1d comp=%1d"
drivers/misc/mei/hw-me.c:445 [mei_me]mei_me_hw_start =_ "hw is ready\012"
sound/core/init.c:116 [snd]init_info_for_card =_ "unable to create card entry\012"
sound/core/control.c:1537 [snd]snd_ctl_ioctl =_ "unknown ioctl = 0x%x\012"
sound/core/device.c:156 [snd]snd_device_free =_ "device free %p (from %pF), not found\012"
sound/core/device.c:132 [snd]snd_device_disconnect =_ "device disconnect %p (from %pF), not found\012"
sound/core/timer.c:262 [snd_timer]snd_timer_open =_ "ALSA: timer: invalid slave class %i\012"
net/bluetooth/af_bluetooth.c:574 [bluetooth]bt_sock_wait_ready =_ "sk %p\012"
net/bluetooth/af_bluetooth.c:537 [bluetooth]bt_sock_wait_state =_ "sk %p\012"
net/bluetooth/af_bluetooth.c:490 [bluetooth]bt_sock_ioctl =_ "sk %p cmd %x arg %lx\012"
net/bluetooth/af_bluetooth.c:446 [bluetooth]bt_sock_poll =_ "sock %p, sk %p\012"
net/bluetooth/af_bluetooth.c:330 [bluetooth]bt_sock_stream_recvmsg =_ "sk %p size %zu\012"
net/bluetooth/af_bluetooth.c:251 [bluetooth]bt_sock_recvmsg =_ "sock %p sk %p len %zu\012"
net/bluetooth/af_bluetooth.c:203 [bluetooth]bt_accept_dequeue =_ "sk %p, already unlinked\012"
net/bluetooth/af_bluetooth.c:189 [bluetooth]bt_accept_dequeue =_ "parent %p\012"
net/bluetooth/af_bluetooth.c:175 [bluetooth]bt_accept_unlink =_ "sk %p state %d\012"
net/bluetooth/af_bluetooth.c:159 [bluetooth]bt_accept_enqueue =_ "parent %p, sk %p\012"
net/bluetooth/hci_core.c:4263 [bluetooth]hci_cmd_work =_ "%s cmd_cnt %d cmd queued %d\012"
net/bluetooth/hci_core.c:4246 [bluetooth]hci_rx_work =_ "%s SCO data packet\012"
net/bluetooth/hci_core.c:4241 [bluetooth]hci_rx_work =_ "%s ACL data packet\012"
net/bluetooth/hci_core.c:4236 [bluetooth]hci_rx_work =_ "%s Event packet\012"
net/bluetooth/hci_core.c:4207 [bluetooth]hci_rx_work =_ "%s\012"
net/bluetooth/hci_core.c:4147 [bluetooth]hci_req_cmd_complete =_ "opcode 0x%04x status 0x%02x\012"
net/bluetooth/hci_core.c:4087 [bluetooth]hci_scodata_packet =_ "%s len %d handle 0x%4.4x\012"
net/bluetooth/hci_core.c:4054 [bluetooth]hci_acldata_packet =_ "%s len %d handle 0x%4.4x flags 0x%4.4x\012"
net/bluetooth/hci_core.c:4023 [bluetooth]hci_tx_work =_ "%s acl %d sco %d le %d\012"
net/bluetooth/hci_core.c:3991 [bluetooth]hci_sched_le =_ "chan %p skb %p len %d priority %u\012"
net/bluetooth/hci_core.c:3972 [bluetooth]hci_sched_le =_ "%s\012"
net/bluetooth/hci_core.c:3956 [bluetooth]hci_sched_esco =_ "skb %p len %d\012"
net/bluetooth/hci_core.c:3948 [bluetooth]hci_sched_esco =_ "%s\012"
net/bluetooth/hci_core.c:3932 [bluetooth]hci_sched_sco =_ "skb %p len %d\012"

答案1

使用该dmesg实用程序查看内核的实际调试输出。

dynamic_debug 控制文件仅显示正在运行的内核中可以启用或禁用的所有调试语句。示例=_输出显示这些调试消息已被禁用,不会出现在内核日志输出中。该p标志表示调试消息已启用。

然后,您可以写入 dynamic_debug 控制文件以启用所需的任何额外调试语句。此语法有些晦涩难懂,但有详细记录,请访问https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html

相关内容