1POSIX_TRACE_ATTR_GETINHERITEPDO(SPI)X Programmer's MPaOnSuIaXl_TRACE_ATTR_GETINHERITED(P)
2
3
4

NAME

6       posix_trace_attr_getinherited,       posix_trace_attr_getlogfullpolicy,
7       posix_trace_attr_getstreamfullpolicy,    posix_trace_attr_setinherited,
8       posix_trace_attr_setlogfullpolicy, posix_trace_attr_setstreamfullpolicy
9       - retrieve and set the behavior of a trace stream (TRACING)
10

SYNOPSIS

12       #include <trace.h>
13
14
15
16       int posix_trace_attr_getinherited(const trace_attr_t *restrict attr,
17              int *restrict inheritancepolicy);
18
19
20       int  posix_trace_attr_getlogfullpolicy(const   trace_attr_t   *restrict
21       attr,
22              int *restrict logpolicy);
23
24
25       int posix_trace_attr_getstreamfullpolicy(const trace_attr_t *attr,
26              int *streampolicy);
27
28
29       int posix_trace_attr_setinherited(trace_attr_t *attr,
30              int inheritancepolicy);
31
32
33       int posix_trace_attr_setlogfullpolicy(trace_attr_t *attr,
34              int logpolicy);
35
36
37       int posix_trace_attr_setstreamfullpolicy(trace_attr_t *attr,
38              int streampolicy);
39
40

DESCRIPTION

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

RETURN VALUE

152       Upon  successful  completion,  these  functions shall return a value of
153       zero. Otherwise, they shall return the corresponding error number.
154
155       If successful, the posix_trace_attr_getinherited() function shall store
156       the  inheritance attribute value in the object pointed to by inheritan‐
157       cepolicy. Otherwise, the content of this object is undefined.
158
159       If successful, the posix_trace_attr_getlogfullpolicy()  function  shall
160       store  the  log-full-policy attribute value in the object pointed to by
161       logpolicy. Otherwise, the content of this object is undefined.
162
163       If  successful,  the  posix_trace_attr_getstreamfullpolicy()   function
164       shall  store  the  stream-full-policy  attribute  value  in  the object
165       pointed to by streampolicy. Otherwise, the content of  this  object  is
166       undefined.
167

ERRORS

169       These functions may fail if:
170
171       EINVAL The value specified by at least one of the arguments is invalid.
172
173
174       The following sections are informative.
175

EXAMPLES

177       None.
178

APPLICATION USAGE

180       None.
181

RATIONALE

183       None.
184

FUTURE DIRECTIONS

186       None.
187

SEE ALSO

189       fork()    ,    posix_trace_attr_init()    ,    posix_trace_create()   ,
190       posix_trace_flush()   ,   posix_trace_get_attr()   ,   posix_trace_get‐
191       next_event() , posix_trace_start() , posix_trace_timedgetnext_event() ,
192       the Base Definitions volume of IEEE Std 1003.1-2001, <trace.h>
193
195       Portions of this text are reprinted and reproduced in  electronic  form
196       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
197       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
198       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
199       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
200       event of any discrepancy between this version and the original IEEE and
201       The Open Group Standard, the original IEEE and The Open Group  Standard
202       is  the  referee document. The original Standard can be obtained online
203       at http://www.opengroup.org/unix/online.html .
204
205
206
207IEEE/The Open Group                  2003     POSIX_TRACE_ATTR_GETINHERITED(P)
Impressum