当前位置: 技术问答>linux和unix
怎样截获linux内核导出的函数?
来源: 互联网 发布时间:2017-01-30
本文导语: 怎样截获linux内核导出的函数,不是截获linux系统调用函数,如截获usb_submit_urb函数? 谢谢!!! | USB驱动,有专门的分析仪,可以用软捕捉USB栈的数据包看。类似于网络包分析工具(例如wires...
怎样截获linux内核导出的函数,不是截获linux系统调用函数,如截获usb_submit_urb函数?
谢谢!!!
谢谢!!!
|
USB驱动,有专门的分析仪,可以用软捕捉USB栈的数据包看。类似于网络包分析工具(例如wireshark)。
另外,usb也有软件监视方法:
Debugging
A USB bus analyzer magnifies the goings-on in the bus and is useful for debugging low-level problems. If you can't get hold of an analyzer, you might be able to make do with the kernel's soft USB tracer, usbmon. This tool captures traffic between USB host controllers and devices. To collect a trace, read from the debugfs[3] file /sys/kernel/debug/usbmon/Xt, where X is the bus number to which your device is connected.
[3] An in-memory filesystem to export kernel debug data to user space.
For example, consider a USB disk connected to a PC. From the associated "T:" line in /proc/bus/usb/devices, you can see that the drive is attached to bus 1:
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
Ensure that you have enabled debugfs (CONFIG_DEBUG_FS) and usbmon (CONFIG_USB_MON) support in your kernel. This is a snapshot of usbmon output while copying a file from the disk:
Code View:
bash> mount -t debugfs none_debugs /sys/kernel/debug/
bash> cat /sys/kernel/debug/usbmon/1u
...
ee6a5c40 3718782540 S Bi:1:002:1 -115 20480
另外,usb也有软件监视方法:
Debugging
A USB bus analyzer magnifies the goings-on in the bus and is useful for debugging low-level problems. If you can't get hold of an analyzer, you might be able to make do with the kernel's soft USB tracer, usbmon. This tool captures traffic between USB host controllers and devices. To collect a trace, read from the debugfs[3] file /sys/kernel/debug/usbmon/Xt, where X is the bus number to which your device is connected.
[3] An in-memory filesystem to export kernel debug data to user space.
For example, consider a USB disk connected to a PC. From the associated "T:" line in /proc/bus/usb/devices, you can see that the drive is attached to bus 1:
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
Ensure that you have enabled debugfs (CONFIG_DEBUG_FS) and usbmon (CONFIG_USB_MON) support in your kernel. This is a snapshot of usbmon output while copying a file from the disk:
Code View:
bash> mount -t debugfs none_debugs /sys/kernel/debug/
bash> cat /sys/kernel/debug/usbmon/1u
...
ee6a5c40 3718782540 S Bi:1:002:1 -115 20480
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!