さて、USBMONの続き
[root@~]# mount -t debugfs none_debugs /sys/kernel/debug
[root@~]# modprobe usbmon
[root@~]# lsusb
Bus 002 Device 003: ID 0409:0270 NEC Corp.
Bus 002 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@~]# ls /sys/kernel/debug/usb/usbmon
0s 0u 1s 1t 1u 2s 2t 2u
監視したい、FOMAの携帯はUSB HUBのBus 002に接続されいてるので2uのログを取りだします
[root@~]# cat /sys/kernel/debug/usb/usbmon/2u >acm-FOMA.log
[root@~]# cat acm-FOMA.log
cc5b9880 543302003 C Ii:2:001:1 0:128 1 = 02
cc5b9880 543302086 S Ii:2:001:1 -115:128 2 <
cfb6fe80 543302442 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543302646 C Ci:2:001:0 0 4 = 01010100
cfb6fe80 543302677 S Co:2:001:0 s 23 01 0010 0001 0000 0
cfb6fe80 543302791 C Co:2:001:0 0 0
cfb6fe80 543302823 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543302975 C Ci:2:001:0 0 4 = 01010000
cfb6fe80 543342067 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543342154 C Ci:2:001:0 0 4 = 01010000
cfb6fe80 543367431 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543367533 C Ci:2:001:0 0 4 = 01010000
cfb6fe80 543393363 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543393461 C Ci:2:001:0 0 4 = 01010000
cfb6fe80 543419311 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543419415 C Ci:2:001:0 0 4 = 01010000
cfb6fe80 543419466 S Co:2:001:0 s 23 03 0004 0001 0000 0
cfb6fe80 543419599 C Co:2:001:0 0 0
cfb6fe80 543470705 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543470878 C Ci:2:001:0 0 4 = 03010000
cfb6fe80 543521546 S Co:2:001:0 s 23 01 0014 0001 0000 0
cfb6fe80 543521601 C Co:2:001:0 0 0
cfb6fe80 543521648 S Ci:2:000:0 s 80 06 0100 0000 0040 64 <
cfb6fe80 543535285 C Ci:2:000:0 0 18 = 12010002 ffffff40 09047002 00010102 0301
cfb6fe80 543535495 S Co:2:001:0 s 23 03 0004 0001 0000 0
cfb6fe80 543535628 C Co:2:001:0 0 0
cfb6fe80 543586373 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfb6fe80 543586590 C Ci:2:001:0 0 4 = 03010000
cfb6fe80 543637848 S Co:2:001:0 s 23 01 0014 0001 0000 0
cfb6fe80 543638007 C Co:2:001:0 0 0
cfb6fe80 543638069 S Co:2:000:0 s 00 05 0005 0000 0000 0
cfb6fe80 543639340 C Co:2:000:0 0 0
cfb6fe80 543651700 S Ci:2:005:0 s 80 06 0100 0000 0012 18 <
cfb6fe80 543656816 C Ci:2:005:0 0 18 = 12010002 ffffff40 09047002 00010102 0301
cfb6fe80 543656929 S Ci:2:005:0 s 80 06 0600 0000 000a 10 <
cfb6fe80 543660770 C Ci:2:005:0 -32 0
cfb6fe80 543660867 S Ci:2:005:0 s 80 06 0600 0000 000a 10 <
cfb6fe80 543664731 C Ci:2:005:0 -32 0
cfb6fe80 543664826 S Ci:2:005:0 s 80 06 0600 0000 000a 10 <
cfb6fe80 543668730 C Ci:2:005:0 -32 0
cfb6fe80 543668821 S Ci:2:005:0 s 80 06 0200 0000 0009 9 <
cfb6fe80 543673700 C Ci:2:005:0 0 9 = 0902b700 050100c0 32
cfb6fe80 543673799 S Ci:2:005:0 s 80 06 0200 0000 00b7 183 <
cfb6fe80 543680760 C Ci:2:005:0 0 183 = 0902b700 050100c0 32080b00 02028801 00080b02 02028801 00090400 00010288
cfb6fe80 543680922 S Ci:2:005:0 s 80 06 0300 0000 00ff 255 <
cfb6fe80 543688135 C Ci:2:005:0 0 4 = 04030904
cfb6fe80 543688275 S Ci:2:005:0 s 80 06 0302 0409 00ff 255 <
cfb6fe80 543696116 C Ci:2:005:0 0 20 = 14034600 4f004d00 41002000 4e003000 39004100
cfb6fe80 543696277 S Ci:2:005:0 s 80 06 0301 0409 00ff 255 <
cfb6fe80 543704182 C Ci:2:005:0 0 8 = 08034e00 45004300
cfb6fe80 543704321 S Ci:2:005:0 s 80 06 0303 0409 00ff 255 <
cfb6fe80 543712071 C Ci:2:005:0 0 32 = 20033300 35003600 37003500 39003000 32003100 38003600 31003500 39003700
cfb6f080 543713481 S Co:2:005:0 s 00 09 0001 0000 0000 0
cfb6f080 543725104 C Co:2:005:0 0 0
cfbe3d00 544189124 S Co:2:005:0 s 21 22 0000 0000 0000 0
cfbe3d00 544193545 C Co:2:005:0 -32 0
cfbe3d00 544193699 S Co:2:005:0 s 21 20 0000 0000 0007 7 = 80250000 000008
cfbe3d00 544197442 C Co:2:005:0 -32 7 >
cf82f000 544198127 S Co:2:005:0 s 21 22 0000 0002 0000 0
cf82f000 544201425 C Co:2:005:0 -32 0
cf82f000 544201512 S Co:2:005:0 s 21 20 0000 0002 0007 7 = 80250000 000008
cf82f000 544205447 C Co:2:005:0 -32 7 >
cc5b9880 569051454 C Ii:2:001:1 0:128 1 = 02
cc5b9880 569051555 S Ii:2:001:1 -115:128 2 <
cfbe9b80 569051732 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfbe9b80 569051842 C Ci:2:001:0 0 4 = 00010300
cfbe9b80 569051879 S Co:2:001:0 s 23 01 0010 0001 0000 0
cfbe9b80 569051934 C Co:2:001:0 0 0
cfbe9b80 569051959 S Co:2:001:0 s 23 01 0011 0001 0000 0
cfbe9b80 569052010 C Co:2:001:0 0 0
cfbe9b80 569058533 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfbe9b80 569062283 C Ci:2:001:0 0 4 = 00010000
cfbe3f00 569090430 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfbe3f00 569090553 C Ci:2:001:0 0 4 = 00010000
cf8e1300 569116923 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cf8e1300 569117019 C Ci:2:001:0 0 4 = 00010000
cfa14280 569142670 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfa14280 569142816 C Ci:2:001:0 0 4 = 00010000
cfa14d00 569169663 S Ci:2:001:0 s a3 00 0000 0001 0004 4 <
cfa14d00 569169754 C Ci:2:001:0 0 4 = 00010000
出力内容は各項目が空白毎に分れています、誤訳するといけないので各自で翻訳してね
以下、Kernel Documentation/usb/usbmon.txtの抜粋
Here is the list of words, from left to right:
- URB Tag. This is used to identify URBs, and is normally an in-kernel address
of the URB structure in hexadecimal, but can be a sequence number or any
other unique string, within reason.
- Timestamp in microseconds, a decimal number. The timestamp's resolution
depends on available clock, and so it can be much worse than a microsecond
(if the implementation uses jiffies, for example).
- Event Type. This type refers to the format of the event, not URB type.
Available types are: S - submission, C - callback, E - submission error.
- "Address" word (formerly a "pipe"). It consists of four fields, separated by
colons: URB type and direction, Bus number, Device address, Endpoint number.
Type and direction are encoded with two bytes in the following manner:
Ci Co Control input and output
Zi Zo Isochronous input and output
Ii Io Interrupt input and output
Bi Bo Bulk input and output
Bus number, Device address, and Endpoint are decimal numbers, but they may
have leading zeros, for the sake of human readers.
- URB Status word. This is either a letter, or several numbers separated
by colons: URB status, interval, start frame, and error count. Unlike the
"address" word, all fields save the status are optional. Interval is printed
only for interrupt and isochronous URBs. Start frame is printed only for
isochronous URBs. Error count is printed only for isochronous callback
events.
The status field is a decimal number, sometimes negative, which represents
a "status" field of the URB. This field makes no sense for submissions, but
is present anyway to help scripts with parsing. When an error occurs, the
field contains the error code.
In case of a submission of a Control packet, this field contains a Setup Tag
instead of an group of numbers. It is easy to tell whether the Setup Tag is
present because it is never a number. Thus if scripts find a set of numbers
in this word, they proceed to read Data Length (except for isochronous URBs).
If they find something else, like a letter, they read the setup packet before
reading the Data Length or isochronous descriptors.
- Setup packet, if present, consists of 5 words: one of each for bmRequestType,
bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0.
These words are safe to decode if Setup Tag was 's'. Otherwise, the setup
packet was present, but not captured, and the fields contain filler.
- Number of isochronous frame descriptors and descriptors themselves.
If an Isochronous transfer event has a set of descriptors, a total number
of them in an URB is printed first, then a word per descriptor, up to a
total of 5. The word consists of 3 colon-separated decimal numbers for
status, offset, and length respectively. For submissions, initial length
is reported. For callbacks, actual length is reported.
- Data Length. For submissions, this is the requested length. For callbacks,
this is the actual length.
- Data tag. The usbmon may not always capture data, even if length is nonzero.
The data words are present only if this tag is '='.
- Data words follow, in big endian hexadecimal format. Notice that they are
not machine words, but really just a byte stream split into words to make
it easier to read. Thus, the last word may contain from one to four bytes.
The length of collected data is limited and can be less than the data length
report in Data Length word.
うーと、結局USBホストとUSB Device(FOMA携帯)間のやり取りが確認されると言うこと
pepoと