if (ret < 0) {
switch (-ret) {
case LTTNG_ERR_FILTER_EXIST:
- ERR("Filter on events is already enabled"
+ WARN("Filter on events is already enabled"
" (channel %s, session %s)",
channel_name, session_name);
break;
+ case LTTNG_ERR_FILTER_INVAL:
+ case LTTNG_ERR_FILTER_NOMEM:
+ ERR("%s", lttng_strerror(ret));
default:
ERR("Setting filter: '%s'", opt_filter);
/*
if (ret < 0) {
switch (-ret) {
case LTTNG_ERR_FILTER_EXIST:
- ERR("Filter on event %s is already enabled"
+ WARN("Filter on event %s is already enabled"
" (channel %s, session %s)",
event_name, channel_name, session_name);
break;
+ case LTTNG_ERR_FILTER_INVAL:
+ case LTTNG_ERR_FILTER_NOMEM:
+ ERR("%s", lttng_strerror(ret));
default:
ERR("Setting filter for event %s: '%s'", ev.name,
opt_filter);
strlen(filter_expression), "r");
if (!fmem) {
fprintf(stderr, "Error opening memory as stream\n");
- return -ENOMEM;
+ return -LTTNG_ERR_FILTER_NOMEM;
}
ctx = filter_parser_ctx_alloc(fmem);
if (!ctx) {
fprintf(stderr, "Error allocating parser\n");
- ret = -ENOMEM;
+ ret = -LTTNG_ERR_FILTER_NOMEM;
goto alloc_error;
}
ret = filter_parser_ctx_append_ast(ctx);
if (ret) {
fprintf(stderr, "Parse error\n");
- ret = -EINVAL;
+ ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
ret = filter_visitor_set_parent(ctx);
if (ret) {
fprintf(stderr, "Set parent error\n");
- ret = -EINVAL;
+ ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
if (print_xml) {
if (ret) {
fflush(stdout);
fprintf(stderr, "XML print error\n");
- ret = -EINVAL;
+ ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
}
ret = filter_visitor_ir_generate(ctx);
if (ret) {
fprintf(stderr, "Generate IR error\n");
- ret = -EINVAL;
+ ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
dbg_printf("done\n");
fflush(stdout);
ret = filter_visitor_ir_check_binary_op_nesting(ctx);
if (ret) {
- ret = -EINVAL;
+ ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
dbg_printf("done\n");
ret = filter_visitor_bytecode_generate(ctx);
if (ret) {
fprintf(stderr, "Generate bytecode error\n");
- ret = -EINVAL;
+ ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
dbg_printf("done\n");