[BRLTTY] introduction and a problem

Dave Mielke dave at mielke.cc
Sat Aug 7 20:05:53 EDT 2010


The USB people would like to see a usbmon trace of the problem. They'd prefer 
that you use the latest possible kernel, so the 2.6.35 kernel from Debian 
Experimental would be a good choice. Here's how to get the trace.

First, you need to mount and activate the kernel debug system:

   mount -t debugfs debugfs /sys/kernel/debug
   modprobe usbmon

Note that the modprobe command may fail with a message like "FATAL: Module 
usbmon not found.". This may mean that the kernel doesn't support usbmon, but 
the more likely case is that usbmon has been compiled into the kernel and, 
therefore, isn't available (or even needed) as a module. You can test to see if 
you now have usbmon with the command:

   ls /sys/kernel/debug/usb/usbmon

You should see a bunch of names which (from my system) look like:

   0s  0u  1s  1t  1u  2s  2t  2u  3s  3t  3u  4s  4t  4u

The way to capture a trace of all the USB activity on your system is to use a 
command like:

   cat 0u >/path/to/log-file

While the cat command is running, do whatever causes the problem (of course 
from a different terminal, window, or whatever). When you're done, kill the 
cat. I hope no over-zealous animal protectionists take that one out of context 
- I actually like cats.

Your log file should have lines which look like this:

   d4fb9300 803461077 C Bo:1:006:3 0 31 >
   d4fb9300 803461132 S Bi:1:006:2 -115 13 <
   d4fb9300 803461954 C Bi:1:006:2 0 13 = 55534253 b98d0000 00000000 00

As mentioned above, using 0u will contain a detailed log of all of the USB 
activity on your system (so don't type or look at anything you don't want 
others to discover). The number before the "u" is a USB bus number. Since USB 
bus numbers start from 1, 0 is used by usbmon to mean "all buses". You can 
limit the trace to only capture USB activity on the bus to which your device is 
actually connected if you're willing to put in a bit more effort. This'll also 
make it a lot easier for the USB people to analyze the problem.

The way you find out which USB bus your device is connected to is by inspecting 
the file "/proc/bus/usb/devices". Simply editing it is fine. In it, you'll find 
a group of lines, one per device, separated by a blank line. In each group 
you'll find one or more lines which start with "S:" (stands for "string"), 
which tell you things about the device like its vendor's name, its product 
name, its serial number, etc. Use these "S:" lines to figure out which group of 
lines is for your device. Then go to the first line of that group, which will 
start with "T:" (stands for "topology"), to find out the bus number. The bus 
number may have a leading zero which you should ignore.

On my system, for example, one of the device descriptions in my current 
"/proc/bus/usb/devices" file starts with these lines:

   T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
   D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
   P:  Vendor=0421 ProdID=0214 Rev= 1.00
   S:  Manufacturer=Nokia
   S:  Product=N86 8MP

So, as you can see, at the moment I happen to have my cell phone connected to 
USB bus number 2. I could, therefore, monitor its USB activity by capturing a 
usbmon trace from only USB bus number 2. I'd do this by using 2u instead of 0u.

Please let me know if any of this isn't clear enough. When you have a usbmon 
trace which illustrates the problem, attach it to a post to this list.

-- 
Dave Mielke           | 2213 Fox Crescent | The Bible is the very Word of God.
Phone: 1-613-726-0014 | Ottawa, Ontario   | 2011 May 21 is the Day of Judgement.
EMail: dave at mielke.cc | Canada  K2A 1H7   | 2011 Oct 21 is the End of the World.
http://FamilyRadio.com/                   | http://Mielke.cc/bible/


More information about the BRLTTY mailing list