When you have a problem you need to resolve, how you approach doing problem determination depends upon the actual problem. IBM i has a very rich set of diagnostic tools for problem determination purposes.
In this week’s blog, I’ll talk about what is called the “job trace facility.”
Those of you familiar with i probably know that the Trace Job command (TRCJOB) was part of the original release of OS/400. In the V5R1 release, IBM released a new job trace facility called Start Trace (STRTRC), along with the related commands called End Trace (ENDTRC), Print Trace (PRTTRC) and Delete Trace (DLTTRC). In the V5R4 release, IBM changed the TRCJOB command to actually invoke the various xxxTRC commands under the covers. The data-collection capabilities of the trace started with STRTRC are far superior in terms of performance and functionality than those of the original TRCJOB capabilities.
What you might not know is some of the finer points of this trace facility:
- The ability to start a trace on a job that has not yet started.
The use of a generic name in the JOB parameter (job name or job user) allows you to trace a group of jobs. Jobs that start after a trace is started that match the generic job name criteria will automatically be included in the trace. - The ability to trace jobs within a specified subsystem.
The subsystem element of the JOB parameter allows you to specify the name of the subsystem to be included (and this can also be a generic name). Specifying a subsystem name allows the job whose name matches the JOB name specification that runs in the specified subsystem to be traced. Jobs whose name matches the JOB name specification but do not run in the specified subsystem will not be included in the trace. - Integrated watch support to automatically end the trace upon some condition.
The “Watch” parameters allow you to specify watch criteria when you start a trace. If the watch criteria are met, the trace will be automatically ended. This is the same watch capability that I wrote about in the “Automate Monitoring with Watches” blog, but it is integrated with the Start Trace command. - Component trace support to specify additional data for components within the operating system. The Trace Type (TRCTYPE) parameters control whether *FLOW trace (the program/procedure call flow) and *DATA trace (operating system data) is collected as part of the trace. In addition, you can also specify *TRCTYPE (Trace Type); *TRCTYPE allows for additional component trace types to be optionally included as part of the trace. This is useful if you are working with the IBM Support Center to collect diagnostic data for operating system problems, as many operating system components have added trace instrumentation to collect debug data via STRTRC. A quick review of the values allowed on the *TRCTYPE parameter will show that many different components have provided job trace instrumentation.
But did you know you can also instrument your own application and have your application trace data collection also controlled with the *TRCTYPE parameter? Next week I’ll write more about this.
- Join Trace support to automatically have additional jobs dynamically be added to the trace.
The Join Trace (JOINTRC) parameter specifies whether jobs will set their trace characteristics in a related job or thread. This parameter is used when work may be passed off to a prestart job or a batch immediate job. - You can have a job trace automatically started when the system is IPLed.
With the “Restart after next IPL” (RESTRIPL) parameter, you can set up a trace that will be started when the system is IPLed. This is useful if you have jobs that run when the system is IPLed and you need to collect job trace information for them before you can actually sign on to the system.
For more information about IBM i diagnostic tools, refer to the IBM Redbooks publication “i5/OS Diagnostic Tools for System Administrators“. While a bit dated, it still contains useful information.
This blog post was reviewed and edited for currency on February 14, 2020.
This blog post was originally published on IBMSystemsMag.com and is reproduced here by permission of IBM Systems Media.