trc_libcntl Subroutine

Purpose

Performs trace API control functions.

Library

libtrace.a

Syntax

#include <sys/libtrace.h>

int trc_libcntl (handle, cmd, datap)
trc_log_handle_t handle;
int cmd;
void *datap;

Description

The trc_libcntl subroutine provides miscellaneous control functions.

Parameters

Item Description
handle Contains the handle returned from a successful call to the trc_open subroutine.
cmd This is the control function to be performed. Supported functions are:
TRC_CNTL_ADJLINENO
This allows a trace report program to adjust the $LINENO value supplied through the trace templates. Normally, a trace reporting program may assume the $LINENO value is calculated based upon the first line of the output, in trchi_ascii, being the first line printed for that hook in the report. If this is not the case, such as with the 2line trcrpt option, the $LINENO value must be adjusted.

For TRC_CNTL_ADJLINENO, the datap parameter must contain a signed long value which is added to $LINENO. If the value is negative, TRC_CNTL_ADJLINENO will decrement the value.

TRC_CNTL_NAMELIST
This allows the namelist to be specified. The default is /unix. It does not initialize the symbols, however, and the trc_libcntl subroutine returns EINVAL if the symbols are already initialized. If symbols are in the trace stream, specified by trace -n, those symbols are used regardless of the namelist specification.
TRC_CNTL_TEXTOFFSET
This offsets each line of text, in the trchi_ascii data area, by the number of character positions specified, plus (trchi_indent-1) * 8; If the associated value is 0, each line is only offset by (trchi_indent-1) * 8;
TRC_CNTL_TEXTOFFSET_SUBSEQUENT
This works exactly like TRC_CNTL_TEXTOFFSET, except it offsets all lines except the first line of text. The first line is still offset by (trchi_indent-1) * 8;
TRC_CNTL_PAGESIZE
This specifies the length of a page.
TRC_CNTL_TEXTHEADER
This specifies a header to be output every page, as specified by the TRC_CNTL_PAGESIZE command.
datap Specifies the data parameter.

Return Values

Upon successful completion, the trc_libcntl subroutine returns 0.

Error Codes

Item Description
EINVAL The handle or cmd parameter is invalid. EINVAL is also returned if the value specified with TRC_CNTL_ADJLINENO would cause the $LINENO value to be negative.