trcgenkt Kernel Service

Purpose

Records a trace event, including a time stamp, for a generic trace channel.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/trchkid.h>

void trcgenkt (chan, hk_word, data_word, len, buf)
unsigned int  chan,  hk_word,  data_word,  len;
char * buf;

Parameters

Item Description
chan Specifies the channel number for the trace session. This number is obtained from the trcstart subroutine.
hk_word An integer containing a hook ID and a hook type:
hk_id
Before AIX® 6.1 the hook identifier is a 12-bit value. On AIX 6.1 and above, the hook identifier is a 16-bit value. A 16-bit value of the form hhh0 is equivalent to a 12-bit value of the form hhh.
hk_type
A 4-bit hook type. The trcgenkt service automatically records this information. This value is only valid before AIX 6.1.
data_word Specifies a word of user-defined data.
len Specifies the length, in bytes, of the buffer identified by the buf parameter.
buf Points to a buffer of trace data. The maximum amount of trace data is 4096 bytes.

Description

The trcgenkt kernel service records a trace event if a trace session is active for the specified trace channel. If a trace session is not active, the trcgenkt service simply returns. The trcgenkt kernel service is located in pinned kernel memory.

The trcgenkt service records a trace entry consisting of an hk_word entry, a data_word entry, a variable number of bytes of trace data, and a time stamp.

Execution Environment

The trcgenkt kernel service can be called from either the process or interrupt environment.

Return Values

The trcgenkt service has no return values.