OS/2 API Trace
Enabler/ Customizer/
Summarizer released

Dave Blaschke, Team IBM, just released his Operating System/2 API Trace Enabler/Customizer/Summarizer. Description : Enables or disables the tracing of 16-bit and 32-bit OS/2 APIs imported by an executable file without affecting its source code, and customizes and summarizes the tracing of 16-bit and 32-bit OS/2 APIs. The archive, os2trace.zip (958,93k), was uploaded onto Hobbes.

Click here to read FAQ @@@


OS/2 API Trace allows you to trace the 16-bit and 32-bit OS/2 APIs used by any application running on OS/2 2.0+ without requiring the application's source code or requiring the application to be recompiled and/or relinked. Simply enable the application for tracing and run it, and the OS/2 API calls (and optionally their parameters) made by the application are logged to a text file that is already formatted and in English. For convenience, the utility contains both a command-line and a graphical interface.

OS/2 API Trace provides several customization options that allow the user to trace as much or as little as desired. These options are stored in the operating system's .INI file so that they can be reused across as many traces as desired. Tracing attributes that can be customized include:

1) LOGGING LEVEL

Different levels of trace information can be logged, from terse (level 1):

Spl32EnumQueue Entry

Spl32EnumQueue Exit
Return code: 234

Spl32EnumQueue Entry

Spl32EnumQueue Exit
Return code: 0

through verbose (level 3):

Spl32EnumQueue Entry at 15:44:03.97, Return Address = 0x0004299B (MYAPP 0002:0002299B)
Parameter 1: PSZ = NULL
Parameter 2: ULONG = 0x00000003
Parameter 3: PVOID = NULL
Parameter 4: ULONG = 0x00000000
Parameter 5: PULONG = 0x000BBEC4
Parameter 6: PULONG = 0x000CDE34
Parameter 7: PULONG = 0x000CDE30
Parameter 8: PVOID = NULL

Spl32EnumQueue Exit at 15:44:04.12
Return code: 234 (ERROR_MORE_DATA)
Parameter 3: PVOID = NULL
Parameter 5: PULONG = 0x000BBEC4 [0x00000000]
Parameter 6: PULONG = 0x000CDE34 [0x00000004]
Parameter 7: PULONG = 0x000CDE30 [0x00000791]

Spl32EnumQueue Entry at 15:44:04.19, Return Address = 0x00042A0C (MYAPP 0002:00022A0C)
Parameter 1: PSZ = NULL
Parameter 2: ULONG = 0x00000003
Parameter 3: PVOID = 0x00FF0000
Parameter 4: ULONG = 0x00000791
Parameter 5: PULONG = 0x000BBEC4
Parameter 6: PULONG = 0x000CDE34
Parameter 7: PULONG = 0x000CDE30
Parameter 8: PVOID = NULL

Spl32EnumQueue Exit at 15:44:04.19
Return code: 0 (NO_ERROR)
Parameter 3: PVOID = 0x00FF0000
PRQINFO3[ 0 ]:
pszName = 0x00FF077F ["Proprint"]
uPriority = 0x0005
uStartTime = 0x0000
uUntilTime = 0x0000
fsType = 0x0002
pszSepFile = 0x00FF077E [""]
pszPrProc = 0x00FF0776 ["PMPRINT"]
pszParms = 0x00FF0775 [""]
pszComment = 0x00FF076A ["Proprinter"]
fsStatus = 0x0000
cJobs = 0x0000
pszPrinters = 0x00FF0788 ["IBMNULLP"]
pszDriverName = 0x00FF074B ["IBM42XX.IBM 4201 Proprinter II"]
pDriverData = 0x00FF063A
cb = 0x00000111
lVersion = 0x00000414
szDeviceName = "IBM 4201 Proprinter II"
abGeneralData:
0x00FF0662: 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 ................
0x00FF0672: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x00FF0682: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
-- More --

2) BUFFER LENGTH

Logging from buffers, such as character and integer, can be limited to a specified amount to prevent too much information being logged.

3) FILE WRAPPING

Logging to the text file can wrap (start over from the beginning) after a specified amount of trace information has been logged to prevent too much information being logged.

4) TIME STAMPING

API entry and exit times can be logged.

5) API INTERCEPTION

APIs loaded dynamically (loaded by Dos16GetProcAddr/Dos32QueryProcAddr
and invoked through indirection) can be traced.

6) DOS, GPI, AND WIN API GROUPS

Instead of tracing all 329 Dos APIs in DOSCALL1, all 537 Gpi APIs in PMGPI, or all 526 Win APIs in PMWIN, one or more groups of related APIs (such as memory management, semaphores, or file system from DOSCALL1) within these DLLs can be traced instead.

OS/2 API Trace is most useful for any of the following:

1) Debugging

To determine why OS/2 APIs are failing without having to setup a source
debugger.

2) Performance

To determine which OS/2 APIs are called the most and where most of the
application's execution time is spent within OS/2.

3) Reverse engineering

To determine how something is already being accomplished using the OS/2
API set.



CONTACT AUTHOR:
Dave Blaschke
IBM Austin, Texas
Internal (Notes) - Dave Blaschke@IBMUS
Internal (VM) - IBMUSM26(BLASCHKE)
External - blaschke@us.ibm.com


@Macarlo, Inc.
@Macarlo's Shareware & Web
OS/2
Java Lobby Member
Java Site Accredited

[TOP] [HOME] [INDEX]