为什么Linux中的动态调试不显示变量值?

时间:2018-04-03 14:15:33

标签: linux-kernel linux-device-driver

不同驱动程序的动态调试输出不显示任何值。它们显示预期数据类型的格式化字符串值。我该如何解决?以下是针对不同驱动程序的文件sys/kernel/debug/dynamic_debug/control的提取:

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"

我使用的是Ubuntu 16.04 LTS。

1 个答案:

答案 0 :(得分:1)

你误解了该文件的目的。它不代表动态调试输出。它用于控制输出。阅读文件会显示您可以使用设施控制的内容。编写它可以指定您希望在输出中显示的内容。

请参阅https://www.kernel.org/doc/html/v4.14/admin-guide/dynamic-debug-howto.html(或在您的内核源目录中为... / Documentation / dynamic-debug-howto.txt)

  

...< debugfs> / dynamic_debug / control可以读取以显示已知调试语句的完整列表,以帮助指导您。