Component Trace Facility

Component Trace (CT) is an important First Failure Data Capture (FFDC) and Second Failure Data Capture (SFDC) tool available to the kernel, kernel extensions, and device drivers. With the Component Trace facility, a component can capture trace events to aid both debugging and system analysis and can provide focused trace data on larger server systems.

Component Trace uses mechanisms similar to system trace. Existing TRCHK and TRCGEN macros can be replaced with CT macros to trace into system trace buffers and private buffers of memory-trace mode.

If recorded, Component Trace events can be retrieved with the ctctrl command. Extraction with the ctctrl command is relevant only to in-memory tracing. Component Trace events can also be present in a system trace. You can use the trcrpt command for Component Trace and system trace to process the events.

Component trace entries can be traced to the private buffer of the component, the lightweight memory trace, the system trace, or any combination of these destinations. The destination is governed by flags specified in the CT_HOOKx and CT_GEN macros. The MT_COMMON flag causes the entry to be traced into the common, lightweight-memory-trace buffer. The MT_RARE flag causes the entry to go to the rare, lightweight-memory-trace buffer. Do not specify both the MT_COMMON and MT_RARE flags. The MT_PRIV flag traces the entry into the private buffer of the component. The MT_SYSTEM flag puts the entry into a system trace if system trace is active.

Generic trace entries, which are traced with the CT_GEN macro, cannot be traced into the lightweight memory trace.

In the memory trace mode, you have the choice for each component, at initialization, to store their trace entries either in a component private buffer or in one of the memory buffers managed by the lightweight memory trace. When entries are stored in a lightweight-memory-trace buffer, the memory type (common or rare) is chosen for each trace entry.

The private buffer of the component is a pinned memory buffer that can be allocated by the framework at the component registration or later. The buffer is only attached to this component. You can dynamically change the buffer size with the CT API. Administrators can dynamically change the buffer size using the ctctrl command.

Private buffers and lightweight memory buffers are used in a circular mode, that is, if the buffer is full, the last trace entries overwrite the first one.

For each component, the serialization of the buffers can be managed either by the component (by the component owner) or by the Component Trace framework. This serialization policy is chosen at registration and cannot be changed during the life of the component.

The system trace mode is another function that is provided by Component Trace. When a component is traced using a system trace, each trace entry is sent to the current system trace. In this mode, Component Trace acts as a front-end filter for the existing system trace. By setting the level of the system trace, a component can control which trace hooks enter the system trace buffer.