180 lines
8.3 KiB
HTML
180 lines
8.3 KiB
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 The Open Group, All Rights Reserved -->
|
|
<title>posix_trace_event</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="posix_trace_event"></a> <a name="tag_03_463"></a><!-- posix_trace_event -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_03_463_01"></a>NAME</h4>
|
|
|
|
<blockquote>posix_trace_event, posix_trace_eventid_open - trace functions for instrumenting application code
|
|
(<b>TRACING</b>)</blockquote>
|
|
|
|
<h4><a name="tag_03_463_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('TRC')">TRC</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <<a href="../basedefs/sys/types.h.html">sys/types.h</a>><br>
|
|
#include <<a href="../basedefs/trace.h.html">trace.h</a>><br>
|
|
<br>
|
|
void posix_trace_event(trace_event_id_t</tt> <i>event_id</i><tt>,<br>
|
|
const void *restrict</tt><i>data_ptr</i><tt>, size_t</tt> <i>data_len</i><tt>);<br>
|
|
int posix_trace_eventid_open(const char *restrict</tt> <i>event_name</i><tt>,<br>
|
|
trace_event_id_t *restrict</tt> <i>event_id</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_463_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>posix_trace_event</i>() function shall record the <i>event_id</i> and the user data pointed to by <i>data_ptr</i> in the
|
|
trace stream into which the calling process is being traced and in which <i>event_id</i> is not filtered out. If the total size of
|
|
the user trace event data represented by <i>data_len</i> is not greater than the declared maximum size for user trace event data,
|
|
then the <i>truncation-status</i> attribute of the trace event recorded is POSIX_TRACE_NOT_TRUNCATED. Otherwise, the user trace
|
|
event data is truncated to this declared maximum size and the <i>truncation-status</i> attribute of the trace event recorded is
|
|
POSIX_TRACE_TRUNCATED_RECORD.</p>
|
|
|
|
<p>If there is no trace stream created for the process or if the created trace stream is not running, or if the trace event
|
|
specified by <i>event_id</i> is filtered out in the trace stream, the <i>posix_trace_event</i>() function shall have no effect.</p>
|
|
|
|
<p>The <i>posix_trace_eventid_open</i>() function shall associate a user trace event name with a trace event type identifier for
|
|
the calling process. The trace event name is the string pointed to by the argument <i>event_name</i>. It shall have a maximum of
|
|
{TRACE_EVENT_NAME_MAX} characters (which has the minimum value {_POSIX_TRACE_EVENT_NAME_MAX}). The number of user trace event type
|
|
identifiers that can be defined for any given process is limited by the maximum value {TRACE_USER_EVENT_MAX}, which has the minimum
|
|
value {POSIX_TRACE_USER_EVENT_MAX}.</p>
|
|
|
|
<p>If the Trace Inherit option is not supported, the <i>posix_trace_eventid_open</i>() function shall associate the user trace
|
|
event name pointed to by the <i>event_name</i> argument with a trace event type identifier that is unique for the traced process,
|
|
and is returned in the variable pointed to by the <i>event_id</i> argument. If the user trace event name has already been mapped
|
|
for the traced process, then the previously assigned trace event type identifier shall be returned. If the per-process user trace
|
|
event name limit represented by {TRACE_USER_EVENT_MAX} has been reached, the pre-defined POSIX_TRACE_UNNAMED_USEREVENT (see <a
|
|
href="xsh_chap02_11.html#tagtcjh_7"><i>Trace Option: User Trace Event</i></a> ) user trace event shall be returned.</p>
|
|
|
|
<p><sup>[<a href="javascript:open_code('TRI')">TRI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
If the Trace Inherit option is supported, the <i>posix_trace_eventid_open</i>() function shall associate the user trace event name
|
|
pointed to by the <i>event_name</i> argument with a trace event type identifier that is unique for all the processes being traced
|
|
in this same trace stream, and is returned in the variable pointed to by the <i>event_id</i> argument. If the user trace event name
|
|
has already been mapped for the traced processes, then the previously assigned trace event type identifier shall be returned. If
|
|
the per-process user trace event name limit represented by {TRACE_USER_EVENT_MAX} has been reached, the pre-defined
|
|
POSIX_TRACE_UNNAMED_USEREVENT ( <a href="xsh_chap02_11.html#tagtcjh_7"><i>Trace Option: User Trace Event</i></a> ) user trace event
|
|
shall be returned. <basefont size="2"></p>
|
|
|
|
<dl>
|
|
<dt><b>Note:</b></dt>
|
|
|
|
<dd>The above procedure, together with the fact that multiple processes can only be traced into the same trace stream by
|
|
inheritance, ensure that all the processes that are traced into a trace stream have the same mapping of trace event names to trace
|
|
event type identifiers.</dd>
|
|
</dl>
|
|
|
|
<basefont size="3"> <img src="../images/opt-end.gif" alt="[Option End]" border="0">
|
|
|
|
<p>If there is no trace stream created, the <i>posix_trace_eventid_open</i>() function shall store this information for future
|
|
trace streams created for this process.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_463_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p>No return value is defined for the <i>posix_trace_event</i>() function.</p>
|
|
|
|
<p>Upon successful completion, the <i>posix_trace_eventid_open</i>() function shall return a value of zero. Otherwise, it shall
|
|
return the corresponding error number. The <i>posix_trace_eventid_open</i>() function stores the trace event type identifier value
|
|
in the object pointed to by <i>event_id</i>, if successful.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_463_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>posix_trace_eventid_open</i>() function shall fail if:</p>
|
|
|
|
<dl compact>
|
|
<dt>[ENAMETOOLONG]</dt>
|
|
|
|
<dd>
|
|
The size of the name pointed to by the <i>event_name</i> argument was longer than the implementation-defined value
|
|
{TRACE_EVENT_NAME_MAX}.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_463_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_463_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_463_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_463_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_463_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="xsh_chap02_11.html#tagtcjh_7"><i>Trace Option: User Trace Event</i></a> , <a href=
|
|
"posix_trace_start.html"><i>posix_trace_start</i>()</a> , <a href=
|
|
"posix_trace_trid_eventid_open.html"><i>posix_trace_trid_eventid_open</i>()</a> , the Base Definitions volume of
|
|
IEEE Std 1003.1-2001, <a href="../basedefs/sys/types.h.html"><i><sys/types.h></i></a>, <a href=
|
|
"../basedefs/trace.h.html"><i><trace.h></i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_463_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>
|
|
|
|
<p>IEEE PASC Interpretation 1003.1 #127 is applied, correcting some editorial errors in the names of the
|
|
<i>posix_trace_eventid_open</i>() function and the <i>event_id</i> argument.</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>
|
|
|