logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

posix_trace_getnext_event.3p (8442B)


  1. '\" et
  2. .TH POSIX_TRACE_GETNEXT_EVENT "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. posix_trace_getnext_event,
  12. posix_trace_timedgetnext_event,
  13. posix_trace_trygetnext_event
  14. \(em retrieve a trace event
  15. (\fBTRACING\fP)
  16. .SH SYNOPSIS
  17. .LP
  18. .nf
  19. #include <sys/types.h>
  20. #include <trace.h>
  21. .P
  22. int posix_trace_getnext_event(trace_id_t \fItrid\fP,
  23. struct posix_trace_event_info *restrict \fIevent\fP,
  24. void *restrict \fIdata\fP, size_t \fInum_bytes\fP,
  25. size_t *restrict \fIdata_len\fP, int *restrict \fIunavailable\fP);
  26. int posix_trace_timedgetnext_event(trace_id_t \fItrid\fP,
  27. struct posix_trace_event_info *restrict \fIevent\fP,
  28. void *restrict \fIdata\fP, size_t \fInum_bytes\fP,
  29. size_t *restrict \fIdata_len\fP, int *restrict \fIunavailable\fP,
  30. const struct timespec *restrict \fIabstime\fP);
  31. int posix_trace_trygetnext_event(trace_id_t \fItrid\fP,
  32. struct posix_trace_event_info *restrict \fIevent\fP,
  33. void *restrict \fIdata\fP, size_t \fInum_bytes\fP,
  34. size_t *restrict \fIdata_len\fP, int *restrict \fIunavailable\fP);
  35. .fi
  36. .SH DESCRIPTION
  37. The
  38. \fIposix_trace_getnext_event\fR()
  39. function shall report a recorded trace event either from an
  40. active trace stream without log
  41. or a pre-recorded trace stream identified by the
  42. .IR trid
  43. argument.
  44. The
  45. \fIposix_trace_trygetnext_event\fR()
  46. function shall report a recorded trace event from an active
  47. trace stream without log identified by the
  48. .IR trid
  49. argument.
  50. .P
  51. The trace event information associated with the recorded trace event
  52. shall be copied by the function into the structure pointed to by the
  53. argument
  54. .IR event
  55. and the data associated with the trace event shall be copied into the
  56. buffer pointed to by the
  57. .IR data
  58. argument.
  59. .P
  60. The
  61. \fIposix_trace_getnext_event\fR()
  62. function shall block if the
  63. .IR trid
  64. argument identifies an active trace stream and there is currently no
  65. trace event ready to be retrieved. When returning, if a recorded trace
  66. event was reported, the variable pointed to by the
  67. .IR unavailable
  68. argument shall be set to zero. Otherwise, the variable pointed to by
  69. the
  70. .IR unavailable
  71. argument shall be set to a value different from zero.
  72. .P
  73. The
  74. \fIposix_trace_timedgetnext_event\fR()
  75. function shall attempt to get another trace event from an active trace
  76. stream without log, as in the
  77. \fIposix_trace_getnext_event\fR()
  78. function. However, if no trace event is available from the trace
  79. stream, the implied wait shall be terminated when the timeout specified
  80. by the argument
  81. .IR abstime
  82. expires, and the function shall return the error
  83. .BR [ETIMEDOUT] .
  84. .P
  85. The timeout shall expire when the absolute time specified by
  86. .IR abstime
  87. passes, as measured by the clock upon which timeouts are based (that
  88. is, when the value of that clock equals or exceeds
  89. .IR abstime ),
  90. or if the absolute time specified by
  91. .IR abstime
  92. has already passed at the time of the call.
  93. .P
  94. The timeout shall be based on the CLOCK_REALTIME clock.
  95. The resolution of the timeout shall be the resolution of the clock
  96. on which it is based. The
  97. .BR timespec
  98. data type is defined in the
  99. .IR <time.h>
  100. header.
  101. .P
  102. Under no circumstance shall the function fail with a timeout if a trace
  103. event is immediately available from the trace stream. The validity of
  104. the
  105. .IR abstime
  106. argument need not be checked if a trace event is immediately available
  107. from the trace stream.
  108. .P
  109. The behavior of this function for a pre-recorded trace stream is
  110. unspecified.
  111. .P
  112. The
  113. \fIposix_trace_trygetnext_event\fR()
  114. function shall not block.
  115. This function shall return an error if the
  116. .IR trid
  117. argument identifies a pre-recorded trace stream.
  118. If a recorded trace event was reported, the variable pointed to by the
  119. .IR unavailable
  120. argument shall be set to zero. Otherwise, if no trace event was
  121. reported, the variable pointed to by the
  122. .IR unavailable
  123. argument shall be set to a value different from zero.
  124. .P
  125. The argument
  126. .IR num_bytes
  127. shall be the size of the buffer pointed to by the
  128. .IR data
  129. argument. The argument
  130. .IR data_len
  131. reports to the application the length in bytes of the data record just
  132. transferred. If
  133. .IR num_bytes
  134. is greater than or equal to the size of the data associated with the
  135. trace event pointed to by the
  136. .IR event
  137. argument, all the recorded data shall be transferred. In this case,
  138. the
  139. .IR truncation-status
  140. member of the trace event structure shall be either
  141. POSIX_TRACE_NOT_TRUNCATED,
  142. if the trace event data was recorded without truncation while tracing,
  143. or POSIX_TRACE_TRUNCATED_RECORD,
  144. if the trace event data was truncated when it was recorded. If the
  145. .IR num_bytes
  146. argument is less than the length of recorded trace event data, the data
  147. transferred shall be truncated to a length of
  148. .IR num_bytes ,
  149. the value stored in the variable pointed to by
  150. .IR data_len
  151. shall be equal to
  152. .IR num_bytes ,
  153. and the
  154. .IR truncation-status
  155. member of the
  156. .IR event
  157. structure argument shall be set to POSIX_TRACE_TRUNCATED_READ
  158. (see the
  159. .BR posix_trace_event_info
  160. structure defined in
  161. .IR <trace.h> ).
  162. .P
  163. The report of a trace event shall be sequential starting from the
  164. oldest recorded trace event. Trace events shall be reported in the
  165. order in which they were generated, up to an implementation-defined
  166. time resolution that causes the ordering of trace events occurring very
  167. close to each other to be unknown. Once reported, a trace event cannot
  168. be reported again from an active trace stream. Once a trace event is
  169. reported from an active trace stream without log, the trace stream
  170. shall make the resources associated with that trace event available to
  171. record future generated trace events.
  172. .SH "RETURN VALUE"
  173. Upon successful completion, these functions shall return a value of
  174. zero. Otherwise, they shall return the corresponding error number.
  175. .P
  176. If successful, these functions store:
  177. .IP " *" 4
  178. The recorded trace event in the object pointed to by
  179. .IR event
  180. .IP " *" 4
  181. The trace event information associated with the recorded trace event in
  182. the object pointed to by
  183. .IR data
  184. .IP " *" 4
  185. The length of this trace event information in the object pointed to by
  186. .IR data_len
  187. .IP " *" 4
  188. The value of zero in the object pointed to by
  189. .IR unavailable
  190. .SH ERRORS
  191. These functions shall fail if:
  192. .TP
  193. .BR EINVAL
  194. The trace stream identifier argument
  195. .IR trid
  196. is invalid.
  197. .P
  198. The
  199. \fIposix_trace_getnext_event\fR()
  200. and
  201. \fIposix_trace_timedgetnext_event\fR()
  202. functions shall fail if:
  203. .TP
  204. .BR EINTR
  205. The operation was interrupted by a signal, and so the call had no
  206. effect.
  207. .P
  208. The
  209. \fIposix_trace_trygetnext_event\fR()
  210. function shall fail if:
  211. .TP
  212. .BR EINVAL
  213. The trace stream identifier argument
  214. .IR trid
  215. does not correspond to an active trace stream.
  216. .br
  217. .P
  218. The
  219. \fIposix_trace_timedgetnext_event\fR()
  220. function shall fail if:
  221. .TP
  222. .BR EINVAL
  223. There is no trace event immediately available from the trace stream,
  224. and the
  225. .IR timeout
  226. argument is invalid.
  227. .TP
  228. .BR ETIMEDOUT
  229. No trace event was available from the trace stream before the specified
  230. timeout
  231. .IR timeout
  232. expired.
  233. .LP
  234. .IR "The following sections are informative."
  235. .SH EXAMPLES
  236. None.
  237. .SH "APPLICATION USAGE"
  238. None.
  239. .SH RATIONALE
  240. None.
  241. .SH "FUTURE DIRECTIONS"
  242. These functions may be removed in a future version.
  243. .SH "SEE ALSO"
  244. .IR "\fIposix_trace_close\fR\^(\|)",
  245. .IR "\fIposix_trace_create\fR\^(\|)"
  246. .P
  247. The Base Definitions volume of POSIX.1\(hy2017,
  248. .IR "\fB<sys_types.h>\fP",
  249. .IR "\fB<trace.h>\fP"
  250. .\"
  251. .SH COPYRIGHT
  252. Portions of this text are reprinted and reproduced in electronic form
  253. from IEEE Std 1003.1-2017, Standard for Information Technology
  254. -- Portable Operating System Interface (POSIX), The Open Group Base
  255. Specifications Issue 7, 2018 Edition,
  256. Copyright (C) 2018 by the Institute of
  257. Electrical and Electronics Engineers, Inc and The Open Group.
  258. In the event of any discrepancy between this version and the original IEEE and
  259. The Open Group Standard, the original IEEE and The Open Group Standard
  260. is the referee document. The original Standard can be obtained online at
  261. http://www.opengroup.org/unix/online.html .
  262. .PP
  263. Any typographical or formatting errors that appear
  264. in this page are most likely
  265. to have been introduced during the conversion of the source files to
  266. man page format. To report such errors, see
  267. https://www.kernel.org/doc/man-pages/reporting_bugs.html .