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