Recommended options for the application trace

The CTRACE facility has flexibility such as filtering, combining multiple concurrent applications and traces, and using an external writer.

Guidelines: Consider the following guidelines when using CTRACE:
  • Although the CTRACE can be used to trace multiple applications at the same time and in conjunction with other trace options, it is not recommended. Multiple traces make problem determination more difficult.
  • For performance reasons, the data being recorded should be filtered, to minimize the overhead of recording the trace, to make formatting faster, to save storage, and to minimize wrapping (overwriting of older trace records by new trace records).

Ideally, you should use the CTRACE facility to capture all the SOCKAPI trace records for one application. The trace can be filtered various ways when formatting. If necessary, you can limit the trace data collected by IP address or port number, but you risk some records not being captured. For example, the problem might be that the wrong IP address or port number was coded or used. Both the IP address and port number are formatting options.

Guidelines: Consider the following guidelines to optimally capture the application data:
  • Trace only one application.

    Use the job name or ASID option when capturing the trace to limit the trace data to one application.

  • Trace only the SOCKAPI option.

    To get the maximum number of SOCKAPI trace records, specify only the SOCKAPI option.

    Tip: You also receive exception records. Exception records are always traced because they are considered unusual events.
  • Use an external writer.

    The external writer is recommended to:

    • Separate the SOCKAPI trace records from other internal data that exist in a dump (for security and other reasons)
    • Avoid interrupting processing with a dump of the trace data
    • Keep the buffer size from limiting the amount of trace data
    • Avoid increasing the buffer size, which requires restarting TCP/IP
    • Handle many trace records
  • Trace only one TCP/IP stack.

    If you are running with multiple TCP/IP stacks on a single z/OS® image, use the external writer for only one TCP/IP stack.

  • Activate the data trace only if more data is required.

    The SOCKAPI trace contains the first 96 bytes of data sent or received, which is sufficient. If additional data is needed, the data trace records can be correlated with the SOCKAPI records.