1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.TH "POSIX_TRACE_CLOSE" 3P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" posix_trace_close
.SH NAME
posix_trace_close, posix_trace_open, posix_trace_rewind \- trace log
management (\fBTRACING\fP)
.SH SYNOPSIS
.LP
\fB#include <trace.h>
.br
.sp
int posix_trace_close(trace_id_t\fP \fItrid\fP\fB);
.br
int posix_trace_open(int\fP \fIfile_desc\fP\fB, trace_id_t *\fP\fItrid\fP\fB);
.br
int posix_trace_rewind(trace_id_t\fP \fItrid\fP\fB); \fP
\fB
.br
\fP
.SH DESCRIPTION
.LP
The \fIposix_trace_close\fP() function shall deallocate the trace
log identifier indicated by \fItrid\fP, and all of its
associated resources. If there is no valid trace log pointed to by
the \fItrid\fP, this function shall fail.
.LP
The \fIposix_trace_open\fP() function shall allocate the necessary
resources and establish the connection between a trace log
identified by the \fIfile_desc\fP argument and a trace stream identifier
identified by the object pointed to by the \fItrid\fP
argument. The \fIfile_desc\fP argument should be a valid open file
descriptor that corresponds to a trace log. The
\fIfile_desc\fP argument shall be open for reading. The current trace
event timestamp, which specifies the timestamp of the trace
event that will be read by the next call to \fIposix_trace_getnext_event\fP(),
shall be set to the timestamp of the oldest
trace event recorded in the trace log identified by \fItrid\fP.
.LP
The \fIposix_trace_open\fP() function shall return a trace stream
identifier in the variable pointed to by the \fItrid\fP
argument, that may only be used by the following functions:
.TS C
center; lw(39) lw(39).
T{
.br
\fIposix_trace_close\fP()
.br
\fIposix_trace_eventid_equal\fP()
.br
\fIposix_trace_eventid_get_name\fP()
.br
\fIposix_trace_eventtypelist_getnext_id\fP()
.br
\fIposix_trace_eventtypelist_rewind\fP()
.br
\
T} T{
.br
\fIposix_trace_get_attr\fP()
.br
\fIposix_trace_get_status\fP()
.br
\fIposix_trace_getnext_event\fP()
.br
\fIposix_trace_rewind\fP()
.br
\
T}
.TE
.LP
In particular, notice that the operations normally used by a trace
controller process, such as \fIposix_trace_start\fP(), \fIposix_trace_stop\fP(),
or \fIposix_trace_shutdown\fP(), cannot be invoked using the trace
stream identifier
returned by the \fIposix_trace_open\fP() function.
.LP
The \fIposix_trace_rewind\fP() function shall reset the current trace
event timestamp, which specifies the timestamp of the
trace event that will be read by the next call to \fIposix_trace_getnext_event\fP(),
to the timestamp of the oldest trace event
recorded in the trace log identified by \fItrid\fP.
.SH RETURN VALUE
.LP
Upon successful completion, these functions shall return a value of
zero. Otherwise, they shall return the corresponding error
number.
.LP
If successful, the \fIposix_trace_open\fP() function stores the trace
stream identifier value in the object pointed to by
\fItrid\fP.
.SH ERRORS
.LP
The \fIposix_trace_open\fP() function shall fail if:
.TP 7
.B EINTR
The operation was interrupted by a signal and thus no trace log was
opened.
.TP 7
.B EINVAL
The object pointed to by \fIfile_desc\fP does not correspond to a
valid trace log.
.sp
.LP
The \fIposix_trace_close\fP() and \fIposix_trace_rewind\fP() functions
may fail if:
.TP 7
.B EINVAL
The object pointed to by \fItrid\fP does not correspond to a valid
trace log.
.sp
.LP
\fIThe following sections are informative.\fP
.SH EXAMPLES
.LP
None.
.SH APPLICATION USAGE
.LP
None.
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fIposix_trace_get_attr\fP() , \fIposix_trace_get_filter\fP() , \fIposix_trace_getnext_event\fP()
, the Base Definitions volume of
IEEE\ Std\ 1003.1-2001, \fI<trace.h>\fP
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .
|