event-rule: syscall: set the default pattern to '*'
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 5 Nov 2020 16:28:03 +0000 (11:28 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Mar 2021 15:02:06 +0000 (11:02 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I8456f7f125b9341d31bc7bc2b8474abbc44b5467

include/lttng/event-rule/syscall.h
src/common/event-rule/syscall.c

index baf8432c142597295ee05936edb2f97ffd9837c1..c581b809cf18a5a67993c11043e748525424aa1a 100644 (file)
@@ -17,6 +17,8 @@ extern "C" {
 /*
  * Create a newly allocated syscall event rule.
  *
+ * The default pattern is '*'.
+ *
  * Returns a new event rule on success, NULL on failure. This event rule must be
  * destroyed using lttng_event_rule_destroy().
  */
index b1b556aba3aa6bf5b7dcc45b65d0e408a2a7f832..8103eaa6131f64b97b125bc9b2ada4d619f77dac 100644 (file)
@@ -249,6 +249,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 +272,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;
 }
This page took 0.026991 seconds and 4 git commands to generate.