[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Performance Management Guide

Starting and Controlling Trace from a Program

The trace facility can be started from a program, through a subroutine call. The subroutine is trcstart() and is in the librts.a library. The syntax of the trcstart() subroutine is as follows:

int trcstart(char *args)

where args is the options list that you would have entered for the trace command. By default, the system trace (channel 0) is started. If you want to start a generic trace, include a -g option in the args string. On successful completion, the trcstart() subroutine returns the channel ID. For generic tracing, this channel ID can be used to record to the private generic channel.

When compiling a program using this subroutine, the link to the librts.a library must be specifically requested (use -l rts as a compile option).

Controlling Trace with Trace Subroutine Calls

The controls for the trace routine are available as subroutines from the librts.a library. The subroutines return zero on successful completion. The subroutines are:

int trcon()
Begins or resumes collection of trace data.
int trcoff()
Suspends collection of trace data.
int trcstop()
Stops collection of trace data and terminates the trace routine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]