Introduce event type field in common structure
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Mar 2021 15:20:48 +0000 (11:20 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Mar 2021 17:52:03 +0000 (13:52 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iee7f9700d60fab87e928bba11309fd8f4fad09a8

include/lttng/ust-events.h
liblttng-ust/lttng-events.c

index 9a74ed4d44bf576ff3e1bf0381b79310276967a6..7abca292729671151cf1fb50d821f49db706e6ea 100644 (file)
@@ -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 */
index af06d4908db52dcd2d382a6cdef4b858de6a601b..c74db4551f7db631026f38c4451d6c4a196dabd0 100644 (file)
@@ -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) {
This page took 0.026626 seconds and 4 git commands to generate.