# posix_trace_eventid_equal

## PROLOG



           This manual page is part of the POSIX Programmer's Manual.  The
           Linux implementation of this interface may differ (consult the
           corresponding Linux manual page for details of Linux behavior), or
           the interface may not be implemented on Linux.
    


## NAME



           posix_trace_eventid_equal, posix_trace_eventid_get_name,
           posix_trace_trid_eventid_open — manipulate the trace event type
           identifier (**TRACING**)
    


## SYNOPSIS



           #include <trace.h>
    
           int posix_trace_eventid_equal(trace_id_t _trid_ , trace_event_id_t _event1_ ,
               trace_event_id_t _event2_);
           int posix_trace_eventid_get_name(trace_id_t _trid_ ,
               trace_event_id_t _event_ , char *_event_name_);
           int posix_trace_trid_eventid_open(trace_id_t _trid_ ,
               const char *restrict _event_name_ ,
               trace_event_id_t *restrict _event_);
    


## DESCRIPTION



           The _posix_trace_eventid_equal_() function shall compare the trace
           event type identifiers _event1_ and _event2_ from the same trace
           stream or the same trace log identified by the _trid_ argument. If
           the trace event type identifiers _event1_ and _event2_ are from
           different trace streams, the return value shall be unspecified.
    
           The _posix_trace_eventid_get_name_() function shall return, in the
           argument pointed to by _event_name_ , the trace event name associated
           with the trace event type identifier identified by the argument
           _event_ , for the trace stream or for the trace log identified by the
           _trid_ argument. The name of the trace event shall have a maximum of
           {TRACE_EVENT_NAME_MAX} characters (which has the minimum value
           {_POSIX_TRACE_EVENT_NAME_MAX}).  Successive calls to this function
           with the same trace event type identifier and the same trace
           stream identifier shall return the same event name.
    
           The _posix_trace_trid_eventid_open_() function shall associate a
           user trace event name with a trace event type identifier for a
           given trace stream. The trace stream is identified by the _trid_
           argument, and it shall be an active trace stream. The trace event
           name is the string pointed to by the argument _event_name_.  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}.
    
           If the Trace Inherit option is not supported, the
           _posix_trace_trid_eventid_open_() function shall associate the user
           trace event name pointed to by the _event_name_ argument with a
           trace event type identifier that is unique for the process being
           traced in the trace stream identified by the _trid_ argument, and is
           returned in the variable pointed to by the _event_ 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 _Table 2-7_ , _Trace_
           _Option: User Trace Event_) user trace event shall be returned.
    
           If the Trace Inherit option is supported, the
           _posix_trace_trid_eventid_open_() function shall associate the user
           trace event name pointed to by the _event_name_ argument with a
           trace event type identifier that is unique for all the processes
           being traced in the trace stream identified by the _trid_ argument,
           and is returned in the variable pointed to by the _event_ 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 (see _Table 2-7_ ,
           _Trace Option: User Trace Event_) user trace event shall be
           returned.
    


## RETURN VALUE



           Upon successful completion, the _posix_trace_eventid_get_name_() and
           _posix_trace_trid_eventid_open_() functions shall return a value of
           zero. Otherwise, they shall return the corresponding error number.
    
           The _posix_trace_eventid_equal_() function shall return a non-zero
           value if _event1_ and _event2_ are equal; otherwise, a value of zero
           shall be returned. No errors are defined. If either _event1_ or
           _event2_ are not valid trace event type identifiers for the trace
           stream specified by _trid_ or if the _trid_ is invalid, the behavior
           shall be unspecified.
    
           The _posix_trace_eventid_get_name_() function stores the trace event
           name value in the object pointed to by _event_name_ , if successful.
    
           The _posix_trace_trid_eventid_open_() function stores the trace
           event type identifier value in the object pointed to by _event_ , if
           successful.
    


## ERRORS



           The _posix_trace_eventid_get_name_() and
           _posix_trace_trid_eventid_open_() functions shall fail if:
    
           **EINVAL** The _trid_ argument was not a valid trace stream identifier.
    
           The _posix_trace_trid_eventid_open_() function shall fail if:
    
           **ENAMETOOLONG**
                  The size of the name pointed to by the _event_name_ argument
                  was longer than the implementation-defined value
                  {TRACE_EVENT_NAME_MAX}.
    
           The _posix_trace_eventid_get_name_() function shall fail if:
    
           **EINVAL** The trace event type identifier _event_ was not associated
                  with any name.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           None.
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           The _posix_trace_eventid_equal_(), _posix_trace_eventid_get_name_(),
           and _posix_trace_trid_eventid_open_() functions may be removed in a
           future version.
    


* * *