From: Jonathan Rajotte Date: Tue, 11 May 2021 23:02:45 +0000 (-0400) Subject: Rename lttng_event_rule_syscall_(set, get)_pattern to lttng_event_rule_syscall_(set... X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b2eeb0d5db1245d03f5bfc300a42ee3e9615237f;p=lttng-tools.git Rename lttng_event_rule_syscall_(set, get)_pattern to lttng_event_rule_syscall_(set, get)_name_pattern Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Ia6d8c55f607cd5af4201a61abaab277994618bb6 --- diff --git a/include/lttng/event-rule/syscall.h b/include/lttng/event-rule/syscall.h index 28766ecba..bb114778c 100644 --- a/include/lttng/event-rule/syscall.h +++ b/include/lttng/event-rule/syscall.h @@ -34,7 +34,7 @@ extern struct lttng_event_rule *lttng_event_rule_syscall_create(enum lttng_event_rule_syscall_emission_site_type emission_site_type); /* - * Set the pattern of a syscall event rule. + * Set the name pattern of a syscall event rule. * * Pattern can contain wildcard '*'. See man lttng-enable-event. * @@ -43,11 +43,11 @@ extern struct lttng_event_rule *lttng_event_rule_syscall_create(enum * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID * if invalid parameters are passed. */ -extern enum lttng_event_rule_status lttng_event_rule_syscall_set_pattern( +extern enum lttng_event_rule_status lttng_event_rule_syscall_set_name_pattern( struct lttng_event_rule *rule, const char *pattern); /* - * Get the pattern of a syscall event rule. + * Get the name pattern of a syscall event rule. * * The caller does not assume the ownership of the returned pattern. The * pattern shall only only be used for the duration of the event rule's @@ -58,7 +58,7 @@ extern enum lttng_event_rule_status lttng_event_rule_syscall_set_pattern( * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern * was not set prior to this call. */ -extern enum lttng_event_rule_status lttng_event_rule_syscall_get_pattern( +extern enum lttng_event_rule_status lttng_event_rule_syscall_get_name_pattern( const struct lttng_event_rule *rule, const char **pattern); /* diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 816cb9507..e92b76c5d 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -674,7 +674,7 @@ enum lttng_error_code trace_kernel_init_event_notifier_from_event_rule( case LTTNG_EVENT_RULE_TYPE_SYSCALL: { const enum lttng_event_rule_status status = - lttng_event_rule_syscall_get_pattern( + lttng_event_rule_syscall_get_name_pattern( rule, &name); const enum lttng_event_rule_syscall_emission_site_type emission_site_type = diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index eb1f40215..2c9462f93 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -1148,7 +1148,7 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv) goto error; } - event_rule_status = lttng_event_rule_syscall_set_pattern( + event_rule_status = lttng_event_rule_syscall_set_name_pattern( res.er, name); if (event_rule_status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to set syscall event rule's pattern to '%s'.", diff --git a/src/bin/lttng/commands/list_triggers.c b/src/bin/lttng/commands/list_triggers.c index b511c4dcc..6f5828ff1 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -396,7 +396,7 @@ void print_event_rule_syscall(const struct lttng_event_rule *event_rule) emission_site_type = lttng_event_rule_syscall_get_emission_site_type(event_rule); - event_rule_status = lttng_event_rule_syscall_get_pattern( + event_rule_status = lttng_event_rule_syscall_get_name_pattern( event_rule, &pattern); assert(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK); diff --git a/src/common/event-rule/syscall.c b/src/common/event-rule/syscall.c index 12aeacfcf..88cfde6b6 100644 --- a/src/common/event-rule/syscall.c +++ b/src/common/event-rule/syscall.c @@ -289,7 +289,7 @@ struct lttng_event_rule *lttng_event_rule_syscall_create( syscall_rule->parent.hash = lttng_event_rule_syscall_hash; /* Default pattern is '*'. */ - status = lttng_event_rule_syscall_set_pattern(rule, "*"); + status = lttng_event_rule_syscall_set_name_pattern(rule, "*"); if (status != LTTNG_EVENT_RULE_STATUS_OK) { lttng_event_rule_destroy(rule); rule = NULL; @@ -387,7 +387,7 @@ ssize_t lttng_event_rule_syscall_create_from_payload( skip_filter_expression: - status = lttng_event_rule_syscall_set_pattern(rule, pattern); + status = lttng_event_rule_syscall_set_name_pattern(rule, pattern); if (status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to set event rule syscall pattern"); ret = -1; @@ -412,7 +412,7 @@ end: return ret; } -enum lttng_event_rule_status lttng_event_rule_syscall_set_pattern( +enum lttng_event_rule_status lttng_event_rule_syscall_set_name_pattern( struct lttng_event_rule *rule, const char *pattern) { char *pattern_copy = NULL; @@ -442,7 +442,7 @@ end: return status; } -enum lttng_event_rule_status lttng_event_rule_syscall_get_pattern( +enum lttng_event_rule_status lttng_event_rule_syscall_get_name_pattern( const struct lttng_event_rule *rule, const char **pattern) { struct lttng_event_rule_syscall *syscall; diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index cdba957bf..9638bb452 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -2057,7 +2057,7 @@ static void test_syscall_event_rule_notification( event_rule = lttng_event_rule_syscall_create(LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY); ok(event_rule, "syscall event rule object creation"); - event_rule_status = lttng_event_rule_syscall_set_pattern( + event_rule_status = lttng_event_rule_syscall_set_name_pattern( event_rule, syscall_name); ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK, "Setting syscall event rule pattern: '%s'", syscall_name); @@ -2143,7 +2143,7 @@ static void test_syscall_event_rule_notification_filter( event_rule = lttng_event_rule_syscall_create(LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY); ok(event_rule, "syscall event rule object creation"); - event_rule_status = lttng_event_rule_syscall_set_pattern( + event_rule_status = lttng_event_rule_syscall_set_name_pattern( event_rule, syscall_name); ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK, "Setting syscall event rule pattern: '%s'", syscall_name); diff --git a/tests/unit/test_event_rule.c b/tests/unit/test_event_rule.c index 6d7328dbb..f30343b30 100644 --- a/tests/unit/test_event_rule.c +++ b/tests/unit/test_event_rule.c @@ -187,9 +187,9 @@ static void test_event_rule_syscall(void) syscall = lttng_event_rule_syscall_create(LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY); ok(syscall, "syscall object."); - status = lttng_event_rule_syscall_set_pattern(syscall, pattern); + status = lttng_event_rule_syscall_set_name_pattern(syscall, pattern); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "setting pattern."); - status = lttng_event_rule_syscall_get_pattern(syscall, &tmp); + status = lttng_event_rule_syscall_get_name_pattern(syscall, &tmp); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting pattern."); ok(!strncmp(pattern, tmp, strlen(pattern)), "pattern is equal.");