Initiates a flush on the trace stream.
Posix Trace Library (libposixtrace.a)
#include <sys/types.h>
#include <trace.h>
int posix_trace_flush (trid)
trace_id_t trid;
The posix_trace_flush subroutine initiates a flush operation that copies the contents of the trace stream identified by the trid parameter into the trace log associated with the trace stream at the creation time. If no trace log has been associated with the trace stream pointed to by the trid parameter, this subroutine returns an error. The termination of the flush operation can be polled by the posix_trace_get_status subroutine. After the flushing is completed, the space used by the flushed trace events is available for tracing new trace events. During the flushing operation, it is possible to trace new trace events until the trace stream becomes full.
For an active trace stream with the log, when the posix_trace_shutdown subroutine is called, all trace events that have not been flushed to the trace log are flushed, and the trace log is closed.
When a trace log is closed, all the information that can be retrieved later from the trace log through the trace interface are written to the trace log. This information includes the trace attributes, the list of trace event types (with the mapping between trace event names and trace event type identifiers), and the trace status.
The posix_trace_shutdown subroutine does not return until all trace events have been flushed.
Item | Description |
---|---|
trid | Specifies the trace stream identifier. |
On successful completion, these subroutines return a value of zero. Otherwise, they return the corresponding error number.
Item | Description |
---|---|
EINVAL | The value of the trid parameter does not correspond to an active trace stream with log. |
ENOSPC | No space left on device. |