1trace.h(0P) POSIX Programmer's Manual trace.h(0P)
2
3
4
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
13 trace.h — tracing
14
16 #include <trace.h>
17
19 The <trace.h> header shall define the posix_trace_event_info structure,
20 which shall include at least the following members:
21
22 trace_event_id_t posix_event_id
23 pid_t posix_pid
24 void *posix_prog_address
25 pthread_t posix_thread_id
26 struct timespec posix_timestamp
27 int posix_truncation_status
28
29 The <trace.h> header shall define the posix_trace_status_info struc‐
30 ture, which shall include at least the following members:
31
32 int posix_stream_full_status
33 int posix_stream_overrun_status
34 int posix_stream_status
35 int posix_log_full_status
36 int posix_log_overrun_status
37 int posix_stream_flush_error
38 int posix_stream_flush_status
39
40 The <trace.h> header shall define the following symbolic constants:
41
42 POSIX_TRACE_ALL_EVENTS
43 POSIX_TRACE_APPEND
44 POSIX_TRACE_CLOSE_FOR_CHILD
45 POSIX_TRACE_FILTER
46 POSIX_TRACE_FLUSH
47 POSIX_TRACE_FLUSH_START
48 POSIX_TRACE_FLUSH_STOP
49 POSIX_TRACE_FLUSHING
50 POSIX_TRACE_FULL
51 POSIX_TRACE_LOOP
52 POSIX_TRACE_NO_OVERRUN
53 POSIX_TRACE_NOT_FLUSHING
54 POSIX_TRACE_NOT_FULL
55 POSIX_TRACE_INHERITED
56 POSIX_TRACE_NOT_TRUNCATED
57 POSIX_TRACE_OVERFLOW
58 POSIX_TRACE_OVERRUN
59 POSIX_TRACE_RESUME
60 POSIX_TRACE_RUNNING
61 POSIX_TRACE_START
62 POSIX_TRACE_STOP
63 POSIX_TRACE_SUSPENDED
64 POSIX_TRACE_SYSTEM_EVENTS
65 POSIX_TRACE_TRUNCATED_READ
66 POSIX_TRACE_TRUNCATED_RECORD
67 POSIX_TRACE_UNNAMED_USER_EVENT
68 POSIX_TRACE_UNTIL_FULL
69 POSIX_TRACE_WOPID_EVENTS
70
71 The <trace.h> header shall define the size_t, trace_attr_t,
72 trace_event_id_t, trace_event_set_t, and trace_id_t types as described
73 in <sys/types.h>.
74
75 The following shall be declared as functions and may also be defined as
76 macros. Function prototypes shall be provided.
77
78 int posix_trace_attr_destroy(trace_attr_t *);
79 int posix_trace_attr_getclockres(const trace_attr_t *,
80 struct timespec *);
81 int posix_trace_attr_getcreatetime(const trace_attr_t *,
82 struct timespec *);
83 int posix_trace_attr_getgenversion(const trace_attr_t *, char *);
84 int posix_trace_attr_getinherited(const trace_attr_t *restrict,
85 int *restrict);
86 int posix_trace_attr_getlogfullpolicy(const trace_attr_t *restrict,
87 int *restrict);
88 int posix_trace_attr_getlogsize(const trace_attr_t *restrict,
89 size_t *restrict);
90 int posix_trace_attr_getmaxdatasize(const trace_attr_t *restrict,
91 size_t *restrict);
92 int posix_trace_attr_getmaxsystemeventsize(const trace_attr_t *restrict,
93 size_t *restrict);
94 int posix_trace_attr_getmaxusereventsize(const trace_attr_t *restrict,
95 size_t, size_t *restrict);
96 int posix_trace_attr_getname(const trace_attr_t *, char *);
97 int posix_trace_attr_getstreamfullpolicy(const trace_attr_t *restrict,
98 int *restrict);
99 int posix_trace_attr_getstreamsize(const trace_attr_t *restrict,
100 size_t *restrict);
101 int posix_trace_attr_init(trace_attr_t *);
102 int posix_trace_attr_setinherited(trace_attr_t *, int);
103 int posix_trace_attr_setlogfullpolicy(trace_attr_t *, int);
104 int posix_trace_attr_setlogsize(trace_attr_t *, size_t);
105 int posix_trace_attr_setmaxdatasize(trace_attr_t *, size_t);
106 int posix_trace_attr_setname(trace_attr_t *, const char *);
107 int posix_trace_attr_setstreamfullpolicy(trace_attr_t *, int);
108 int posix_trace_attr_setstreamsize(trace_attr_t *, size_t);
109 int posix_trace_clear(trace_id_t);
110 int posix_trace_close(trace_id_t);
111 int posix_trace_create(pid_t, const trace_attr_t *restrict,
112 trace_id_t *restrict);
113 int posix_trace_create_withlog(pid_t, const trace_attr_t *restrict,
114 int, trace_id_t *restrict);
115 void posix_trace_event(trace_event_id_t, const void *restrict, size_t);
116 int posix_trace_eventid_equal(trace_id_t, trace_event_id_t,
117 trace_event_id_t);
118 int posix_trace_eventid_get_name(trace_id_t, trace_event_id_t, char *);
119 int posix_trace_eventid_open(const char *restrict,
120 trace_event_id_t *restrict);
121 int posix_trace_eventset_add(trace_event_id_t, trace_event_set_t *);
122 int posix_trace_eventset_del(trace_event_id_t, trace_event_set_t *);
123 int posix_trace_eventset_empty(trace_event_set_t *);
124 int posix_trace_eventset_fill(trace_event_set_t *, int);
125 int posix_trace_eventset_ismember(trace_event_id_t,
126 const trace_event_set_t *restrict, int *restrict);
127 int posix_trace_eventtypelist_getnext_id(trace_id_t,
128 trace_event_id_t *restrict, int *restrict);
129 int posix_trace_eventtypelist_rewind(trace_id_t);
130 int posix_trace_flush(trace_id_t);
131 int posix_trace_get_attr(trace_id_t, trace_attr_t *);
132 int posix_trace_get_filter(trace_id_t, trace_event_set_t *);
133 int posix_trace_get_status(trace_id_t,
134 struct posix_trace_status_info *);
135 int posix_trace_getnext_event(trace_id_t,
136 struct posix_trace_event_info *restrict, void *restrict,
137 size_t, size_t *restrict, int *restrict);
138 int posix_trace_open(int, trace_id_t *);
139 int posix_trace_rewind(trace_id_t);
140 int posix_trace_set_filter(trace_id_t, const trace_event_set_t *, int);
141 int posix_trace_shutdown(trace_id_t);
142 int posix_trace_start(trace_id_t);
143 int posix_trace_stop(trace_id_t);
144 int posix_trace_timedgetnext_event(trace_id_t,
145 struct posix_trace_event_info *restrict, void *restrict,
146 size_t, size_t *restrict, int *restrict,
147 const struct timespec *restrict);
148 int posix_trace_trid_eventid_open(trace_id_t, const char *restrict,
149 trace_event_id_t *restrict);
150 int posix_trace_trygetnext_event(trace_id_t,
151 struct posix_trace_event_info *restrict, void *restrict, size_t,
152 size_t *restrict, int *restrict);
153
154 The following sections are informative.
155
157 None.
158
160 None.
161
163 The <trace.h> header may be removed in a future version.
164
166 <sys_types.h>
167
168 The System Interfaces volume of POSIX.1‐2008, Section 2.11, Tracing,
169 posix_trace_attr_destroy(), posix_trace_attr_getclockres(),
170 posix_trace_attr_getinherited(), posix_trace_attr_getlogsize(),
171 posix_trace_clear(), posix_trace_close(), posix_trace_create(),
172 posix_trace_event(), posix_trace_eventid_equal(),
173 posix_trace_eventset_add(), posix_trace_eventtypelist_getnext_id(),
174 posix_trace_get_attr(), posix_trace_get_filter(), posix_trace_get‐
175 next_event(), posix_trace_start()
176
178 Portions of this text are reprinted and reproduced in electronic form
179 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
180 -- Portable Operating System Interface (POSIX), The Open Group Base
181 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
182 cal and Electronics Engineers, Inc and The Open Group. (This is
183 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
184 event of any discrepancy between this version and the original IEEE and
185 The Open Group Standard, the original IEEE and The Open Group Standard
186 is the referee document. The original Standard can be obtained online
187 at http://www.unix.org/online.html .
188
189 Any typographical or formatting errors that appear in this page are
190 most likely to have been introduced during the conversion of the source
191 files to man page format. To report such errors, see https://www.ker‐
192 nel.org/doc/man-pages/reporting_bugs.html .
193
194
195
196IEEE/The Open Group 2013 trace.h(0P)