Add missing counter handling
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 10 Feb 2022 20:30:31 +0000 (15:30 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Jul 2024 20:58:48 +0000 (16:58 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I5ba6bc03b7c090e6c9b6431d81da4a739c764610

src/lttng-events.c

index 9b421f72bd0f673aa818da5644025a6f1d68707a..241c7964b194c042387aff9cc2e652400836ed87 100644 (file)
@@ -658,6 +658,8 @@ int lttng_event_enable(struct lttng_kernel_event_common *event)
                        break;
                }
                break;
+       case LTTNG_KERNEL_EVENT_TYPE_COUNTER:
+               break;
        default:
                break;
        }
@@ -722,6 +724,8 @@ int lttng_event_disable(struct lttng_kernel_event_common *event)
                        break;
                }
                break;
+       case LTTNG_KERNEL_EVENT_TYPE_COUNTER:
+               break;
        default:
                break;
        }
@@ -1178,7 +1182,8 @@ static
 bool match_event_key(struct lttng_kernel_event_common *event, const char *key_string)
 {
        switch (event->type) {
-       case LTTNG_KERNEL_EVENT_TYPE_RECORDER:  /* Fall-through */
+       case LTTNG_KERNEL_EVENT_TYPE_RECORDER:
+               lttng_fallthrough;
        case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
                return true;
 
@@ -1616,6 +1621,7 @@ void unregister_event(struct lttng_kernel_event_common *event)
        case LTTNG_KERNEL_ABI_KRETPROBE:
                switch (event->type) {
                case LTTNG_KERNEL_EVENT_TYPE_RECORDER:
+                       lttng_fallthrough;
                case LTTNG_KERNEL_EVENT_TYPE_COUNTER:
                        lttng_kretprobes_unregister(event);
                        ret = 0;
@@ -1633,6 +1639,7 @@ void unregister_event(struct lttng_kernel_event_common *event)
        case LTTNG_KERNEL_ABI_NOOP:
                switch (event->type) {
                case LTTNG_KERNEL_EVENT_TYPE_RECORDER:
+                       lttng_fallthrough;
                case LTTNG_KERNEL_EVENT_TYPE_COUNTER:
                        ret = 0;
                        break;
@@ -2632,6 +2639,8 @@ void lttng_event_sync_capture_state(struct lttng_kernel_event_common *event)
 {
        switch (event->type) {
        case LTTNG_KERNEL_EVENT_TYPE_RECORDER:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_EVENT_TYPE_COUNTER:
                break;
        case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
        {
@@ -2678,16 +2687,18 @@ bool lttng_get_event_enabled_state(struct lttng_kernel_event_common *event)
 
        switch (event->type) {
        case LTTNG_KERNEL_EVENT_TYPE_RECORDER:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_EVENT_TYPE_COUNTER:
        {
-               struct lttng_kernel_event_recorder *event_recorder =
-                       container_of(event, struct lttng_kernel_event_recorder, parent);
+               struct lttng_kernel_event_session_common_private *event_session_common_priv =
+                       container_of(event->priv, struct lttng_kernel_event_session_common_private, parent);
 
                /*
                 * Enabled state is based on union of enablers, with
                 * intersection of session and channel transient enable
                 * states.
                 */
-               return enabled && event_recorder->chan->parent.session->priv->tstate && event_recorder->chan->priv->parent.tstate;
+               return enabled && event_session_common_priv->chan->session->priv->tstate && event_session_common_priv->chan->priv->tstate;
        }
        case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
                return enabled;
This page took 0.028633 seconds and 4 git commands to generate.