Tracing applications using component trace

The component trace service (also referred to in the remainder of this information as simply “component trace”) provides common tracing services for components, subsystems, or applications. Component trace allows you to capture information about application-specific events for debugging problems in your application, or for system analysis.

To use component trace, you create trace entries at various points in your application to capture the data you require. You decide the location of the trace points, what the trace entries will contain, and which trace entries, if any, to create at any given time. You store the trace entries in trace buffers. The entries are externalized in a dump or, by using the component trace external writer, in a trace data set on a direct access storage device (DASD) or tape.

Benefits of using component trace: While you might choose to write your own trace services to capture the events, the advantages of using component trace instead are that you will:
  • Have a consistent interface for all application traces.
  • Avoid writing duplicate code.
  • Eliminate the need to IPL or to use the SPZAP utility to turn traces on or off; the component trace service allows you to turn traces on or off dynamically.
  • Be able to merge your trace data with other application traces, IBM-supplied component traces, and GTF user traces.
  • Be able to merge different traces from the same system or from multiple systems in a sysplex.
  • Be able to use IPCS to:
    • Print or view the trace
    • Combine the trace data set with another trace data set
    • Extract specific entries from a trace data set
    • Merge formatted trace output with other formatted trace output
This information contains the following:
  • Planning an application trace tells what you need to do to establish a component trace for your application, including how to request it and how to obtain the trace records.
  • Coding macros for application traces contains information about coding component trace macros that enable your application to use component trace:
    • Use the CTRACE macro to do one or more of the following:
      • Define your application to component trace
      • Delete your application from component trace
      • Specify a parmlib member containing trace options
      • Define multiple traces for your application
      • Indicate that your application supports the component trace external writer.
      Note:
      1. For the full range of services provided by the CTRACE macro, see z/OS MVS Programming: Authorized Assembler Services Reference ALE-DYN.
      2. All references to the external writer in this information refer to the component trace external writer.
    • Use the ITTCTE mapping macro when creating trace entries.
    • When you are using the external writer:
      • Use the CTRACECS macro to manage trace buffers.
      • Use the CTRACEWR macro to write your trace buffers to DASD or tape.
  • Coding a start/stop exit routine tells how to write a component trace start/stop exit routine. You must have a start/stop routine to use component trace. The start/stop routine starts, stops, or modifies tracing for the application by controlling the creation of trace entries by the application.
  • Coding a display trace exit routine describes how to write a component trace display exit routine. The display routine provides status information about the component trace for the display trace operator command. This routine is optional.
  • Creating trace entries describes how to create trace entries.