uos@uos-PC [~] ➜ sudo cat /sys/kernel/debug/dynamic_debug/control | head [14:27:15] # filename:lineno [module]function flags format drivers/usb/storage/usb.c:1131 [usb_storage]storage_probe =_ "Use Bulk-Only transport with the Transparent SCSI protocol for dynamic id: 0x%04x 0x%04x\012" drivers/usb/storage/usb.c:1067 [usb_storage]usb_stor_probe2 =_ "waiting for device to settle before scanning\012" drivers/usb/storage/usb.c:917 [usb_storage]usb_stor_scan_dwork =_ "scan complete\012" drivers/usb/storage/usb.c:899 [usb_storage]usb_stor_scan_dwork =_ "starting scan\012" drivers/usb/storage/sierra_ms.c:110 [usb_storage]truinst_show =_ "SWIMS: failed SWoC query\012" drivers/usb/storage/sierra_ms.c:89 [usb_storage]debug_swoc =_ "SWIMS: Linux Version: %04X\012" drivers/usb/storage/sierra_ms.c:88 [usb_storage]debug_swoc =_ "SWIMS: Linux SKU: %04X\012" drivers/usb/storage/sierra_ms.c:87 [usb_storage]debug_swoc =_ "SWIMS: SWoC Rev: %02d\012" drivers/usb/storage/sierra_ms.c:69 [usb_storage]sierra_get_swoc_info =_ "SWIMS: Attempting to get TRU-Install info\012"
使用方法
控制打印时,还可以使用flags更来定义更详细的输出信息,目前支持的flags如下:
1 2 3 4 5 6
p enables the pr_debug() callsite. f Include the function name in the printed message l Include line number in the printed message m Include module name in the printed message t Include thread ID in messages not generated from interrupt context _ No flags are set. (Or'd with others on input)
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#使能文件svcsock.c中1603行的输出 echo -n "file svcsock.c line 1603 +p" > /sys/kernel/debug/dynamic_debug/control