Records a trace event.
Runtime Services Library (librts.a)
#include <sys/trchkid.h>
void trchook( HkWord, d1, d2, d3, d4, d5)
unsigned int HkWord, d1, d2, d3, d4, d5;
void utrchook(HkWord, d1, d2, d3, d4, d5)
unsigned int HkWord, d1, d2, d3, d4, d5;
void trchook64 (HkWord, d1, d2, d3, d4, d5)
unsigned long HkWord, d1, d2, d3, d4, d5;
void utrchook64 (HkWord, d1, d2, d3, d4, d5)
unsigned long HkWord, d1, d2, d3, d4, d5;
The trchook subroutine records a trace event if a trace session is active. Input parameters include a hook word (HkWord) and from 0 to 5 words of data. The trchook and trchook64 subroutines are intended for use by the kernel and extensions.
The utrchook and utrchook64 subroutines are intended for programs running at user (application) level.
The trchook and utrchook subroutines are for use in a 32-bit environment, while the trchook64 and utrchook64 subroutines are intended for use in a 64-bit environment. Note that if running a 64-bit application on a 32-bit kernel, the application should use utrchook64(the subroutine for its 64-bit environment).
It is strongly recommended that the C macros TRCHKLn and TRCHKLnT (where n is from 0 to 5) be used if possible, instead of calling these subroutines directly.
Beginning with AIX 5L™ Version 5.3 with the 5300-05 Technology Level, all events are implicitly appended with a time stamp.
Item | Description |
---|---|
d1, d2, d3, d4, d5 | Up to 5 words of data from the calling program. |
HkWord | The HkWord parameter has a different format based upon
the environment. For the trchook and utrchook subroutines,
it is an unsigned long consisting of a hook ID (HkID), a hook
type (Hk_Type), and two bytes of data from the calling program
(HkData).
|
In a 64-bit environment, when the trchook64 or utrchook64 subroutine is used, the format is ffffllllhhhhssss, where f represents flags, l is length, h is the hook ID, and s is the subhook.
Beginning with AIX® 6.1, 16-bit hook IDs are available in the 64-bit environment. 16-bit hook IDs in the form of 0xhhh0 are equivalent to 12-bit hook IDs in the form of 0xhhh where h is a hexadecimal digit. When a hook ID is less than 0x1000, its least significant digit must be 0.
The hook and subhook ids are the same as for the 32-bit environment (12-bit hook id and a 16-bit subhook id). Note that the 4 bits between the hook id and subhook are unused.
The length (l) is the second 16 bits of the hookword. It is the length of the data. The length is 0 if no data other than the hookword is traced (TRCHKL0), 8 if one parameter, 8 bytes, is traced (TRCHKL1), 16 for 2 parameters, 24 for 3 parameters, 32 for 4 parameters, and 40 for 5 parameters (TRCHKL5).