Use bt_event_class_set_name() and bt_event_class_get_name().
</dd>
+ <dt>
+ \anchor api-tir-ev-cls-prop-uid
+ \bt_dt_opt UID
+ (only available when the parent \bt_trace_cls was created
+ from a \bt_comp which belongs to a trace processing \bt_graph
+ with the effective \bt_mip version 1)
+ </dt>
+ <dd>
+ <a href="https://en.wikipedia.org/wiki/Unique_identifier">Unique identifier</a>
+ (UID) of the event class.
+
+ Use bt_event_class_set_uid() and
+ bt_event_class_get_uid().
+ </dd>
+
<dt>\anchor api-tir-ev-cls-prop-log-lvl \bt_dt_opt Log level</dt>
<dd>
Log level of the event class.
<tr>
<td>\ref api-tir-ev-cls-prop-name "Name"
<td>\em None
+ <tr>
+ <td>\bt_mip version 1: \ref api-tir-ev-cls-prop-uid "UID"
+ <td>\em None
<tr>
<td>\ref api-tir-ev-cls-prop-log-lvl "Log level"
<td>\em None
<tr>
<td>\ref api-tir-ev-cls-prop-name "Name"
<td>\em None
+ <tr>
+ <td>\bt_mip version 1: \ref api-tir-ev-cls-prop-uid "UID"
+ <td>\em None
<tr>
<td>\ref api-tir-ev-cls-prop-log-lvl "Log level"
<td>\em None
extern bt_event_class_set_name_status bt_event_class_set_name(
bt_event_class *event_class, const char *name) __BT_NOEXCEPT;
+/*!
+@brief
+ Status codes for bt_event_class_set_uid().
+*/
+typedef enum bt_event_class_set_uid_status {
+ /*!
+ @brief
+ Success.
+ */
+ BT_EVENT_CLASS_SET_UID_STATUS_OK = __BT_FUNC_STATUS_OK,
+
+ /*!
+ @brief
+ Out of memory.
+ */
+ BT_EVENT_CLASS_SET_UID_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
+} bt_event_class_set_uid_status;
+
+/*!
+@brief
+ Sets the
+ <a href="https://en.wikipedia.org/wiki/Unique_identifier">unique identifier</a> (UID)
+ of the stream class \bt_p{event_class} to
+ a copy of \bt_p{uid}.
+
+See the \ref api-tir-ev-cls-prop-uid "UID" property.
+
+@param[in] event_class
+ Event class of which to set the UID to \bt_p{uid}.
+@param[in] name
+ New UID of \bt_p{event_class} (copied).
+
+@retval #BT_EVENT_CLASS_SET_UID_STATUS_OK
+ Success.
+@retval #BT_EVENT_CLASS_SET_UID_STATUS_MEMORY_ERROR
+ Out of memory.
+
+@bt_pre_not_null{event_class}
+@bt_pre_hot{event_class}
+@bt_pre_ev_cls_with_mip{event_class, 1}
+@bt_pre_not_null{uid}
+
+@sa bt_event_class_get_uid() —
+ Returns the UID of an event class.
+*/
+extern bt_event_class_set_uid_status bt_event_class_set_uid(
+ bt_event_class *event_class, const char *uid) __BT_NOEXCEPT;
+
+/*!
+@brief
+ Returns the UID of the event class \bt_p{event_class}.
+
+See the \ref api-tir-ev-cls-prop-uid "UID" property.
+
+If \bt_p{event_class} has no UID, this function returns \c NULL.
+
+@param[in] event_class
+ Event class of which to get the UID.
+
+@returns
+ @parblock
+ UID of \bt_p{event_class}, or \c NULL if none.
+
+ The returned pointer remains valid as long as \bt_p{event_class}
+ is not modified.
+ @endparblock
+
+@bt_pre_not_null{event_class}
+@bt_pre_ev_cls_with_mip{event_class, 1}
+
+@sa bt_event_class_set_uid() —
+ Sets the UID of an event class.
+*/
+extern const char *
+bt_event_class_get_uid(const bt_event_class *event_class) __BT_NOEXCEPT;
+
/*!
@brief
Returns the name of the event class \bt_p{event_class}.
g_free(event_class->ns);
g_free(event_class->name);
+ g_free(event_class->uid);
g_free(event_class->emf_uri);
BT_LOGD_STR("Putting context field class.");
BT_OBJECT_PUT_REF_AND_RESET(event_class->specific_context_fc);
return BT_FUNC_STATUS_OK;
}
+BT_EXPORT
+const char *bt_event_class_get_uid(const struct bt_event_class *event_class)
+{
+ BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class);
+ BT_ASSERT_PRE_EC_MIP_VERSION_GE(event_class, 1);
+ return event_class->uid;
+}
+
+BT_EXPORT
+enum bt_event_class_set_uid_status bt_event_class_set_uid(
+ struct bt_event_class *event_class, const char *uid)
+{
+ BT_ASSERT_PRE_NO_ERROR();
+ BT_ASSERT_PRE_EC_NON_NULL(event_class);
+ BT_ASSERT_PRE_EC_MIP_VERSION_GE(event_class, 1);
+ BT_ASSERT_PRE_NAME_NON_NULL(uid);
+ BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
+ g_free(event_class->uid);
+ event_class->uid = g_strdup(uid);
+ BT_LIB_LOGD("Set event class's UID: %!+E", event_class);
+ return BT_FUNC_STATUS_OK;
+}
+
BT_EXPORT
uint64_t bt_event_class_get_id(const struct bt_event_class *event_class)
{