From: Jonathan Rajotte Date: Thu, 4 Mar 2021 21:10:18 +0000 (-0500) Subject: event-rule: Normalize pattern for syscall and tracepoint X-Git-Tag: v2.13.0-rc1~108 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=40fd2ccf9faa3e8b6d67d40c8ee52a2b3d1f07bd;p=lttng-tools.git event-rule: Normalize pattern for syscall and tracepoint Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: If5bae2cd5df76db3f9bd626f95fcace114fcc420 --- diff --git a/src/common/event-rule/syscall.c b/src/common/event-rule/syscall.c index 8103eaa61..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 @@ -414,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; diff --git a/src/common/event-rule/tracepoint.c b/src/common/event-rule/tracepoint.c index 62a53f978..65e2c16a7 100644 --- a/src/common/event-rule/tracepoint.c +++ b/src/common/event-rule/tracepoint.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -952,6 +953,9 @@ enum lttng_event_rule_status lttng_event_rule_tracepoint_set_pattern( goto end; } + /* Normalize the pattern. */ + strutils_normalize_star_glob_pattern(pattern_copy); + free(tracepoint->pattern); tracepoint->pattern = pattern_copy;