Macros for Recording trace Events

The following macros should always be used to generate trace data. Do not call the tracing functions directly.

There is a macro to record each possible type of event record. The macros are defined in the sys/trcmacros.h header file. Most event IDs are defined in the sys/trchkid.h header file. Include these two header files in any program that is recording trace events.

The macros to record system (channel 0) events with a time stamp are:
  • TRCHKL0T (hw)
  • TRCHKL1T (hw,D1)
  • TRCHKL2T (hw,D1,D2)
  • TRCHKL3T (hw,D1,D2,D3)
  • TRCHKL4T (hw,D1,D2,D3,D4)
  • TRCHKL5T (hw,D1,D2,D3,D4,D5)
Similarly, to record non-time stamped system events (channel 0) on versions of AIX® prior to AIX® 5L™ Version 5.3 with the 5300-05 Technology Level, use the following macros:
  • TRCHKL0 (hw)
  • TRCHKL1 (hw,D1)
  • TRCHKL2 (hw,D1,D2)
  • TRCHKL3 (hw,D1,D2,D3)
  • TRCHKL4 (hw,D1,D2,D3,D4)
  • TRCHKL5 (hw,D1,D2,D3,D4,D5)

In AIX 5L™ Version 5.3 with the 5300-05 Technology Level and above, a time stamp is recorded with each event regardless of the type of macro used.

There are only two macros to record events to one of the generic channels (channels 1-7). They are:
  • TRCGEN (ch,hw,d1,len,buf)
  • TRCGENT (ch,hw,d1,len,buf)

These macros record a hookword (hw), a data word (d1), and a length of data (len) specified in bytes from the user's data segment at the location specified (buf) to the event stream specified by the channel (ch). In AIX 5L™ Version 5.3 with the 5300-05 Technology Level and above, the time stamp is recorded with both macros.