From: Jonathan Rajotte Date: Thu, 5 Nov 2020 16:24:10 +0000 (-0500) Subject: event-rule: tracepoint: set default pattern to '*' X-Git-Tag: v2.13.0-rc1~218 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cb6096aac522cc9b005eb704d40c6aac00e384ab;p=lttng-tools.git event-rule: tracepoint: set default pattern to '*' '*' is set on tracepoint creation. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Id20b5e3924a11a336fb08ac6ce10f08ad7fcd80a --- diff --git a/include/lttng/event-rule/tracepoint.h b/include/lttng/event-rule/tracepoint.h index e24b0fbe1..5e83076d5 100644 --- a/include/lttng/event-rule/tracepoint.h +++ b/include/lttng/event-rule/tracepoint.h @@ -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(). */ diff --git a/src/common/event-rule/tracepoint.c b/src/common/event-rule/tracepoint.c index c8111a372..93de1e98c 100644 --- a/src/common/event-rule/tracepoint.c +++ b/src/common/event-rule/tracepoint.c @@ -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; }