home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tracecmd.zip
/
trace.doc
next >
Wrap
Text File
|
1998-07-09
|
62KB
|
1,618 lines
Trace enhancements for FixPack 35
July 9, 1998
OS/2 Fix Distribution
Personal System Products
Austin, Tx
(c) Copyright International Business Machines Corporation, 1997.
All rights Reserved.
July 9, 1998 - Warp Debug
July 9, 1998 - Warp Debug
CONTENTS
1.0 System Trace (SysTrace) facility . . . . . . . . . . . . . 1
1.1 Config.sys statements . . . . . . . . . . . . . . . . . . 2
1.2 Command Line Interfaces and Utilities . . . . . . . . . . 4
1.2.1 TRACE . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1.1 TRACEPOINT CONTROL . . . . . . . . . . . . . . . . 5
1.2.1.2 CONTROL OPTIONS . . . . . . . . . . . . . . . . . 9
1.2.1.3 OPTIONAL DATA CONTROL . . . . . . . . . . . . . . 10
1.2.1.4 BUFFER CONTROL . . . . . . . . . . . . . . . . . 10
1.2.2 TRACE examples . . . . . . . . . . . . . . . . . . . 11
1.2.3 TRACEFMT . . . . . . . . . . . . . . . . . . . . . . 13
1.2.4 TRACEGET . . . . . . . . . . . . . . . . . . . . . . 14
1.2.5 TRSPOOL . . . . . . . . . . . . . . . . . . . . . . . 15
1.2.6 DTRACE . . . . . . . . . . . . . . . . . . . . . . . 15
1.2.7 MAPTSF . . . . . . . . . . . . . . . . . . . . . . . 15
1.2.8 SYSSPLIT . . . . . . . . . . . . . . . . . . . . . . 18
1.2.8.1 Trace formatting files - SYSTEM.TFF . . . . . . . 19
1.2.9 TDFLST . . . . . . . . . . . . . . . . . . . . . . . 20
1.2.10 TFFLST . . . . . . . . . . . . . . . . . . . . . . . 20
1.3 Appendix A New Tracepoints Cross-reference. . . . . . . 21
Contents ii
July 9, 1998 - Warp Debug
1.0 SYSTEM TRACE (SYSTRACE) FACILITY
The system trace facility collects information about specific
events to be logged into the trace buffer as they occur. While
there are several uses for this information the main one is to
assist in problem resolution.
Enhancements have been made to:
■ Select process to be traced by process short name
■ Enablement of Dynamic Tracing at interrupt time
■ Allow Dynamic Trace to handle forwarded DLLs.
■ The 256 major code limit has been removed for Dynamic
tracepoints. Static tracepoints will retain the restriction to
maintain compatibility with the rest of the system.
■ The buffer can be grown dynamically (and without requiring a
reboot) up to:
- 5120 KB - from config.sys (TRACEBUF statement)
- Whatever is available - from a command line (TRACE function)
Note: While not defined the upper limit will be somewhere
around 384 MB. This is variable and based on the current
state of the user's system.
■ Additional Buffer behavior
The buffer will continue to be a wrapping buffer but the
user now has the option to have logging to the buffer
stopped when the buffer is full.
A minimum size of 128k is imposed if a buffer is requested.
The user should request a buffer large enough to avoid loss
of data but small enough not to impact memory requirements.
In practice a buffer size no larger than 1Mb should be
suitable for most tracing requirements. If a larger capacity
is required the TRSPOOL utility (described later) can be
used as an alternative to defining a larger buffer.
The buffer will be comprised of a series of 64KB segments.
This will be transparent to the user and is done for
efficiency purposes.
Each trace record and buffer segment will be time-stamped.
The buffer segment will contain a starting time-stamp that
is set when the first record is written and an ending
time-stamp that is originally allocated to zero and updated
when:
1. The system selects the next buffer segment,
2. When TRACE OFF is entered
3. When TRACE OFF /P:ALL is entered
4. When TRACE /S is entered
System Trace (SysTrace) facility 1
July 9, 1998 - Warp Debug
5. When no-wrap mode is in effect and the last trace buffer
segment fills.
Defaults for buffer options:
Wrapping (/M:W)
NonQueued (/M:NQ)
Do not use IPI. (/M:NODTI)
Buffer size = 128KB (will be set to 128 if anything less
than 128 is requested)
1.1 CONFIG.SYS STATEMENTS
The SysTrace facility has a config.sys statement (TRACEBUF) that
allows the user to specify information about the trace buffer.
While it is a good idea to specify this information so that it is
available at startup time it is not required since there is a
command line interface (TRACE ON /B:xxx) that can serve the same
purpose.
WARNING: There should be only one (1) TRACEBUF statement in the
config.sys file. If there are more than one the buffer size from
the last one will be used. The /M and /D parameters function in a
cumulative manner so all of the requests in these functions will be
set as they are processed. An example is:
TRACEBUF=128,/M:W,Q,DTI
TRACEBUF=512,/M:NW,NQ
The result of the previous 2 statements would be:
TRACEBUF=512,/M:NW,NQ,DTI
where:
512 - came from the last statement
NW - came from the last statement
NQ - came from the last statement
DTI - came from the first statement
The syntax of this command is: TRACEBUF=nnn [,/M] [,/D]
■ nnn - This mandatory field sets the size of the buffer (in KB).
The size must be between 1 and 5120.
■ /M=<mode> - This specifies the mode of the buffer. There are
several acceptable values for <mode>and multiples can be
provided if separated by a comma. They are:
- W or WRAP - Wrapping mode.
This specifies that the buffer will wrap when it is full.
This will cause the oldest data to be replaced with newer
data. While this does cause lost data it is the most
efficient way to see a current system activity. This mode
(W) will be used unless the non-wrapping mode is
System Trace (SysTrace) facility 2
July 9, 1998 - Warp Debug
specified.
- NW or NOWRAP - Non-Wrapping mode
This specifies that the buffer will not wrap but will
suspend the SysTrace facility when the buffer is full.
While this will not overwrite data it also may not show a
current view of system activity.
- NQ or NOQUEUED - Non-Queued mode.
Trace records will be discarded if the trace facility is
busy at the time the write is attempted. This is not as
bad as it sounds since the SysTrace facility is efficient
in writing to the buffer and records are very seldom
discarded. This mode (NQ) will be used unless the Queued
mode is specified.
This option is provided for the case where tracing with
Queued Mode would sufficiently alter timing dependencies
of device drivers that handle interrupts from slow or
asynchronous devices. The recommendation is that QUEUED
mode be used unless a problem with I/O time-out or
performance occurs.
Note: When trace events are lost due to non-queue mode
being in effect then a "Lost Events" major code 0, minor
code 1 is generated and the next available opportunity.
This is done regardless of minor code 0 tracing being
active.
- Q or QUEUED- Queued mode.
This will cause trace records to be queued (held) if the
trace facility is busy. They will be written when the
facility is available. This will maintain the integrity
of the trace file but could have an adverse affect on
performance.
- DTI - DTI mode
Dynamic Trace uses Inter Processor Interrupt (IPI) for
single stepping tracepoints. While this may provide more
reliable trace data it also locks out all of the other
processors on a SMP system. This option should only be
used when necessary because of the performance impact.
Note: DTI mode only takes affect on SMP systems. It will
be overridden for certain tracepoints that occur within
Ring 0 code to avoid deadlocks from occurring.
- NODTI or NDTI- Non-DTI mode
Dynamic Trace does not use IPI. This mode will be used
unless the DTI mode is specified.
■ /D=<optional data> - This specifies what optional system data
System Trace (SysTrace) facility 3
July 9, 1998 - Warp Debug
will be captured, if available. Acceptable values for <optional
data> are:
- PROCNAME - Capture the short name for the process
- TID - Capture the Task ID
- SLOT - Capture the Thread's Slot
- CSEIP - Capture the caller's CS:EIP
Note: Will not be collected if trace is called directly
through the kernel interface (K_S_Systrace).
- SSESP - Capture the caller's SS:ESP
Note: Will not be collected if trace is called directly
through the kernel interface (K_S_Systrace and K_D_SysTrace).
- TSC - Capture Pentium High Resolution Time-Stamp counter.
This will be ignored (no error) if not supported by the
hardware.
- ALL - Capture all of the optional data
- NONE - No optional data will be captured. This is the default
if the /D parameter is not specified.
1.2 COMMAND LINE INTERFACES AND UTILITIES
1.2.1 TRACE
The Trace command line interface has been enhanced to allow the
user to turn on Trace for a specific module by its shortname,
allocate or de-allocate the trace buffer, set the type of trace
buffer that is required (wrapping or non-wrapping), and query the
trace facility for its current status.
All existing options will function as they currently do. The format
of the command with a discussion of the enhancements follows:
TRACE [ON|OFF] [major_code_spec | (minor_code_spec) | tdf_spec |
(minor_code_spec) | (event_type_spec) | tdf_keyword |
(minor_code_spec) | (event_type_spec) | /P:pid_spec |
/N:<process name>] [/S] [/R] [/C] [/B:<size of buffer in KB>]
[/M:<mode>] [/D:<optional data>] [/Q]
The following sections illustrate parameters that are valid for
System Trace (SysTrace) facility 4
July 9, 1998 - Warp Debug
functions provided by the TRACE command.
Note: If "TRACE" is used without any parameters help information
will be returned showing the proper syntax of the command.
1.2.1.1 TRACEPOINT CONTROL
TRACE ON|OFF {[major_code_spec [(minor_code_spec)]..} [/R|/S] [/C] [/Q]
TRACE ON|OFF {[module_spec [(event_type_spec)]..} [/R|/S] [/C] [/Q]
TRACE ON|OFF {[tdf_spec [(event_type_spec)]..} [/R|/S] [/C] [/Q]
TRACE ON|OFF [KERNEL [(event_type_spec)] [/R|/S] [/C] [/Q]
TRACE ON|OFF /N:<process name> [/R] [/S] [/C] [/Q]
TRACE ON|OFF /P:pid_spec [/R] [/S] [/C] [/Q]
■ ON - The specified tracepoints are turned ON. This has a
cumulative effect and does not affect tracepoints that are
already on.
■ OFF - The listed tracepoints (All tracepoints if none are
listed) are being turned OFF.
■ major_code_spec - A tracepoint major code. The following major
code ranges have been defined.
- 0 - 244 Static and Dynamic trace for IBM use
- 245 - 255 Static and Dynamic for User use.
- 256 - 32767 Dynamic Trace for IBM use.
- 32768 - 65535 Dynamic Trace for User use.
■ minor_code_spec - A list of ranges of minor codes
Note: More than one major_code_spec with minor_code_spec may be
specified.
■ module_spec - The module name for which an associated trace
definition file (TDF) exists.
Note: The associated TDF assumes the same name as the module.
The TDF file is located by searching in the following order:
- in the current directory
- in DPATH
- in \OS2\SYSTEM\TRACE
- in \OS2\SYSTEM\TRACE\SYSTEM.TDF
- in the load module directory
- for base device drivers also in the root directory of the
boot drive.
If the TDF specifies that the DLL is a fowarder DLL then the
forwarded DLL is searched for in the current directory and
LIBPATH if not already loaded.
■ event_type_spec - A list of minor code ranges, groups and types.
If TRACE cannot find a module specified in module_spec then
System Trace (SysTrace) facility 5
July 9, 1998 - Warp Debug
tdf_spec is assumed and TRACE searches directly for a TDF of
the name specified in the order specified above. The module
name is then derived implicitly from the name specified
within the TDF.
If KERNEL is specified then \OS2\SYSTEM\TRACE\OS2KRNL.TDF is
assumed with module OS2KRNL (or DOSCALLS.DLL).
Note: More than one module_spec with event_type_spec may be
specified.
■ /N:<process name> - This will allow the user to control tracing
by the name of a module. More than one name can be entered as
long as they are separated by a comma. An example is
/N:name1,name2.
This provides an alternate method of turning on Trace when
the PID is not known. This parameter is valid when turning
Trace ON or OFF but not valid if /P is also specified.
NOTE: Verification of the name will follow the same method
as DosExecPgm. They are:
1. If a path is specified, no search is performed. The name
is registered even if it does not exist so that tracing
will be started when the process is added to the system.
Trace events will be logged only if the process exists
when tracing is started.
2. If a name is specified with an extension but no path, an
attempt is made to find the process by searching the
current directory. If not found in the current directory,
the directories specified in the PATH statement (in
config.sys) are searched.
3. If a shortname is specified (no path, no extension), .exe
is assumed as the extension and the method specified in
method 2 is used.
■ /P:<pid_spec> - This allows the user to specify a PID number.
By default ALL pids are on.
■ /R - This resumes tracing if tracing was previously suspended.
■ /S - This suspends tracing.
■ /C - This clears the trace buffer.
■ /Q - Returns the state of the Trace facility. Information will
be returned on all of the tracepoints and will include:
Suspend command if the Trace facility is currently
suspended.
Buffer Size
Buffer collection mode (W or NW, Q or NQ, etc)
System Trace (SysTrace) facility 6
July 9, 1998 - Warp Debug
Optional Data being captured
PIDs being traced
Tracepoints currently ON - No group names will be
displayed; all tracepoints turned on as a result of using a
group name will be displayed.
Note: /Q is valid with or without other keywords.
Note: If "TRACE OFF" is used without any parameters ALL tracepoints
will be turned off.
The TRACE command provides additional flexibility of the previous
versions in the way it processes TDFs:
TRACE OFF is now valid with a full tdf_spec or module_spec.
This allows individual and groups of tracepoints to be
selectively removed.
TRACE no longer requires the TDF name to match the module name,
thus there is no longer a need to rename OS2KRNLD.TDF to
OS2KRNL.TDF when using the ALLSTRICT kernel. Tracepoints would
be activated by specifying TRACE ON OS2KRNLD
The TRACE command will merge tracepoints with those already
activated when making repeated invocations that apply
tracepoints to the same load module. Thus in the case of
PMWIN.DLL, PMGRE.DLL and PMSHAPI.DLL, each of which is a
forwarder DLL and has its tracepoints located in PMMERGE.DLL,
their tracepoints may be applied cumulatively with three
invocations thus:
TRACE ON PMWIN
TRACE ON PMGRE
TRACE ON PMSHAPI.
Previous versions of the SYSTRACE facility did not permit this.
For added serviceability: tracepoints definitions have been
provided for internal kernel interfaces. Each tracepoint records
32-bytes of stack on entry to the given routine. These definitions
are mainly intended for service personnel, however the following
may be of use to developers writing virtual device and file system
drivers:
TRACE ON KRNLxFS(FSH) will trace File System Helper calls.
TRACE ON KRNLxVDM(VDH) will trace Virtual Device Helper calls.
Note: In the above two commands "x" should be replaced with "R"
when using the RETAIL kernel, "B" when using the HSTRICT kernel
and "D" when using the ALLSTRICT kernel.
Other kernel trace definitions provided are:
System Trace (SysTrace) facility 7
July 9, 1998 - Warp Debug
KRNLxTK: Tasking and Scheduler TK, SCH, VR, XCPT,
SYSSERV, KM, SCI, SIG
KRNLxSEM: Semaphore SEM, KSEM, MUX, RAM, SYSSEM,
KRNLxPG: Page Manager PG
KRNLxSM: Swapper Manager SM
KRNLxVM: Virtual Memory Manager VM BMP RMP
KRNLxSEL: Selector Manager SEL
KRNLxTOM: Timer Manager TOM TIM
KRNLxLDR: Loader LDR
KRNLxVDM: Virtual Dos Machines VDH EM86 DEM VDM VPM
KRNLxFS: File System FSH DIR EA FAT FCB FNotify
FSD MFT SF VPB
KRNLxDEV: Device and IO DEV IO DRIVE DSK dh PSD
KERNEL: Spin Lock APIs LOCK (SMP Only)
DOSCALL1: Spin Lock APIs LOCK (SMP Only)
DOSCALL1: Quecalls APIs QUE
DOSCALL1: Universal Thunks UT
*** Normally this should be turned off if tracing ALL APIs due to the
large number of additional trace entries it will cause.
So if you do:
TRACE ON DOSCALL1
you should also do:
TRACE OFF DOSCALL1(UT).
Each of these tracepoints in these TDFs have type specifications
as follows:
PRE - Entry point
POST - Exit point (currently not defined)
PRIV - Routines private to a component
(name begins with a lower case character)
PUB - Routines exported to other kernel components
(name begins with an upper case character)
WARNING: Do not use DTI mode with any of the above KRNLxxxx
tracepoints on SMP systems that have 3 or more processors. This is
because there is an exposure to a 3-way deadlock arising from
tracepoints placed in ring 0 code that owns non-interruptable spin
locks.
Note: In general when tracing system APIs it is recommended that
KERNEL and DOSCALL1 groups be specified together. This is because
for some APIs, processing is are split between DOSCALL1 and
OS2KRNL. Some information is traced at the DOSCALL1 interface and
the rest at the OS2KRNL interface.
Similarly, TRACE ON DOSCSALL1(QUE) should be used with TRACE ON
QUECALLS to obtain complete information pertaining to QUECALLS API
tracing.
New trace definitions have been added for exported interfaces to
the following modules:
System Trace (SysTrace) facility 8
July 9, 1998 - Warp Debug
Module Tracepoint Groups
HPFS.IFS -
CDFS.IFS -
PMWP.DLL WIN WP SHL NWI
PMVIOP.DLL VDM WIN VIO
PMVDMP.DLL VDM DOS
Each of these tracepoints in these modules have type specifications
as follows:
PRE - Entry point
POST - Exit point (currently not defined)
PRIV - Routines private to a component
(name begins with a lower case character)
PUB - Routines exported to other kernel components
(name begins with an upper case character)
All System API tracepoints have been updated to include the
caller's return address. To facilitate this, all APIs that have a
thunking interface in DOSCALL1 have a corresponding tracepoint
defined their entry module to allow the caller's return address to
be recorded. This applies to QUECALLS, SESMGR and KERNEL.
For example: 32-bit programs calling DosSleep enter DOSCALL1 at
DOS32SLEEP and then the KERNEL at DOSSLEEP, whereas 16-bit programs
calling DosSleep make a direct call to the Kernel at entry point
DOSSLEEP. The DOSSLEEP tracepoint in the Kernel records the
paramters and 16-bit return address. This should be used in
conjunction with the DOS32SLEEP tracepoint in DOSCALL1 to record
the return address to an original 32-bit caller.
The Fast Safe RAMSEM APIs have been enhanced to record parameters
and details of the semphore.
From Fix Pack 37, DOS32RAISEXCPETION will record parameters and
format the Exception Report Record.
From Fix Pack 37, DOS32R3EXCEPTIONDISPATCHER,
DOS32EXCEPTIONCALLBACK and XCPTEXECUTEUSEREXCEPTIONHANDLER have
been added to DOSCALL1's EXMG tracepoint group. These record
Exception Context, Registration and Report Records during the
dispatching of user exception handler's.
For a full list of the new API tracepoints to the KERNEL, DOSCALL1
and SESMGR, see Appendix A below.
1.2.1.2 CONTROL OPTIONS
TRACE [/R | /S] [/C] [/Q]
System Trace (SysTrace) facility 9
July 9, 1998 - Warp Debug
These options can be used with the ON parameter. However, these
must follow all of the parameters of the ON parameter.
■ /R - This resumes tracing if tracing was previously suspended.
■ /S - This suspends tracing.
■ /C - This clears the trace buffer.
■ /Q - Returns the state of the Trace facility. This is the same
as previously defined in the "TRACEPOINT CONTROL" section.
1.2.1.3 OPTIONAL DATA CONTROL
TRACE ON | OFF [/D:<optional data>]
■ ON - The specified optional data will be collected. This has a
cumulative effect.
■ OFF - The specified optional data will no longer be collected.
■ /D:<optional data> - This specifies what optional system data
will be captured.
This is used with the ON or OFF keywords and is valid only
when a buffer has been allocated. This informational is
GLOBAL to the trace facility and not set on a per tracepoint
basis. Multiple entries are separated by a comma.
Values and behavior will be the same as previously defined
in the TRACEBUF config.sys statement.
The data will only be collected if available.
1.2.1.4 BUFFER CONTROL
TRACE ON /B:<buffer size in KB> [/M:xxx] [/R | /S] [/D:<optional data>]
TRACE OFF /B
■ ON - The buffer will be allocated using the specified options.
■ OFF - The buffer will be deallocated.
■ /B:[<buffer size>] - This sets the size of the buffer (in KB) if
used with the ON keyword and deallocates the buffer (no size
allowed) if used with the OFF keyword.
When used with the ON keyword.
System Trace (SysTrace) facility 10
July 9, 1998 - Warp Debug
The buffer size must be numeric.
Minimum Value = 1, Maximum value is unlimited (An
error will be returned if the buffer can not be
allocated. A value of 128 or less will cause a 128KB
buffer to be allocated.
After the first 128KB, the size will be rounded up
to the next multiple of 64KB so that the proper
number of buffers can be created.
When used with the OFF keyword.
No size is allowed. The parameter will be simply /B.
When the buffer is deallocated the following happens:
The buffer is deallocated causing all data to be
cleared.
■ /M:<mode> - This specifies the mode of the buffer and will be
accepted if a buffer is allocated. Values and behavior will be
the same as previously defined in the TRACEBUF config.sys
statement.
■ /R - This resumes tracing if tracing was previously suspended.
■ /S - This suspends tracing.
■ /D:<optional data> - This specifies what optional system data
will be captured.
This is used with the ON or OFF keywords and is valid only
when a buffer has been allocated. This informational is
GLOBAL to the trace facility and not set on a per tracepoint
basis. Multiple entries are separated by a comma.
Values and behavior will be the same as previously defined
in the TRACEBUF config.sys statement.
The data will only be collected if available.
NOTE: The buffer options (/B:, /M:, and /D:) will be used until the
system is booted. If you want the options to be more permanent they
can be specified in the config.sys file (TRACEBUF statement).
1.2.2 TRACE EXAMPLES
Allocate a wrapping 320KB trace buffer.
TRACE ON /B:320 /M:W
System Trace (SysTrace) facility 11
July 9, 1998 - Warp Debug
Note: An error will be returned if the buffer is already allocated.
Allocate a wrapping 320KB trace buffer using default values where
possible (Wrapping mode) and specify what optional data (shortname
and SS:ESP) to capture.
TRACE ON /B:320 /D:PROCNAME,SSESP
Allocate a wrapping 320KB trace buffer and put the Trace facility
in suspended mode. No tracing will be possible until the user puts
the trace facility in the resume mode.
TRACE ON /B:320 /M:W /S
Deallocate a previously allocated trace buffer.
TRACE OFF /B
Note: This command will not affect any optional system data or
tracepoints that have been previously defined. When the buffer is
next allocated (TRACE ON /B:xxx) the optional data and tracepoints
when again be active.
Change the optional system data that is being collected to be ALL
possible data.
TRACE ON /D:ALL
Change the optional system data that is being collected to NOT
collect the TID.
TRACE OFF /D:TID
Enable for All available major codes. However, major code 1 is used
for performance testing and will only be enabled if a DEKKO card is
present in the hardware.
Trace ON
Enable for major code 13.
Trace ON 13
Enable for doscall1.
Trace ON DOSCALL1
Enable for processes (ffst and notes)
TRACE ON /N:ffst,notes
The format for the command to stop tracing is the same as enabling
tracing except for the keyword. The keyword used to stop tracing is
OFF. The following command would stop tracing for major codes 6 and
System Trace (SysTrace) facility 12
July 9, 1998 - Warp Debug
13.
TRACE OFF 6,13
Note: If TRACE OFF is used without any other parameters ALL
tracepoints will be turned OFF.
Suspend Tracing
TRACE /S
Resume Tracing
TRACE /R
Clear the Trace buffer. Tracing must be suspended or disabled for
this option to be valid.
TRACE /C
Query the Trace facility.
TRACE /Q
If the TRACE facility was ON (for major codes 3,4, and 5) with a
wrapping buffer of 256K this would return (all parameters will be
displayed even if they could have been defaulted) the following:
TRACE ON /B:256 /M:W
TRACE ON 3,4,5
The commands will be broken into a series of commands if the
command goes longer than 80 characters. The first command (no
longer than 80 characters) will have buffer information and
tracepoints that are ON while the rest of the commands will only
have tracepoints. EXAMPLE: If tracepoints 4-30 are on with a 512KB
non-wrapping buffer the data returned would be:
TRACE ON /B:512 /M:NW
TRACE ON 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
TRACE ON 23,24,25,26,27,28,29,30
NOTE: If you turn on tracepoints using GROUP names the QUERY will
return everything that was turned on (not the group name).
1.2.3 TRACEFMT
The Tracefmt command starts the trace formatter which provides a
user interface to the trace buffer. It has been enhanced to:
■ Display the System Optional Data
■ The Processor ID (CPU ID) has been added to the Select...
(Search) function (under VIEW action bar item) so that only the
System Trace (SysTrace) facility 13
July 9, 1998 - Warp Debug
records for a single Processor can be displayed.
■ An option has been added to allow unformatted data to be
displayed in dump format (Hex and ASCII). This new option
"Display in Dump Format" is under the VIEW action bar item. It
will toggle on and off the same as the other display options.
This will not affect data that is subject to a formatting
control (except for %U).
■ The default display type has been changed to the new Dump
format. This will be used for data if formatting instructions
have not been provided.
■ There is a new command line switch (/f=output_file_name) that
allows the formatted output to be directed directly to an output
file. When /f is specified TRACEFMT will close as soon as the
input trace data has been formatted and written to the output
file. The full syntax for the TRACEFMT command is:
TRACEFMT <input> </t=tff_path> </f=output>
where:
<input> specified either a RAW trace buffer (from TRACEGET or
TRSPOOL) or an unformatted trace file saved by TRACEFMT.
</t=tff_path> specifies the TFF path name. This defaults to
\OS2\SYSTEM\TRACE
<f=output> specifies the output formatted file name.
1.2.4 TRACEGET
The TRACEGET command will extract the System Trace buffer and
save it in a file. The command syntax is :
TRACEGET file
where:
file - The name of the file where the buffer will be written.
System Trace (SysTrace) facility 14
July 9, 1998 - Warp Debug
1.2.5 TRSPOOL
TRSPOOL extends the usefulness of the OS/2 system trace facility
by capturing the system trace buffer and spooling it to a
cyclically used sequence of disk files (named TRACEBUF.nnn,
where nnn is a sequential number starting with 000). The
captured trace disk files may be later formatted using TRACEFMT,
by selecting the Open option of the File menu.
For information about this utility please see the file
TRSPOOL.DOC in the OS2\SYSTEM directory.
1.2.6 DTRACE
DTRACE is a utility that allows an experienced user to define
dynamic tracepoints where tracepoints were not previously
located.
For information about this utility please see the file
DTRACE.DOC in the OS2\SYSTEM directory.
1.2.7 MAPTSF
This utility will generate a TSF from a MAP file. One tracepoint is
generated for each public code symbol. Optionally a return tracepoint
may be generated for each public code symbol.
The syntax is:
MAPTSF map_file [/MAJOR=major_code]
[/MODNAME=name]
[/MAXDATALENGTH=max_data_length]
[/MINORSTART=minor_code]
[/TEMPLATE=template_file]
[/LOGSTACK=stack_bytes]
[/EXCLUDE=string[*][,....]]
[/INCLUDE=string[*][,....]]
[/REGISTERS=reg[,reg]...]
[/LOGRETURN]
[/RETEP]
[/CASESENSITIVE]
[/TYPES]
[/GROUPS=string[,.....]]
The parameters are:
■ map_file (only REQUIRED parameter)
■ /MAJOR
Specifies the major code to be used in the MAJOR= statement of the TSF.
If omitted, TRCUST will select the default major code of 1 when compiling the TSF.
System Trace (SysTrace) facility 15
July 9, 1998 - Warp Debug
■ /MODNAME
Specifies the module name to be used in the MODNAME= statement of the TSF.
If omitted, MAPTSF will use the module name that appears in the second line of
the MAP file.
Note: The MAP file excludes the module extension. TRCUST will assume an
extension of DLL if not specified.
■ /MAXDATALENGTH
Specifies the MAXDATALENGTH= statement of the TSF. If omitted, TRCUST will
assume the default of 512 when compiling the TSF.
■ /MINORSTART
Specifies the first minor code. Subsequent tracepoints have incremental minor
codes. If omitted, the MINOR= statement is not generated. TRCUST will assume
an initial minor code of 1 and increment for each tracepoint.
■ /INCLUDE
Specifies a comma delimited list of case insensitive strings used as inclusion
criteria for public symbols. An optional trailing * signifies a generic match. If
both /INCLUDE and /EXCLUDE are specified then the logical OR of their criteria is
used for selection.
For example:
/INCLUDE=dos*,strupr
Inludes all public symbols beginning 'dos' or equal to 'strupr'.
/EXCLUDE=s* /INCLUDE=strupr
Excludes all public symbols beginning 's' except for 'strupr' and includes everything else.
■ /EXCLUDE
Specifies a comma delimited list of case insensitive strings used as exclusion criteria for
public symbols. An optional trailing * signifies a generic match. If both /INCLUDE and
/EXCLUDE are specified then the logical OR of their criteria is used for selection.
See the examples under /INCLUDE.
■ /CASESENSITIVE
Switch that applies to /INCLUDE and /EXCLUDE. If specified then the include and
exclude strings will be match on a case-sensitve basis.
■ /LOGSTACK=n
Specifies the number of bytes of stack to log for entry tracepoints. This
causes the following TSF statements to be generated for each entry tracepoint:
for 16-bit code:
System Trace (SysTrace) facility 16
July 9, 1998 - Warp Debug
REGS=(SP,SS),
FMT="Stack pointer SS:SP=%A->",
MEM=(RSS+SP,D,n),
FMT="1W"
for 32-bit code:
REGS=(ESP),
FMT="Stack pointer ESP=%F->",
MEM32=(FESP,D,n)
FMT="1F"
If /LOGSTACK is specified without a value then 16 bytes is assumed.
■ /LOGRETURN
Specifies that for each return tracepoint, the return value in AX/EAX should be
logged. This causes the following TSF statements to be generated:
for 16-bit code:
REGS=(AX)
FMT="Returns (ax) %W"
for 32-bit code:
REGS=(EAX)
FMT="Returns (eax) %F"
■ /REGISTERS or /REGS
Specifies one or more processor registers to be logged, each separated by a
comma. The following register mnemonics are supported:
AX,BX,CX,DX,CS,DS,ES,FS,GS,IP,SI,DI,SP,BP,FLAGS,
EAX,EBX,ECX,EDX,EIP,ESI,EDI,ESP,EBP,EFLAGS
■ /RETEP
Specifies that for each public entry-point in the MAP file, a return tracepoint
should be generated using the RETEP parameter on the TRACE statement in the TSF.
Note: RETEP is only processed by TRCUST if the module has debugging information
present. If this is not the case then TRCUST (2.20) will ignore the RETEP
parameter and a warning message will be issued for the associated tracepoint.
■ /TYPES
pre-defined types:
System Trace (SysTrace) facility 17
July 9, 1998 - Warp Debug
PUB = Public routines - names the begin upper case (ignoring leading underscores)
PRIV = Private routines - names the begin lower case (ignoring leading underscores)
PRE = Entry tracepoint.
POST = Exit tracepoint.
■ /GROUPT
Requests that each of the strings listed be used to define a group. Tracepoints
are assigned to a group according to whether a group name matches the beginning
of the tracepoint name, ignoring case and leading underscore characters
■ /TEMPLATE
Specifies a file where up to four template tracepoint definitions may be
specified, one for each of the following categories:
16-bit entry points
16-bit return points
32-bit entry points
32-bit return points
The definitions are in a shortened form of the TRCUST TRACE statement syntax.
They are appended to each tracepoint of the category to which they apply. All
parameters other than MINOR and DESC are permissible. TP and RETEP are
specified as follows:
TP=@16 signifies a 16-bit entry-point
TP=@16,RETEP signifies a 16-bit return-point
TP=@32 signifies a 32-bit entry-point
TP=@32,RETEP signifies a 32-bit return-point
Only TP and RETEP may appear on the same line as the TRACE keyword.
For example:
TRACE TP=@16
MEM=(SS:BP+8,I,0x10)
FMT="16-bytes of parameter 1: 1W"
will append:
MEM=(SS:BP+8,I,0x10)
FMT="16-bytes of parameter 1: 1W"
to every 16-bit entry tracepoint definition.
1.2.8 SYSSPLIT
If the system trace definitions for a particular module needs to be
replaced or modified then SYSSPLIT may be used to split SYSTEM.TDF
into its constituent TDF files. The resultant *.TDF files may be saved
System Trace (SysTrace) facility 18
July 9, 1998 - Warp Debug
in OS2\SYSTEM\TRACE. Because of the search order employed by TRACE.EXE
it is recommended that SYSTEM.TDF be renamed after being split.
When applying tracepionts to a DLL, TRACE.EXE will search the current path,
then the DPATH for the dll_name.TDF file. If not found it searches
OS2\SYSTEM\TRACE\SYSTEM.TDF and finally, OS2\SYSTEM\TRACE\dll_name.TDF.
The file names of the split *.TDFs will be chosen to be the original
names used to create SYSTEM.TDF.
The syntax of the command is:
SYSSPLIT <input_file>
<input_file> is the system trace definition files - SYSTEM.TDF
Note: The Trace definitions for the OS2KRNL may be in OS2KRNL.TDF or
DOSCALLS.TDF. The TRACE command recognizes the keyword KERNEL as an
alias for each of the kernel TDF names. TRACE.EXE searches the DPATH
for DOSCALLS.TDF. Currently, TRACE ON KERNEL will only work
for OS2KRNL.TDF if a directory from the boot drive is current.
The TDFLST utility may be used with each of the resultant TDFs to
format the trace point definitions.
1.2.8.1 Trace formatting files - SYSTEM.TFF
When formatting the system trace buffer, TRACEFMT.EXE will search
OS2\SYSTEM\TRACE\SYSTEM.TFF for the formatting templates for each
major code encountered in the trace buffer. If a major code is not
found in SYSTEM.TFF then TRACEFMT will search for a file named
TRC00xx.TFF, where xx is the major code number in hexadecimal.
If the formatting templates for a particular module needs to be
replaced or modified then SYSSPLIT may be used to split SYSTEM.TFF
into its constituent TFF files. The resultant *.TFF files may be saved
in OS2\SYSTEM\TRACE. Because of the search order employed by
TRACEFMT.EXE it is recommended that SYSTEM.TFF be renamed after being
split.
The file names of the split *.TFFs will be chosen to be the original
names used to create SYSTEM.TDF, that is names formed from their major
codes.
The TFFLST utility may be used with each of the resultant TFFs to
format the trace point definitions.
Note: TRCUST has the ability to combine TFFs for the same major code.
This is not to be confused with the special SYSTEM.TFF and SYSTEM.TDF
files that are concatenations of dissimilar major code definitions.
System Trace (SysTrace) facility 19
July 9, 1998 - Warp Debug
1.2.9 TDFLST
TDF list formats a TDF as DTRACE compatible trace program file. The
output is directed to STDOUT, which may be captured in a file using
the redirection operator (>).
Trace definitions may be modified or supplemented using an editor and
the TDF rebuilt using DTRACE BUILDTDF.
The syntax is:
TDFLST <tdf_file>
1.2.10 TFFLST
TFF list formats a TFF as TRCUST compatible source. The
output is directed to STDOUT, which may be captured in a file using
the redirection operator (>).
Trace formatting templates may be modified or supplemented using
an editor and the TFF rebuilt using TRCUST.
NOTES:
TRCUST is used for generating TDFs and TFFs. The keyword,
TP=@STATIC directs TRCUST solely to generate TFFs. Normally this is
used with static trace but equally valid for dynamic trace where the
tracepoints have already been defined.
Large TDF and TFF files may take a few minutes to list. A
degree of searching and cross-referencing has to take place before the
listing is produced. Consequently there may be a considerable pause
before the listing is produced.
The syntax is:
TFFLST <tdf_file>
System Trace (SysTrace) facility 20
July 9, 1998 - Warp Debug
1.3 APPENDIX A NEW TRACEPOINTS CROSS-REFERENCE.
Those tracepoints flagged with an "*" are full tracepoints and record parameters
as well as return address. Those not flagged only record the caller's return
address and have to be used with their corresponding system tracepoint to record
parameter information.
System Trace (SysTrace) facility 21
July 9, 1998 - Warp Debug
New "TRACE ON KERNEL" Tracepoints
Tracepoint Minor Group Types F Remarks
DOS32CANCELLOCKREQUEST 494 FS PRE,API *
DOS32CANCELLOCKREQUEST 495 FS POST,API *
DOS32SETFILELOCKS 496 FS PRE,API *
DOS32SETFILELOCKS 497 FS POST,API *
DOS32PROTECTSETFILELOCKS 498 FS PRE,API *
DOS32PROTECTSETFILELOCKS 499 FS POST,API *
DOSCREATESPINLOCK 500 LOCK PRE,API * SMP only
DOSCREATESPINLOCK 501 LOCK POST,API * SMP only
DOSACQUIRESPINLOCK 502 LOCK PRE,API * SMP only
DOSACQUIRESPINLOCK 503 LOCK POST,API * SMP only
DOSRELEASESPINLOCK 504 LOCK PRE,API * SMP only
DOSRELEASESPINLOCK 505 LOCK POST,API * SMP only
DOSFREESPINLOCK 506 LOCK PRE,API * SMP only
DOSFREESPINLOCK 507 LOCK POST,API * SMP only
DOS32IPROTECTREAD 508 FS PRE,API *
DOS32IPROTECTREAD 509 FS POST,API *
DOS32IPROTECTWRITE 510 FS PRE,API *
DOS32IPROTECTRWITE 511 FS POST,API *
New "TRACE ON DOSCALL1" Tracepoints
Tracepoint Minor Group Types F Remarks
DOS32WAITCHILD 262 TK PRE,API 32-bit EP to KERNEL API
DOS32BEEP 263 IO PRE,API 32-bit EP to KERNEL API
DOS32PHYSICALDISK 264 FS PRE,API 32-bit EP to KERNEL API
DOS32SETCP 265 TK PRE,API 32-bit EP to KERNEL API
DOS32SETPROCESSCP 266 TK PRE,API 32-bit EP to KERNEL API
DOS32SLEEP 267 TK PRE,API 32-bit EP to KERNEL API
DOS32DEVCONFIG 268 FS PRE,API 32-bit EP to KERNEL API
DOS32GETDATETIME 269 FS PRE,API 32-bit EP to KERNEL API
DOS32SETDATETIME 270 TIM PRE,API 32-bit EP to KERNEL API
DOS32EXECPGM 271 TIM PRE,API 32-bit EP to KERNEL API
DOS32ENTERCRITSEC 272 TK PRE,API 32-bit EP to KERNEL API
DOS32EXITCRITSEC 273 TK PRE,API 32-bit EP to KERNEL API
DOS32EXIT 274 TK PRE,API 32-bit EP to KERNEL API
DOS32KILLPROCESS 275 TK PRE,API 32-bit EP to KERNEL API
DOS32SETPRIORITY 276 TK PRE,API 32-bit EP to KERNEL API
DOS32RESUMETHREAD 277 TK PRE,API 32-bit EP to KERNEL API
DOS32SUSPENDTHREAD 278 TK PRE,API 32-bit EP to KERNEL API
DOS32CREATEPIPE 279 PIP PRE,API 32-bit EP to KERNEL API
DOS32CREATEQUEUE 280 QUE PRE,API 32-bit EP to QUECALLS API
DOS32OPENQUEUE 281 QUE PRE,API 32-bit EP to QUECALLS API
DOS32CLOSEQUEUE 282 QUE PRE,API 32-bit EP to QUECALLS API
DOS32PEEKQUEUE 283 QUE PRE,API 32-bit EP to QUECALLS API
DOS32PURGEQUEUE 284 QUE PRE,API 32-bit EP to QUECALLS API
DOS32QUERYQUEUE 285 QUE PRE,API 32-bit EP to QUECALLS API
DOS32WRITEQUEUE 286 QUE PRE,API 32-bit EP to QUECALLS API
DOS32CALLNPIPE 287 PIP PRE,API 32-bit EP to KERNEL API
DOS32CONNECTNPIPE 288 PIP PRE,API 32-bit EP to KERNEL API
DOS32DISCONNECTNPIPE 289 PIP PRE,API 32-bit EP to KERNEL API
DOS32CREATENPIPE 290 PIP PRE,API 32-bit EP to KERNEL API
DOS32PEEKNPIPE 291 PIP PRE,API 32-bit EP to KERNEL API
DOS32QUERYNPHSTATE 292 PIP PRE,API 32-bit EP to KERNEL API
System Trace (SysTrace) facility 22
July 9, 1998 - Warp Debug
DOS32RAWREADNPIPE 293 PIP PRE,API 32-bit EP to KERNEL API
DOS32RAWWRITENPIPE 294 PIP PRE,API 32-bit EP to KERNEL API
DOS32QUERYNPIPEINFO 295 PIP PRE,API 32-bit EP to KERNEL API
DOS32QUERYNPIPESEMSTATE 296 PIP PRE,API 32-bit EP to KERNEL API
DOS32SETNPHSTATE 297 PIP PRE,API 32-bit EP to KERNEL API
DOS32SETNPIPESEM 298 PIP PRE,API 32-bit EP to KERNEL API
DOS32TRANSACTNPIPE 299 PIP PRE,API 32-bit EP to KERNEL API
DOS32WAITNPIPE 300 PIP PRE,API 32-bit EP to KERNEL API
DOS32RESETBUFFER 301 FS PRE,API 32-bit EP to KERNEL API
DOS32SETCURRENTDIR 302 FS PRE,API 32-bit EP to KERNEL API
DOS32SETFILEPTR 303 FS PRE,API 32-bit EP to KERNEL API
DOS32PROTECTSETFILEPTR 304 FS PRE,API 32-bit EP to KERNEL API
DOS32CLOSE 305 FS PRE,API 32-bit EP to KERNEL API
DOS32PROTECTCLOSE 306 FS PRE,API 32-bit EP to KERNEL API
DOS32COPY 307 FS PRE,API 32-bit EP to KERNEL API
DOS32DELETE 308 FS PRE,API 32-bit EP to KERNEL API
DOS32FORCEDELETE 309 FS PRE,API 32-bit EP to KERNEL API
DOS32DEVIOCTL 310 FS PRE,API 32-bit EP to KERNEL API
DOS32DUPHANDLE 311 FS PRE,API 32-bit EP to KERNEL API
DOS32EDITNAME 312 FS PRE,API 32-bit EP to KERNEL API
DOS32FINDCLOSE 313 FS PRE,API 32-bit EP to KERNEL API
DOS32FSATTACH 314 FS PRE,API 32-bit EP to KERNEL API
DOS32FSCTL 315 FS PRE,API 32-bit EP to KERNEL API
DOS32MOVE 316 FS PRE,API 32-bit EP to KERNEL API
DOS32SETFILESIZE 317 FS PRE,API 32-bit EP to KERNEL API
DOS32PROTECTSETFILESIZE 318 FS PRE,API 32-bit EP to KERNEL API
DOS32QUERYCURRENTDIR 319 FS PRE,API 32-bit EP to KERNEL API
DOS32QUERYCURRENTDISK 320 FS PRE,API 32-bit EP to KERNEL API
DOS32QUERYFHSTATE 321 FS PRE,API 32-bit EP to KERNEL API
DOS32PROTECTQUERYFHSTATE 322 FS PRE,API 32-bit EP to KERNEL API
DOS32PQUERYFSATTACH 323 FS PRE,API 32-bit EP to KERNEL API
DOS32QUERYFSINFO 324 FS PRE,API 32-bit EP to KERNEL API
DOS32QUERYHTYPE 325 FS PRE,API 32-bit EP to KERNEL API
DOS32QUERYVERIFY 326 FS PRE,API 32-bit EP to KERNEL API
DOS32DELETEDIR 327 FS PRE,API 32-bit EP to KERNEL API
DOS32SEARCHPATH 328 FS PRE,API 32-bit EP to KERNEL API
DOS32SETDEFAULTDISK 329 FS PRE,API 32-bit EP to KERNEL API
DOS32SETFHSTATE 330 FS PRE,API 32-bit EP to KERNEL API
DOS32PROTECTSETFHSTATE 331 FS PRE,API 32-bit EP to KERNEL API
DOS32SETFSINFO 332 FS PRE,API 32-bit EP to KERNEL API
DOS32SETMAXFH 333 FS PRE,API 32-bit EP to KERNEL API
DOS32SETRELMAXFH 334 FS PRE,API 32-bit EP to KERNEL API
DOS32SETVERIFY 335 FS PRE,API 32-bit EP to KERNEL API
DOS32ERRCLASS 336 FS PRE,API 32-bit EP to KERNEL API
DOS32ERROR 337 TK PRE,API 32-bit EP to KERNEL API
DOS32LOADMODULE 338 LDR PRE,API 32-bit EP to KERNEL API
DOS32FREEMODULE 339 LDR PRE,API 32-bit EP to KERNEL API
DOS32QUERYMODULEHANDLE 340 LDR PRE,API 32-bit EP to KERNEL API
DOS32QUERYMODULENAME 341 LDR PRE,API 32-bit EP to KERNEL API
DOS32QUERYAPPTYPE 342 LDR PRE,API 32-bit EP to KERNEL API
DOS32PFINDNEXT 343 FS PRE,API 32-bit EP to KERNEL API
DOS32SHUTDOWN 344 FS PRE,API 32-bit EP to KERNEL API
DOS32OPENCHANGENOTIFY 345 FS PRE,API 32-bit EP to KERNEL API
DOS32RESETCHANGENOTIFY 346 FS PRE,API 32-bit EP to KERNEL API
DOS32CLOSECHANGENOTIFY 347 FS PRE,API 32-bit EP to KERNEL API
DOS32CREATESPINLOCK 348 LOCK PRE,API SMP only, 32-bit EP to KERNEL API
DOS32ACQUIRESPINLOCK 349 LOCK PRE,API SMP only, 32-bit EP to KERNEL API
System Trace (SysTrace) facility 23
July 9, 1998 - Warp Debug
DOS32RELEASESPINLOCK 350 LOCK PRE,API SMP only, 32-bit EP to KERNEL API
DOS32FREESPINLOCK 351 LOCK PRE,API SMP only, 32-bit EP to KERNEL API
DOS32READQUEUE 352 QUE PRE,API 32-bit EP to QUECALLS API
DOS16CREATEQUEUE 353 QUE PRE,API 16-bit EP to QUECALLS API
DOS16OPENQUEUE 354 QUE PRE,API 16-bit EP to QUECALLS API
DOS16CLOSEQUEUE 355 QUE PRE,API 16-bit EP to QUECALLS API
DOS16PEEKQUEUE 356 QUE PRE,API 16-bit EP to QUECALLS API
DOS16PURGEQUEUE 357 QUE PRE,API 16-bit EP to QUECALLS API
DOS16QUERYQUEUE 358 QUE PRE,API 16-bit EP to QUECALLS API
DOS16WRITEQUEUE 359 QUE PRE,API 16-bit EP to QUECALLS API
DOS16READQUEUE 360 QUE PRE,API 16-bit EP to QUECALLS API
DOS32R3EXCEPTIONDISPATCHER 361 EXMG PRE,API * From FP37, Internal DOSCALL1 tracepoint
DOS32EXCEPTIONCALLBACK 362 EXMG PRE,API * From FP37, Internal DOSCALL1 tracepoint
XCPTEXECUTEUSEREXCEPTIONHANDLER 363 EXMG PRE,API * From FP37, Internal DOSCALL1 tracepoint
UT16RETURN 33028 UT POST,INT Internal DOSCALL1 tracepoint
UT32RETURN 33029 UT POST,INT Internal DOSCALL1 tracepoint
New "TRACE ON SESMGR" Tracepoints
Tracepoint Minor Group Types F Remarks
DOS32SELECTSESSION 32 PRE,API 32-bit EP to SESMGR API
DOS32SETSESSION 33 PRE,API 32-bit EP to SESMGR API
DOS32STARTSESSION 34 PRE,API 32-bit EP to SESMGR API
DOS32STOPSESSION 35 PRE,API 32-bit EP to SESMGR API