📄 posix_trace_close.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>posix_trace_close</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="posix_trace_close"></a> <a name="tag_03_461"></a><!-- posix_trace_close --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_461_01"></a>NAME</h4><blockquote>posix_trace_close, posix_trace_open, posix_trace_rewind - trace log management (<b>TRACING</b>)</blockquote><h4><a name="tag_03_461_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('TRC TRL')">TRC TRL</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> #include <<a href="../basedefs/trace.h.html">trace.h</a>><br><br> int posix_trace_close(trace_id_t</tt> <i>trid</i><tt>);<br> int posix_trace_open(int</tt> <i>file_desc</i><tt>, trace_id_t *</tt><i>trid</i><tt>);<br> int posix_trace_rewind(trace_id_t</tt> <i>trid</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_03_461_03"></a>DESCRIPTION</h4><blockquote><p>The <i>posix_trace_close</i>() function shall deallocate the trace log identifier indicated by <i>trid</i>, and all of itsassociated resources. If there is no valid trace log pointed to by the <i>trid</i>, this function shall fail.</p><p>The <i>posix_trace_open</i>() function shall allocate the necessary resources and establish the connection between a trace logidentified by the <i>file_desc</i> argument and a trace stream identifier identified by the object pointed to by the <i>trid</i>argument. The <i>file_desc</i> argument should be a valid open file descriptor that corresponds to a trace log. The<i>file_desc</i> argument shall be open for reading. The current trace event timestamp, which specifies the timestamp of the traceevent that will be read by the next call to <a href="../functions/posix_trace_getnext_event.html"><i>posix_trace_getnext_event</i>()</a>, shall be set to the timestamp of the oldesttrace event recorded in the trace log identified by <i>trid</i>.</p><p>The <i>posix_trace_open</i>() function shall return a trace stream identifier in the variable pointed to by the <i>trid</i>argument, that may only be used by the following functions:</p><table cellpadding="3"><tr valign="top"><td align="left"><p class="tent"><br><i>posix_trace_close</i>()<br><a href="../functions/posix_trace_eventid_equal.html"><i>posix_trace_eventid_equal</i>()</a><br><a href="../functions/posix_trace_eventid_get_name.html"><i>posix_trace_eventid_get_name</i>()</a><br><a href="../functions/posix_trace_eventtypelist_getnext_id.html"><i>posix_trace_eventtypelist_getnext_id</i>()</a><br><a href="../functions/posix_trace_eventtypelist_rewind.html"><i>posix_trace_eventtypelist_rewind</i>()</a><br> </p></td><td align="left"><p class="tent"><br><a href="../functions/posix_trace_get_attr.html"><i>posix_trace_get_attr</i>()</a><br><a href="../functions/posix_trace_get_status.html"><i>posix_trace_get_status</i>()</a><br><a href="../functions/posix_trace_getnext_event.html"><i>posix_trace_getnext_event</i>()</a><br><i>posix_trace_rewind</i>()<br> </p></td></tr></table><p>In particular, notice that the operations normally used by a trace controller process, such as <a href="../functions/posix_trace_start.html"><i>posix_trace_start</i>()</a>, <a href="../functions/posix_trace_stop.html"><i>posix_trace_stop</i>()</a>, or <a href="../functions/posix_trace_shutdown.html"><i>posix_trace_shutdown</i>()</a>, cannot be invoked using the trace stream identifierreturned by the <i>posix_trace_open</i>() function.</p><p>The <i>posix_trace_rewind</i>() function shall reset the current trace event timestamp, which specifies the timestamp of thetrace event that will be read by the next call to <a href="../functions/posix_trace_getnext_event.html"><i>posix_trace_getnext_event</i>()</a>, to the timestamp of the oldest trace eventrecorded in the trace log identified by <i>trid</i>.</p></blockquote><h4><a name="tag_03_461_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, these functions shall return a value of zero. Otherwise, they shall return the corresponding errornumber.</p><p>If successful, the <i>posix_trace_open</i>() function stores the trace stream identifier value in the object pointed to by<i>trid</i>.</p></blockquote><h4><a name="tag_03_461_05"></a>ERRORS</h4><blockquote><p>The <i>posix_trace_open</i>() function shall fail if:</p><dl compact><dt>[EINTR]</dt><dd>The operation was interrupted by a signal and thus no trace log was opened.</dd><dt>[EINVAL]</dt><dd>The object pointed to by <i>file_desc</i> does not correspond to a valid trace log.</dd></dl><p>The <i>posix_trace_close</i>() and <i>posix_trace_rewind</i>() functions may fail if:</p><dl compact><dt>[EINVAL]</dt><dd>The object pointed to by <i>trid</i> does not correspond to a valid trace log.</dd></dl></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_461_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_461_07"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_461_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_461_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_461_10"></a>SEE ALSO</h4><blockquote><p><a href="posix_trace_get_attr.html"><i>posix_trace_get_attr</i>()</a> , <a href="posix_trace_get_filter.html"><i>posix_trace_get_filter</i>()</a> , <a href="posix_trace_getnext_event.html"><i>posix_trace_getnext_event</i>()</a> , the Base Definitions volume ofIEEE Std 1003.1-2001, <a href="../basedefs/trace.h.html"><i><trace.h></i></a></p></blockquote><h4><a name="tag_03_461_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 6. Derived from IEEE Std 1003.1q-2000.</p><p>IEEE PASC Interpretation 1003.1 #123 is applied.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -