1POSIX_TRACE_ATTR_GETINHERITEPDO(S3IPX)Programmer'sPMOaSnIuXa_lTRACE_ATTR_GETINHERITED(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

NAME

12       posix_trace_attr_getinherited, posix_trace_attr_getlogfullpolicy,
13       posix_trace_attr_getstreamfullpolicy, posix_trace_attr_setinherited,
14       posix_trace_attr_setlogfullpolicy, posix_trace_attr_setstreamfullpolicy
15       — retrieve and set the behavior of a trace stream (TRACING)
16

SYNOPSIS

18       #include <trace.h>
19
20       int posix_trace_attr_getinherited(const trace_attr_t *restrict attr,
21           int *restrict inheritancepolicy);
22       int posix_trace_attr_getlogfullpolicy(const trace_attr_t *restrict attr,
23           int *restrict logpolicy);
24       int posix_trace_attr_getstreamfullpolicy(const trace_attr_t *restrict
25           attr, int *restrict streampolicy);
26       int posix_trace_attr_setinherited(trace_attr_t *attr,
27           int inheritancepolicy);
28       int posix_trace_attr_setlogfullpolicy(trace_attr_t *attr,
29           int logpolicy);
30       int posix_trace_attr_setstreamfullpolicy(trace_attr_t *attr,
31           int streampolicy);
32

DESCRIPTION

34       The posix_trace_attr_getinherited() and posix_trace_attr_setinherited()
35       functions, respectively, shall  get  and  set  the  inheritance  policy
36       stored  in  the  inheritance  attribute for traced processes across the
37       fork()  and  spawn()  operations.  The  inheritance  attribute  of  the
38       attributes  object  pointed to by the attr argument shall be set to one
39       of the following values defined by manifest constants in the  <trace.h>
40       header:
41
42       POSIX_TRACE_CLOSE_FOR_CHILD
43             After  a  fork()  or  spawn()  operation,  the child shall not be
44             traced, and tracing of the parent shall continue.
45
46       POSIX_TRACE_INHERITED
47             After a fork() or spawn()  operation,  if  the  parent  is  being
48             traced,  its  child  shall  be concurrently traced using the same
49             trace stream.
50
51       The    default    value    for    the    inheritance    attribute    is
52       POSIX_TRACE_CLOSE_FOR_CHILD.
53
54       The  posix_trace_attr_getlogfullpolicy()  and  posix_trace_attr_setlog‐
55       fullpolicy() functions, respectively, shall get and set the  trace  log
56       full  policy  stored in the log-full-policy attribute of the attributes
57       object pointed to by the attr argument.
58
59       The log-full-policy attribute shall be set to one of the following val‐
60       ues defined by manifest constants in the <trace.h> header:
61
62       POSIX_TRACE_LOOP
63             The  trace  log  shall  loop until the associated trace stream is
64             stopped.  This policy means that when the trace  log  gets  full,
65             the file system shall reuse the resources allocated to the oldest
66             trace events that were recorded. In this way, the trace log  will
67             always contain the most recent trace events flushed.
68
69       POSIX_TRACE_UNTIL_FULL
70             The  trace  stream  shall  be  flushed to the trace log until the
71             trace log is  full.  This  condition  can  be  deduced  from  the
72             posix_log_full_status  member  status  (see  the posix_trace_sta‐
73             tus_info structure defined  in  <trace.h>).   The  last  recorded
74             trace event shall be the POSIX_TRACE_STOP trace event.
75
76       POSIX_TRACE_APPEND
77             The  associated  trace  stream  shall be flushed to the trace log
78             without  log  size  limitation.  If  the  application   specifies
79             POSIX_TRACE_APPEND,  the implementation shall ignore the log-max-
80             size attribute.
81
82       The   default   value   for   the    log-full-policy    attribute    is
83       POSIX_TRACE_LOOP.
84
85       The  posix_trace_attr_getstreamfullpolicy()  and  posix_trace_attr_set‐
86       streamfullpolicy() functions, respectively, shall get and set the trace
87       stream  full  policy  stored in the stream-full-policy attribute of the
88       attributes object pointed to by the attr argument.
89
90       The stream-full-policy attribute shall be set to one of  the  following
91       values defined by manifest constants in the <trace.h> header:
92
93       POSIX_TRACE_LOOP
94             The  trace  stream  shall  loop  until  explicitly stopped by the
95             posix_trace_stop() function. This  policy  means  that  when  the
96             trace  stream is full, the trace system shall reuse the resources
97             allocated to the oldest trace events recorded. In this  way,  the
98             trace  stream  will  always  contain the most recent trace events
99             recorded.
100
101       POSIX_TRACE_UNTIL_FULL
102             The trace stream will run until the trace  stream  resources  are
103             exhausted. Then the trace stream will stop. This condition can be
104             deduced  from  posix_stream_status  and  posix_stream_full_status
105             (see the posix_trace_status_info structure defined in <trace.h>).
106             When this trace stream is read, a  POSIX_TRACE_STOP  trace  event
107             shall  be reported after reporting the last recorded trace event.
108             The trace system shall reuse the resources allocated to any trace
109             events   already  reported—see  the  posix_trace_getnext_event(),
110             posix_trace_trygetnext_event(),     and     posix_trace_timedget‐
111             next_event()  functions—or  already  flushed  for an active trace
112             stream with log if the Trace Log option  is  supported;  see  the
113             posix_trace_flush()  function. The trace system shall restart the
114             trace stream when it is  empty  and  may  restart  it  sooner.  A
115             POSIX_TRACE_START  trace event shall be reported before reporting
116             the next recorded trace event.
117
118       POSIX_TRACE_FLUSH
119             If the Trace Log option is supported, this policy is identical to
120             the  POSIX_TRACE_UNTIL_FULL  trace stream full policy except that
121             the   trace   stream   shall   be   flushed   regularly   as   if
122             posix_trace_flush()  had  been  explicitly  called. Defining this
123             policy for an active trace stream without log shall be invalid.
124
125       The  default  value  for  the  stream-full-policy  attribute  shall  be
126       POSIX_TRACE_LOOP for an active trace stream without log.
127
128       If the Trace Log option is supported, the default value for the stream-
129       full-policy attribute shall be POSIX_TRACE_FLUSH for  an  active  trace
130       stream with log.
131

