lttng: Capture is only supported by tracepoint and syscall event-rules
[lttng-tools.git] / src / common / conditions / event-rule.c
index 3f6b96015de81d9df9b7c4cdef084d26cfff349a..a8fd7c91282a93f12ed4601ec74061dbcdfc8285 100644 (file)
@@ -751,6 +751,7 @@ lttng_condition_event_rule_append_capture_descriptor(
                        container_of(condition,
                                struct lttng_condition_event_rule, parent);
        struct lttng_capture_descriptor *descriptor = NULL;
+       const struct lttng_event_rule *rule = NULL;
 
        /* Only accept l-values. */
        if (!condition || !IS_EVENT_RULE_CONDITION(condition) || !expr ||
@@ -759,6 +760,29 @@ lttng_condition_event_rule_append_capture_descriptor(
                goto end;
        }
 
+       status = lttng_condition_event_rule_get_rule(condition, &rule);
+       if (status != LTTNG_CONDITION_STATUS_OK) {
+               goto end;
+       }
+
+       switch(lttng_event_rule_get_type(rule)) {
+       case LTTNG_EVENT_RULE_TYPE_TRACEPOINT:
+       case LTTNG_EVENT_RULE_TYPE_SYSCALL:
+               /* Supported. */
+               status = LTTNG_CONDITION_STATUS_OK;
+               break;
+       case LTTNG_EVENT_RULE_TYPE_UNKNOWN:
+               status = LTTNG_CONDITION_STATUS_INVALID;
+               break;
+       default:
+               status = LTTNG_CONDITION_STATUS_UNSUPPORTED;
+               break;
+       }
+
+       if (status != LTTNG_CONDITION_STATUS_OK) {
+               goto end;
+       }
+
        descriptor = malloc(sizeof(*descriptor));
        if (descriptor == NULL) {
                status = LTTNG_CONDITION_STATUS_ERROR;
This page took 0.023507 seconds and 4 git commands to generate.