From: Jonathan Rajotte Date: Tue, 11 May 2021 22:47:31 +0000 (-0400) Subject: Rename lttng_event_rule_tracepoint_(set,get)_pattern to lttng_event_rule_tracepoint_... X-Git-Tag: v2.13.0-rc3~83 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6296f20cf714d4f575be5bd75c3d489893809f65;p=lttng-tools.git Rename lttng_event_rule_tracepoint_(set,get)_pattern to lttng_event_rule_tracepoint_(set, get)_name_pattern Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Ib018d7ab4fab66842302beef19c0971d704d2d02 --- diff --git a/include/lttng/event-rule/tracepoint.h b/include/lttng/event-rule/tracepoint.h index d86b53fed..728d87234 100644 --- a/include/lttng/event-rule/tracepoint.h +++ b/include/lttng/event-rule/tracepoint.h @@ -29,18 +29,18 @@ extern struct lttng_event_rule *lttng_event_rule_tracepoint_create( enum lttng_domain_type domain); /* - * Set the pattern of a tracepoint event rule. + * Set the name pattern of a tracepoint event rule. * * Pattern can contain wildcard '*'. See man lttng-enable-event. * * Return 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_tracepoint_set_pattern( +extern enum lttng_event_rule_status lttng_event_rule_tracepoint_set_name_pattern( struct lttng_event_rule *rule, const char *pattern); /* - * Get the pattern of a tracepoint event rule. + * Get the name pattern of a tracepoint 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 @@ -51,7 +51,7 @@ extern enum lttng_event_rule_status lttng_event_rule_tracepoint_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_tracepoint_get_pattern( +extern enum lttng_event_rule_status lttng_event_rule_tracepoint_get_name_pattern( const struct lttng_event_rule *rule, const char **pattern); /* diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c index d5184a442..8250b8c9e 100644 --- a/src/bin/lttng-sessiond/agent.c +++ b/src/bin/lttng-sessiond/agent.c @@ -1269,8 +1269,8 @@ struct agent_event *agent_find_event_by_trigger( assert(domain == LTTNG_DOMAIN_JUL || domain == LTTNG_DOMAIN_LOG4J || domain == LTTNG_DOMAIN_PYTHON); - /* Get the event's pattern ('name' in the legacy terminology). */ - er_status = lttng_event_rule_tracepoint_get_pattern(rule, &name); + /* Get the event's pattern name ('name' in the legacy terminology). */ + er_status = lttng_event_rule_tracepoint_get_name_pattern(rule, &name); assert(er_status == LTTNG_EVENT_RULE_STATUS_OK); /* Get the internal filter expression. */ diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 3a32893a1..816cb9507 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -660,7 +660,7 @@ enum lttng_error_code trace_kernel_init_event_notifier_from_event_rule( const enum lttng_domain_type domain = lttng_event_rule_get_domain_type(rule); const enum lttng_event_rule_status status = - lttng_event_rule_tracepoint_get_pattern( + lttng_event_rule_tracepoint_get_name_pattern( rule, &name); assert(domain == LTTNG_DOMAIN_KERNEL); diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index c00dd2877..f1beaef53 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2042,7 +2042,7 @@ static int init_ust_event_notifier_from_event_rule( } else { const struct lttng_log_level_rule *log_level_rule; - status = lttng_event_rule_tracepoint_get_pattern(rule, &pattern); + status = lttng_event_rule_tracepoint_get_name_pattern(rule, &pattern); if (status != LTTNG_EVENT_RULE_STATUS_OK) { /* At this point, this is a fatal error. */ abort(); diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index ac0868910..88c8fa107 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -990,7 +990,7 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv) } /* Set pattern. */ - event_rule_status = lttng_event_rule_tracepoint_set_pattern( + event_rule_status = lttng_event_rule_tracepoint_set_name_pattern( res.er, name); if (event_rule_status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to set tracepoint 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 a58ef2837..d33ed1fc4 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -159,7 +159,7 @@ void print_event_rule_tracepoint(const struct lttng_event_rule *event_rule) unsigned int exclusions_count; int i; - event_rule_status = lttng_event_rule_tracepoint_get_pattern( + event_rule_status = lttng_event_rule_tracepoint_get_name_pattern( event_rule, &pattern); assert(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK); diff --git a/src/common/event-rule/tracepoint.c b/src/common/event-rule/tracepoint.c index 65e2c16a7..691ebdc11 100644 --- a/src/common/event-rule/tracepoint.c +++ b/src/common/event-rule/tracepoint.c @@ -285,7 +285,7 @@ static int generate_agent_filter( assert(rule); assert(_agent_filter); - status = lttng_event_rule_tracepoint_get_pattern(rule, &pattern); + status = lttng_event_rule_tracepoint_get_name_pattern(rule, &pattern); if (status != LTTNG_EVENT_RULE_STATUS_OK) { ret = -1; goto end; @@ -727,7 +727,7 @@ struct lttng_event_rule *lttng_event_rule_tracepoint_create( destroy_lttng_exclusions_element); /* Default pattern is '*'. */ - status = lttng_event_rule_tracepoint_set_pattern(rule, "*"); + status = lttng_event_rule_tracepoint_set_name_pattern(rule, "*"); if (status != LTTNG_EVENT_RULE_STATUS_OK) { lttng_event_rule_destroy(rule); rule = NULL; @@ -895,7 +895,7 @@ skip_log_level_rule: offset += *exclusion_len; } - status = lttng_event_rule_tracepoint_set_pattern(rule, pattern); + status = lttng_event_rule_tracepoint_set_name_pattern(rule, pattern); if (status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to set event rule tracepoint pattern."); ret = -1; @@ -932,7 +932,7 @@ end: return ret; } -enum lttng_event_rule_status lttng_event_rule_tracepoint_set_pattern( +enum lttng_event_rule_status lttng_event_rule_tracepoint_set_name_pattern( struct lttng_event_rule *rule, const char *pattern) { char *pattern_copy = NULL; @@ -964,7 +964,7 @@ end: return status; } -enum lttng_event_rule_status lttng_event_rule_tracepoint_get_pattern( +enum lttng_event_rule_status lttng_event_rule_tracepoint_get_name_pattern( const struct lttng_event_rule *rule, const char **pattern) { struct lttng_event_rule_tracepoint *tracepoint; diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index bdea55921..8ff11046e 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -1469,7 +1469,7 @@ static void create_tracepoint_event_rule_trigger(const char *event_pattern, event_rule = lttng_event_rule_tracepoint_create(domain_type); ok(event_rule, "Tracepoint event rule object creation"); - event_rule_status = lttng_event_rule_tracepoint_set_pattern( + event_rule_status = lttng_event_rule_tracepoint_set_name_pattern( event_rule, event_pattern); ok(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK, "Setting tracepoint event rule pattern: '%s'", diff --git a/tests/unit/test_condition.c b/tests/unit/test_condition.c index e94bd084f..af9dd7a86 100644 --- a/tests/unit/test_condition.c +++ b/tests/unit/test_condition.c @@ -61,7 +61,7 @@ void test_condition_event_rule(void) tracepoint = lttng_event_rule_tracepoint_create(LTTNG_DOMAIN_UST); ok(tracepoint, "tracepoint UST_DOMAIN"); - status = lttng_event_rule_tracepoint_set_pattern(tracepoint, pattern); + status = lttng_event_rule_tracepoint_set_name_pattern(tracepoint, pattern); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting pattern"); status = lttng_event_rule_tracepoint_set_filter(tracepoint, filter); diff --git a/tests/unit/test_event_rule.c b/tests/unit/test_event_rule.c index 59e37e966..5a3973e09 100644 --- a/tests/unit/test_event_rule.c +++ b/tests/unit/test_event_rule.c @@ -78,9 +78,9 @@ void test_event_rule_tracepoint_by_domain(const struct tracepoint_test *test) ok(status == LTTNG_EVENT_RULE_STATUS_OK, "get tracepoint domain."); ok(domain_type == type, "domain type got %d expected %d.", domain_type, type); - status = lttng_event_rule_tracepoint_set_pattern(tracepoint, pattern); + status = lttng_event_rule_tracepoint_set_name_pattern(tracepoint, pattern); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "setting pattern."); - status = lttng_event_rule_tracepoint_get_pattern(tracepoint, &tmp); + status = lttng_event_rule_tracepoint_get_name_pattern(tracepoint, &tmp); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting pattern."); ok(!strncmp(pattern, tmp, strlen(pattern)), "pattern is equal.");