Friday, March 9, 2012

USBMon capturing

1)mount -t debugfs none_debugs /sys/kernel/debug
 
2)modprobe usbmon
 
3)ls /sys/kernel/debug/usb/usbmon
0s  0u  1s  1t  1u  2s  2t  2u  3s  3t  3u  4s  4t  4u 
4)Find which bus connects to the desired device
 Run "cat /proc/bus/usb/devices", and find the T-line which corresponds to
 the device. Usually you do it by looking for the vendor string. If you have
 many similar devices, unplug one and compare two /proc/bus/usb/devices outputs.
 The T-line will have a bus number. Example:
 
 T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
 D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=0557 ProdID=2004 Rev= 1.00
 S:  Manufacturer=ATEN
 S:  Product=UC100KM V2.00
 
 Bus=03 means it's bus 3.
 
 3. Start 'cat'
 
 # cat /sys/kernel/debug/usb/usbmon/3u > /tmp/1.mon.out
 
 to listen on a single bus, otherwise, to listen on all buses, type:
 
 # cat /sys/kernel/debug/usb/usbmon/0u > /tmp/1.mon.out
 

No comments:

Post a Comment