assert(ev);
/* Don't add filter for the '*' event. */
- if (ev->name[0] != '*') {
+ if (strcmp(ev->name, "*") != 0) {
if (filter) {
err = asprintf(&agent_filter, "(%s) && (logger_name == \"%s\")", filter,
ev->name);
ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
+
+ /* Normalize globbing patterns in the expression. */
+ ret = filter_visitor_ir_normalize_glob_patterns(ctx);
+ if (ret) {
+ ret = -LTTNG_ERR_FILTER_INVAL;
+ goto parse_error;
+ }
+
/* Validate strings used as literals in the expression. */
ret = filter_visitor_ir_validate_string(ctx);
if (ret) {
ret = -LTTNG_ERR_FILTER_INVAL;
goto parse_error;
}
+
+ /* Validate globbing patterns in the expression. */
+ ret = filter_visitor_ir_validate_globbing(ctx);
+ if (ret) {
+ ret = -LTTNG_ERR_FILTER_INVAL;
+ goto parse_error;
+ }
+
dbg_printf("done\n");
dbg_printf("Generating bytecode... ");
void lttng_channel_set_default_attr(struct lttng_domain *domain,
struct lttng_channel_attr *attr)
{
- struct lttng_channel_extended *extended =
- (struct lttng_channel_extended *) attr->extended.ptr;
+ struct lttng_channel_extended *extended;
/* Safety check */
if (attr == NULL || domain == NULL) {
return;
}
+ extended = (struct lttng_channel_extended *) attr->extended.ptr;
memset(attr, 0, sizeof(struct lttng_channel_attr));
/* Same for all domains. */
}
if (!lttng_trigger_validate(trigger)) {
- ret = -LTTNG_ERR_INVALID;
+ ret = -LTTNG_ERR_INVALID_TRIGGER;
goto end;
}