X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fsyscall.c;h=fbaa65310a6966548690bbb7db65c9c6ca91712b;hp=b1b556aba3aa6bf5b7dcc45b65d0e408a2a7f832;hb=40fd2ccf9faa3e8b6d67d40c8ee52a2b3d1f07bd;hpb=2b00d46244cab86f1186a7b00cdc660f24a26f72 diff --git a/src/common/event-rule/syscall.c b/src/common/event-rule/syscall.c index b1b556aba..fbaa65310 100644 --- a/src/common/event-rule/syscall.c +++ b/src/common/event-rule/syscall.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -249,6 +250,7 @@ struct lttng_event_rule *lttng_event_rule_syscall_create(void) { struct lttng_event_rule *rule = NULL; struct lttng_event_rule_syscall *syscall_rule; + enum lttng_event_rule_status status; syscall_rule = zmalloc(sizeof(struct lttng_event_rule_syscall)); if (!syscall_rule) { @@ -271,6 +273,14 @@ struct lttng_event_rule *lttng_event_rule_syscall_create(void) syscall_rule->parent.generate_exclusions = lttng_event_rule_syscall_generate_exclusions; syscall_rule->parent.hash = lttng_event_rule_syscall_hash; + + /* Default pattern is '*'. */ + status = lttng_event_rule_syscall_set_pattern(rule, "*"); + if (status != LTTNG_EVENT_RULE_STATUS_OK) { + lttng_event_rule_destroy(rule); + rule = NULL; + } + end: return rule; } @@ -405,9 +415,9 @@ enum lttng_event_rule_status lttng_event_rule_syscall_set_pattern( goto end; } - if (syscall->pattern) { - free(syscall->pattern); - } + strutils_normalize_star_glob_pattern(pattern_copy); + + free(syscall->pattern); syscall->pattern = pattern_copy; pattern_copy = NULL;