event-rule: tracepoint: set default pattern to '*'
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 5 Nov 2020 16:24:10 +0000 (11:24 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Mar 2021 15:02:04 +0000 (11:02 -0400)
'*' is set on tracepoint creation.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Id20b5e3924a11a336fb08ac6ce10f08ad7fcd80a

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

index e24b0fbe103e986ba7551c094c38d604d606ca6e..5e83076d5db2091440c609bb7ee23a517119cff5 100644 (file)
@@ -19,6 +19,8 @@ extern "C" {
 /*
  * Create a newly allocated tracepoint 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 c8111a3725b5f236da76dab52117b3646a2cee71..93de1e98ce936c28ffe1dfb6a634595e51b8353b 100644 (file)
@@ -640,6 +640,7 @@ struct lttng_event_rule *lttng_event_rule_tracepoint_create(
 {
        struct lttng_event_rule *rule = NULL;
        struct lttng_event_rule_tracepoint *tp_rule;
+       enum lttng_event_rule_status status;
 
        if (domain_type == LTTNG_DOMAIN_NONE) {
                goto end;
@@ -673,6 +674,14 @@ struct lttng_event_rule *lttng_event_rule_tracepoint_create(
 
        lttng_dynamic_pointer_array_init(&tp_rule->exclusions,
                        destroy_lttng_exclusions_element);
+
+       /* Default pattern is '*'. */
+       status = lttng_event_rule_tracepoint_set_pattern(rule, "*");
+       if (status != LTTNG_EVENT_RULE_STATUS_OK) {
+               lttng_event_rule_destroy(rule);
+               rule = NULL;
+       }
+
 end:
        return rule;
 }
This page took 0.033813 seconds and 4 git commands to generate.