Sample Header Ad - 728x90

How to decode/intepret usbmon captures in Linux?

0 votes
0 answers
25 views
I am working on an embedded Linux system (kernel-5.10.200), and I met one problem about USB disk detection. I did 2 tests as follows. 1. Inserted the USB disk before boot system up. 2. Inserted the USB disk after system booted up (hot-plug). In both tests, after system booted up, I manually configured the USB port from device mode to host mode, then check how fast the /dev/sda is created. I found in the 1st case, it took about 17 seconds for /dev/sda to be created. In the 2nd case, it took about 2 seconds for /dev/sda to be created. I could NOT figure out the reason of the big difference in time of /dev/sda creation. So I enabled usbmon in kernel, and I got following extra output for the 1st case (after the port is switched to host mode).
811c4480 7790082 C Ii:1:001:1 0:2048 1 = 02
811c4480 7790128 S Ii:1:001:1 -150:2048 4 
8220bd00 14390474 S Bi:1:002:1 -150 36 
81ea5000 14391634 S Bi:1:002:1 -150 13 
8220b080 14391891 S Bi:1:002:1 -150 18 
81ea5000 14392510 S Bi:1:002:1 -150 13 
8220b580 14392852 S Bi:1:002:1 -150 8 
8220b580 14393375 S Bi:1:002:1 -150 192 
8220b580 14393878 S Bi:1:002:1 -150 192 
81ea5000 14430666 S Bi:1:002:1 -150 13 
81ea5000 14431019 S Bi:1:002:1 -150 13 
82399780 14431374 S Bi:1:002:1 -150 8 
82399780 14431764 S Bi:1:002:1 -150 192 
82399780 14432277 S Bi:1:002:1 -150 192 
81ea5000 14432714 S Bi:1:002:1 -150 13 
82399600 14433138 S Bi:1:002:1 -150 4096 
81ea5000 14434594 S Bi:1:002:1 -150 13 
81ea5000 14435507 S Bi:1:002:1 -150 13 
81ea5000 14435827 S Bi:1:002:1 -150 13 
8238be80 14436174 S Bi:1:002:1 -150 8 
8238be80 14436646 S Bi:1:002:1 -150 192 
8238be80 14437036 S Bi:1:002:1 -150 192 <
8238be80 14437076 C Bi:1:002:1 -140 12 = 0b000008 0003e311 00000800
81ea5000 14437139 S Bi:1:002:1 -150 13 <
81ea5000 14437171 C Bi:1:002:1 0 13 = 55534253 14000000 00000000 00
811c4480 96790040 C Ii:1:001:1 0:2048 1 = 02
811c4480 96790071 S Ii:1:001:1 -150:2048 4 <
8235d100 96790167 S Ci:1:001:0 s a3 00 0000 0001 0004 4 <
8235d100 96790193 C Ci:1:001:0 0 4 = 00000300
8235d100 96790206 S Co:1:001:0 s 23 01 0010 0001 0000 0
8235d100 96790216 C Co:1:001:0 0 0
8235d100 96790223 S Co:1:001:0 s 23 01 0011 0001 0000 0
8235d100 96790230 C Co:1:001:0 0 0
831bd000 96901033 S Ci:1:001:0 s a3 00 0000 0001 0004 4 <
831bd000 96901147 C Ci:1:001:0 0 4 = 00000000
81ea5580 96950067 S Ci:1:001:0 s a3 00 0000 0001 0004 4 <
81ea5580 96950099 C Ci:1:001:0 0 4 = 00000000
81ea5580 97000044 S Ci:1:001:0 s a3 00 0000 0001 0004 4 <
81ea5580 97000071 C Ci:1:001:0 0 4 = 00000000
81ea5580 97050044 S Ci:1:001:0 s a3 00 0000 0001 0004 4 <
81ea5580 97050071 C Ci:1:001:0 0 4 = 00000000
81ea5580 97100039 S Ci:1:001:0 s a3 00 0000 0001 0004 4 <
81ea5580 97100065 C Ci:1:001:0 0 4 = 00000000
81ea5580 97100083 S Co:1:001:0 s 23 03 0008 0001 0000 0
81ea5580 97100098 C Co:1:001:0 0 0
I don't know how to intepret above outputs, and where should I focus on to solve the 17 seconds of /dev/sda creation. The system is using mdev to manage devices' lifecycle.
Asked by wangt13 (631 rep)
May 11, 2025, 03:13 AM