Trace

 

Trace Enable Server Side

  • Trace commands may be issued from the server console, storage agent console, or an administrative client connected to either. Whether issued from the console or administrative client, the trace commands apply to the server or storage agent to which the command was submitted. Trace commands may also be included in the server or storage agent option file to provide for tracing during startup and initialization of the applications or to provide a default set of trace classes.
  • Determine the trace classes to enable. See Trace Classes for server or storage agent for possible trace classes.
  • To have trace messages issued for a given trace class, that trace class needs to be enabled either prior to beginning the trace or after the tracing has begun. To enable one or more trace classes, issue:TRACE ENABLE <trace class name>Note that <trace class name> may be a space-delimited list of trace classes. For example, this could be entered as TRACE ENABLE TM SESSION.Additional trace classes can also be enabled by issuing TRACE ENABLE. For example, if you wanted to add the ADDMSG trace class in addition to those that were already enabled, issue: TRACE ENABLE ADDMSG
  • To stop having trace messages issued for a given trace class, that trace class needs to be disabled either prior to beginning the trace or after the tracing has begun. To disable one or more trace classes, issue:TRACE DISABLE <trace class name>Note that <trace class name> may be a space delimited list of trace classes. For example, this could be entered as TRACE DISABLE TM SESSION.Additional trace classes can also be disabled by issuing TRACE ENABLE. For example, if you wanted to add the ADDMSG trace class in addition to those that were already enabled, issue: TRACE ENABLE ADDMSG.By issuing TRACE DISABLE without specifying any trace classes, all currently enabled trace classes will be disabled.
  • Tracing can occur to the console or to a file. For tracing
    • To console, issue:TRACE BEGIN
    • To a file with no size limitation, issue:TRACE BEGIN <file name>
    • To a file with a size limitation, issue:TRACE BEGIN <file name> MAXSIZE=<maximum size in megabytes>
  • Perform the operation that is causing the problem.
  • To stop trace messages from being issued, issue: TRACE ENDIf the tracing was being done to a file, ending the trace will write any remaining trace messages to the file and then close the file.

As a general recommendation, it is best to trace to a file. Typically, the tracing for the server or storage agent will generate a large amount of output.

It is also possible to enable tracing and begin it using the server or storage agent options file. The commands and syntax discussed above may be added to the server or storage agent options file to trace during startup and initialization. For example, if the following lines were added to the server’s option file, tracing would be started for the DB, TM, and LOG trace classes and the trace messages written to the file MYTRACE.OUT.

TRACE ENABLE DB TM LOG TRACE BEGIN MYTRACE.OUT

If the tracing was no longer needed after startup, the tracing could be ended by issuing TRACE END from the console or from an administrative client.

Trace enable device driver

Tracing is available for the TSM device driver. These instructions apply to the TSM device driver on all platforms where the device driver is supported. The TSM device driver can be traced from the server console, an administrative client, or from a shell running on the system where the device driver is installed.

For devices that use device drivers other than the TSM device driver, the ability to trace and instructions on how to trace those device drivers is provided by the vendor for that device.

Tracing from the server console/admin client
To trace the driver from the server, you must first issue the TRACE ENABLE and TRACE BEGIN commands (see Tracing for server or storage agent). The TSM device driver actually consists of three drivers, one each for the library-autochanger devices, tape devices, and optical drives, and you may choose which you want to trace. The syntax for the command is:DDTRACE START [ LIBRARYDD | TAPEDD | OPTICALDD] [flags=EE | , FULL | , SYSLOG | BASE ] DDTRACE GET [ LIBRARYDD | TAPEDD | OPTICALDD] DDTRACE END [ LIBRARYDD | TAPEDD | OPTICALDD]The options are:

START
Turns on tracing. This writes the trace to a memory buffer based on the default or specified FLAGS option.
GET
Writes the memory buffer to the same file that was specified with the server TRACE BEGIN command
END
Stops writing trace to the memory buffer. This does not wipe out the contents of the buffer, so it is allowable to run END before running GET.
LIBRARYDD
Traces the device driver that controls library-autochangers.
TAPEDD
Traces the device driver that controls tape drives.
OPTICALDD
Traces the device driver that controls optical drives.

For these options, it is permitted to specify only device driver, or the library device driver and one of the other two. These are space delimited. For example:

DDTRACE START TAPEDD – Starts tracing the device driver that controls tape drives. DDTRACE START LIBRARYDD – Starts tracing the library-autochanger. DDTRACE START LIBRARYDD TAPEDD – Traces both the library and the tape drives. DDTRACE START LIBRARYDD OPTICALDD – Traces both the library and the optical drives.

Whichever of these you use, you should specify the same ones for all commands in the start-get-end series.The FLAGS parameter is optional and usually not required. The values for the FLAGS parameter are:

EE
Traces all device driver routine entries and exits.
FULL
Turns on more debug tracing. It provides more detail but because the memory buffer size is fixed, fewer events are traced. It also does not trace routine entry and exit points.
SYSLOG
On some platforms, this directs that the trace statements are to be written to the system log in addition to the memory buffer. This is most useful in debugging kernel crashes or in circumstances where the trace wraps in the memory buffer.
BASE
This is the default and cannot be specified with any other flags. It is only used to turn off the EE, FULL, and SYSLOG flags without turning off trace.

 

Tracing from a command shell – All platforms
A stand-alone utility, ddtrace, is provided that exactly mimics the DDTRACE server commands for ease of remembering them. It is installed in the devices directory, which is the same as for the mttest, lbtest, and optest utilities. Its syntax and options are identical to the DDTRACE server command. For example:$ ddtrace start librarydd tapedd flags=EE – start tracing both the library and tape drivers, and get additional entry/exit trace $ ddtrace get librarydd tapedd – get the trace from memory and write it to the file ddtrace.out $ ddtrace end librarydd tapedd – stop tracing to memoryThe main use of the stand-alone utility is primarily for cases when the driver needs to be traced during the TSM Server initialization. It writes the memory buffer to the file “ddtrace.out” in the current directory. If the file exists, it appends to the file and does not overwrite it.

Comments are closed.