LTTNG_CONDITION_STATUS_UNKNOWN = -2,
LTTNG_CONDITION_STATUS_INVALID = -3,
LTTNG_CONDITION_STATUS_UNSET = -4,
+ LTTNG_CONDITION_STATUS_UNSUPPORTED = -5,
};
/*
* * `LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD`
* * `LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD`
* * `LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT`
+ *
+ * `LTTNG_CONDITION_STATUS_UNSUPPORTED`:
+ * * The associated event-rule does not support runtime capture.
*/
extern enum lttng_condition_status
lttng_condition_event_rule_append_capture_descriptor(
status = lttng_condition_event_rule_append_capture_descriptor(
c, *expr);
if (status != LTTNG_CONDITION_STATUS_OK) {
+ if (status == LTTNG_CONDITION_STATUS_UNSUPPORTED) {
+ ERR("The capture feature is unsupported by the event-rule condition type");
+ }
+
goto error;
}
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 ||
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;