RETURN VALUE

133       Upon  successful  completion,  these  functions shall return a value of
134       zero. Otherwise, they shall return the corresponding error number.
135
136       If successful, the posix_trace_attr_getinherited() function shall store
137       the  inheritance attribute value in the object pointed to by inheritan‐
138       cepolicy.  Otherwise, the content of this object is undefined.
139
140       If successful, the posix_trace_attr_getlogfullpolicy()  function  shall
141       store  the  log-full-policy attribute value in the object pointed to by
142       logpolicy.  Otherwise, the content of this object is undefined.
143
144       If  successful,  the  posix_trace_attr_getstreamfullpolicy()   function
145       shall  store  the  stream-full-policy  attribute  value  in  the object
146       pointed to by streampolicy.  Otherwise, the content of this  object  is
147       undefined.
148

ERRORS

150       These functions may fail if:
151
152       EINVAL The value specified by at least one of the arguments is invalid.
153
154       The following sections are informative.
155

EXAMPLES

157       None.
158

APPLICATION USAGE

160       None.
161

RATIONALE

163       None.
164

FUTURE DIRECTIONS

166       The following functions:
167
168              posix_trace_attr_getinherited()
169              posix_trace_attr_getlogfullpolicy()
170              posix_trace_attr_getstreamfullpolicy()
171              posix_trace_attr_setinherited()
172              posix_trace_attr_setlogfullpolicy()
173              posix_trace_attr_setstreamfullpolicy()
174
175       may be removed in a future version.
176

SEE ALSO

178       fork(), posix_trace_attr_destroy(), posix_trace_create(),
179       posix_trace_get_attr(), posix_trace_getnext_event(),
180       posix_trace_start()
181
182       The Base Definitions volume of POSIX.1‐2017, <trace.h>
183
185       Portions  of  this text are reprinted and reproduced in electronic form
186       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
187       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
188       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
189       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
190       event of any discrepancy between this version and the original IEEE and
191       The  Open Group Standard, the original IEEE and The Open Group Standard
192       is the referee document. The original Standard can be  obtained  online
193       at http://www.opengroup.org/unix/online.html .
194
195       Any  typographical  or  formatting  errors that appear in this page are
196       most likely to have been introduced during the conversion of the source
197       files  to  man page format. To report such errors, see https://www.ker
198       nel.org/doc/man-pages/reporting_bugs.html .
199
200
201
202IEEE/The Open Group                  2017    POSIX_TRACE_ATTR_GETINHERITED(3P)
Impressum