From: Mathieu Desnoyers Date: Mon, 15 Mar 2021 15:20:48 +0000 (-0400) Subject: Introduce event type field in common structure X-Git-Tag: v2.13.0-rc1~296 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=808edfc82d5518fb99f5fdc781c74dcf61d8e770;p=lttng-ust.git Introduce event type field in common structure Signed-off-by: Mathieu Desnoyers Change-Id: Iee7f9700d60fab87e928bba11309fd8f4fad09a8 --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 9a74ed4d..7abca292 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -350,10 +350,16 @@ struct lttng_bytecode_runtime { struct lttng_ust_event_common_private; +enum lttng_ust_event_type { + LTTNG_UST_EVENT_TYPE_RECORDER = 0, + LTTNG_UST_EVENT_TYPE_NOTIFIER = 1, +}; + struct lttng_ust_event_common { uint32_t struct_size; /* Size of this structure. */ struct lttng_ust_event_common_private *priv; /* Private event interface */ + enum lttng_ust_event_type type; int enabled; int has_enablers_without_bytecode; /* list of struct lttng_bytecode_runtime, sorted by seqnum */ diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index af06d490..c74db455 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -780,6 +780,7 @@ int lttng_event_recorder_create(const struct lttng_event_desc *desc, goto parent_error; } event_recorder->parent->struct_size = sizeof(struct lttng_ust_event_common); + event_recorder->parent->type = LTTNG_UST_EVENT_TYPE_RECORDER; event_recorder_priv = zmalloc(sizeof(struct lttng_ust_event_recorder_private)); if (!event_recorder_priv) { @@ -873,6 +874,7 @@ int lttng_event_notifier_create(const struct lttng_event_desc *desc, goto parent_error; } event_notifier->parent->struct_size = sizeof(struct lttng_ust_event_common); + event_notifier->parent->type = LTTNG_UST_EVENT_TYPE_NOTIFIER; event_notifier_priv = zmalloc(sizeof(struct lttng_ust_event_notifier_private)); if (!event_notifier_priv) {