event-rule: Normalize pattern for syscall and tracepoint
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 4 Mar 2021 21:10:18 +0000 (16:10 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Apr 2021 20:36:28 +0000 (16:36 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: If5bae2cd5df76db3f9bd626f95fcace114fcc420

src/common/event-rule/syscall.c
src/common/event-rule/tracepoint.c

index 8103eaa6131f64b97b125bc9b2ada4d619f77dac..fbaa65310a6966548690bbb7db65c9c6ca91712b 100644 (file)
@@ -14,6 +14,7 @@
 #include <common/runas.h>
 #include <common/hashtable/hashtable.h>
 #include <common/hashtable/utils.h>
+#include <common/string-utils/string-utils.h>
 #include <lttng/event-rule/event-rule-internal.h>
 #include <lttng/event-rule/syscall-internal.h>
 
@@ -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;
index 62a53f9783de0626a150e13a9529120fa6fa02fe..65e2c16a70edeae1ef500de81a46c8b711c6eb9a 100644 (file)
@@ -15,6 +15,7 @@
 #include <common/runas.h>
 #include <common/hashtable/hashtable.h>
 #include <common/hashtable/utils.h>
+#include <common/string-utils/string-utils.h>
 #include <lttng/event-rule/event-rule-internal.h>
 #include <lttng/event-rule/tracepoint-internal.h>
 #include <lttng/log-level-rule.h>
@@ -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;
This page took 0.036218 seconds and 4 git commands to generate.