X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fadd_trigger.c;h=feba92f6fb9c33c2ab0600a6698277c9716b3c6e;hb=81d566c913e31b5dbd6ec304e679a3b248abec2b;hp=e4342cf85d99a7dfb149f85c702bd57cf99e7bfd;hpb=f6e30a8ad86ac3275c23a7dc7ee223c665b10c97;p=lttng-tools.git diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index e4342cf85..feba92f6f 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -301,13 +301,16 @@ end: static struct lttng_event_expr *ir_op_load_expr_to_event_expr( - const struct ir_load_expression *load_exp, const char *capture_str) + const struct ir_load_expression *load_expr, + const char *capture_str) { char *provider_name = NULL; struct lttng_event_expr *event_expr = NULL; - const struct ir_load_expression_op *load_expr_op = load_exp->child; + const struct ir_load_expression_op *load_expr_op = load_expr->child; + const enum ir_load_expression_type load_expr_child_type = + load_expr_op->type; - switch (load_expr_op->type) { + switch (load_expr_child_type) { case IR_LOAD_EXPRESSION_GET_PAYLOAD_ROOT: case IR_LOAD_EXPRESSION_GET_CONTEXT_ROOT: { @@ -319,12 +322,12 @@ struct lttng_event_expr *ir_op_load_expr_to_event_expr( field_name = load_expr_op->u.symbol; assert(field_name); - event_expr = load_expr_op->type == IR_LOAD_EXPRESSION_GET_PAYLOAD_ROOT ? + event_expr = load_expr_child_type == IR_LOAD_EXPRESSION_GET_PAYLOAD_ROOT ? lttng_event_expr_event_payload_field_create(field_name) : lttng_event_expr_channel_context_field_create(field_name); if (!event_expr) { ERR("Failed to create %s event expression: field name = `%s`.", - load_expr_op->type == IR_LOAD_EXPRESSION_GET_PAYLOAD_ROOT ? + load_expr_child_type == IR_LOAD_EXPRESSION_GET_PAYLOAD_ROOT ? "payload field" : "channel context", field_name); goto error; @@ -1112,6 +1115,10 @@ struct lttng_condition *handle_condition_event(int *argc, const char ***argv) 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; }