1POSIX_TRACE_CLOSE(3P)      POSIX Programmer's Manual     POSIX_TRACE_CLOSE(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       posix_trace_close, posix_trace_open,  posix_trace_rewind  —  trace  log
14       management (TRACING)
15

SYNOPSIS

17       #include <trace.h>
18
19       int posix_trace_close(trace_id_t trid);
20       int posix_trace_open(int file_desc, trace_id_t *trid);
21       int posix_trace_rewind(trace_id_t trid);
22

DESCRIPTION

24       The posix_trace_close() function shall deallocate the trace log identi‐
25       fier indicated by trid, and all of its associated resources.  If  there
26       is no valid trace log pointed to by the trid, this function shall fail.
27
28       The  posix_trace_open() function shall allocate the necessary resources
29       and establish the connection between a  trace  log  identified  by  the
30       file_desc  argument  and  a  trace  stream identifier identified by the
31       object pointed to by the trid argument. The file_desc  argument  should
32       be  a  valid  open file descriptor that corresponds to a trace log. The
33       file_desc argument shall be open for reading. The current  trace  event
34       timestamp,  which  specifies the timestamp of the trace event that will
35       be read by the next call to posix_trace_getnext_event(), shall  be  set
36       to  the  timestamp  of the oldest trace event recorded in the trace log
37       identified by trid.
38
39       The posix_trace_open() function shall return a trace stream  identifier
40       in  the variable pointed to by the trid argument, that may only be used
41       by the following functions:
42
43       posix_trace_close()                      posix_trace_get_attr()
44       posix_trace_eventid_equal()              posix_trace_get_status()
45       posix_trace_eventid_get_name()           posix_trace_getnext_event()
46       posix_trace_eventtypelist_getnext_id()   posix_trace_rewind()
47       posix_trace_eventtypelist_rewind()
48
49       In particular, notice that the operations normally used by a trace con‐
50       troller  process,  such  as posix_trace_start(), posix_trace_stop(), or
51       posix_trace_shutdown(), cannot be invoked using the trace stream  iden‐
52       tifier returned by the posix_trace_open() function.
53
54       The  posix_trace_rewind()  function shall reset the current trace event
55       timestamp, which specifies the timestamp of the trace event  that  will
56       be  read  by the next call to posix_trace_getnext_event(), to the time‐
57       stamp of the oldest trace event recorded in the trace log identified by
58       trid.
59

RETURN VALUE

61       Upon  successful  completion,  these  functions shall return a value of
62       zero. Otherwise, they shall return the corresponding error number.
63
64       If successful, the posix_trace_open() function stores the trace  stream
65       identifier value in the object pointed to by trid.
66

ERRORS

68       The posix_trace_open() function shall fail if:
69
70       EINTR  The  operation was interrupted by a signal and thus no trace log
71              was opened.
72
73       EINVAL The object pointed to by file_desc  does  not  correspond  to  a
74              valid trace log.
75
76       The posix_trace_close() and posix_trace_rewind() functions may fail if:
77
78       EINVAL The  object  pointed  to  by trid does not correspond to a valid
79              trace log.
80
81       The following sections are informative.
82

EXAMPLES

84       None.
85

APPLICATION USAGE

87       None.
88

RATIONALE

90       None.
91

FUTURE DIRECTIONS

93       The posix_trace_close(), posix_trace_open(),  and  posix_trace_rewind()
94       functions may be removed in a future version.
95

SEE ALSO

97       posix_trace_get_attr(), posix_trace_get_filter(), posix_trace_get‐
98       next_event()
99
100       The Base Definitions volume of POSIX.1‐2008, <trace.h>
101
103       Portions of this text are reprinted and reproduced in  electronic  form
104       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
105       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
106       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
107       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
108       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
109       event of any discrepancy between this version and the original IEEE and
110       The  Open Group Standard, the original IEEE and The Open Group Standard
111       is the referee document. The original Standard can be  obtained  online
112       at http://www.unix.org/online.html .
113
114       Any  typographical  or  formatting  errors that appear in this page are
115       most likely to have been introduced during the conversion of the source
116       files  to  man page format. To report such errors, see https://www.ker
117       nel.org/doc/man-pages/reporting_bugs.html .
118
119
120
121IEEE/The Open Group                  2013                POSIX_TRACE_CLOSE(3P)
Impressum