Tracing Drivers on ArcaOS

By User:Martini

Everyday you learn something new, right? One of the things that I never did on OS/2 Warp was to generate trace logs on device drivers to help developers to see what can it be going wrong with it. I never did this until now that I have collaborated with Lars Erdmann with the USBAudio driver and wanted to see some trace log.

Right now I'm using ArcaOS 5.0.6 and I never did driver tracing before, so Lars point me to his USB driver readme to learn more about the trace procedure.

Before Starting
Netlabs' USB Drivers supports tracing, that means he coded the drivers with this "tracing support" to enable logs.

This seems to work by assigning "major code numbers" to each driver, so you can "name it" to request the trace. Here it is the list of "major codes" assigned by the developer to the USB drivers:
 * USBUHCD.SYS:                       224
 * USBOHCD.SYS:                       225
 * USBEHCD.SYS:                       226
 * USBD.SYS:                          227
 * USBHID.SYS,USBKBD.SYS,USBMOUSE.SYS: 228 (minor codes: HID:0x00-0x3F, USBMOUSE: 0x40-0x7F, USBKBD: 0x80-0xFF)
 * USBCOM.SYS:                        229
 * USBAUDIO.SYS,USBAUD2.SYS:          238 (minor codes: USBAUDIO: 0x00-0x7F, USBAUD2: 0x80-0xFF)
 * USBMSD.ADD:                        239

Enabling Trace
Add this on the config.sys: TRACEBUF=2048 /M=W,Q,NODTI /D=ALL Now reboot.

Open a command line session and set the following, if you want to trace the "239" driver. TRACE ON 239

For several drivers you do something like: TRACE ON 224,225,226

Reproducing the Error
At this moment you have your system with the tracing enabled for an specific driver. Now you have to reproduce the error that you have by using the driver and see later what the tracing tool tells you.

Now it is the moment try again the audio card or USB device that does something strange.

The Trace Tool
Now it is the time to see the tracing tool and see what it told us.

Run "tracefmt.exe" which is the executable for the "OS/2 System Trace Formater" and you can see the log there.



It not that we can understand much, but this will help the developer to find out something that is not working as it should.

Now save the trace file as .ftf file, Lars prefer the "FORMATTED trace" to review the file, but it may also depend on what the developer tells you.

Once you take your trace you can execute a: TRACE OFF

You can erase the trace log with: TRACE /C

Conclusions
Remember that the developer may ask you to generate different trace files with different drivers versions and doing different things on the system, this process may require patience.

Links

 * OS/2 System Trace Formater
 * Netlabs' USB Drivers
 * Trace Reference