From: Jonathan Rajotte Date: Thu, 5 Nov 2020 16:28:03 +0000 (-0500) Subject: event-rule: syscall: set the default pattern to '*' X-Git-Tag: v2.13.0-rc1~217 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=67d38b9374a83948f81ae1544e0fc707f0829303;p=lttng-tools.git event-rule: syscall: set the default pattern to '*' Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I8456f7f125b9341d31bc7bc2b8474abbc44b5467 --- diff --git a/include/lttng/event-rule/syscall.h b/include/lttng/event-rule/syscall.h index baf8432c1..c581b809c 100644 --- a/include/lttng/event-rule/syscall.h +++ b/include/lttng/event-rule/syscall.h @@ -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(). */ diff --git a/src/common/event-rule/syscall.c b/src/common/event-rule/syscall.c index b1b556aba..8103eaa61 100644 --- a/src/common/event-rule/syscall.c +++ b/src/common/event-rule/syscall.c @@ -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; }