Tracing Drivers on ArcaOS: Difference between revisions

From OS2World.Com Wiki
Jump to navigation Jump to search
(Created page with "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 t...")
 
No edit summary
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
By [[User:Martini]]
{{Article
 
|Author=[[User:Martini|Martin Iturbide]]
|Date=2021-01
|OS=ArcaOS 5.0.x
|File=N/A
|Source=N/A
}}
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.
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.


Line 6: Line 11:


==Before Starting==
==Before Starting==
Lars USB Driver support tracing, that means he coded the drivers with this "tracing support".  
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" asigned by Lars to his drivers
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
* USBUHCD.SYS:                        224
* USBOHCD.SYS:                        225
* USBOHCD.SYS:                        225
Line 19: Line 24:


==Enabling Trace==
==Enabling Trace==
Add the following on the config.sys if you want to trace the "239" driver.
Add this on the config.sys:
TRACEBUF=2048 /M=W,Q,NODTI /D=ALL
  TRACEBUF=2048 /M=W,Q,NODTI /D=ALL
  TRACE=ON 239
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:
For several drivers you do something like:
TRACEBUF=2048 /M=W,Q,NODTI /D=ALL
  TRACE ON 224,225,226
  TRACE=ON 224,225,226
 
Now reboot.


==Reproducing the Error==
==Reproducing the Error==
Line 39: Line 44:
Run "tracefmt.exe" which is the executable for the "[[OS/2 System Trace Formater]]" and you can see the log there.
Run "tracefmt.exe" which is the executable for the "[[OS/2 System Trace Formater]]" and you can see the log there.


[[Image:na.PNG]]
[[Image:tracefmt.PNG|500px]]


It not that we can understand much, but this will help the developer to find out something that is not working as it should.  
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.
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==
==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.
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]]
* [http://www.warpcave.com/os2diags/TraceRef.txt Trace Reference]
[[Category:How To]]

Latest revision as of 21:58, 19 June 2022

Article Info
Author Martin Iturbide
Date 2021-01
OS Version ArcaOS 5.0.x
Companion File N/A
Source N/A

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