From: Jonathan Rajotte Date: Tue, 11 May 2021 22:58:05 +0000 (-0400) Subject: Rename *exclusion* to *name_pattern_exclusion* X-Git-Tag: v2.13.0-rc3~82 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=001590c66aa9fee93903951c5f6dff4fd7110238;p=lttng-tools.git Rename *exclusion* to *name_pattern_exclusion* Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Ic72582dccdc2810dfc07fc66abf776c853d217b6 --- diff --git a/include/lttng/event-rule/tracepoint.h b/include/lttng/event-rule/tracepoint.h index 728d87234..f6e8d8182 100644 --- a/include/lttng/event-rule/tracepoint.h +++ b/include/lttng/event-rule/tracepoint.h @@ -122,7 +122,7 @@ lttng_event_rule_tracepoint_get_log_level_rule( const struct lttng_log_level_rule **log_level_rule); /* - * Add an exclusion to the set of exclusion of an event rule. + * Add a name pattern exclusion to the set of name pattern exclusion of an event rule. * * The passed exclusion will be copied to the event_rule. * @@ -131,30 +131,30 @@ lttng_event_rule_tracepoint_get_log_level_rule( * LTTNG_EVENT_RULE_STATUS_UNSUPPORTED if this property is not supported by the * domain. */ -extern enum lttng_event_rule_status lttng_event_rule_tracepoint_add_exclusion( +extern enum lttng_event_rule_status lttng_event_rule_tracepoint_add_name_pattern_exclusion( struct lttng_event_rule *rule, const char *exclusion); /* - * Get the exclusions property count of an event rule. + * Get the name pattern exclusions property count of an event rule. * * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the count output parameter * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is * passed. */ extern enum lttng_event_rule_status -lttng_event_rule_tracepoint_get_exclusions_count( +lttng_event_rule_tracepoint_get_name_pattern_exclusion_count( const struct lttng_event_rule *rule, unsigned int *count); /* - * Get the event rule exclusion at the given index. + * Get the pattern name exclusion at the given index. * * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the exclusion output parameter * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is * passed. */ extern enum lttng_event_rule_status -lttng_event_rule_tracepoint_get_exclusion_at_index( +lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( const struct lttng_event_rule *rule, unsigned int index, const char **exclusion); diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index 88c8fa107..eb1f40215 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -1022,7 +1022,7 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv) n); event_rule_status = - lttng_event_rule_tracepoint_add_exclusion( + lttng_event_rule_tracepoint_add_name_pattern_exclusion( res.er, exclude_name); if (event_rule_status != diff --git a/src/bin/lttng/commands/list_triggers.c b/src/bin/lttng/commands/list_triggers.c index d33ed1fc4..b511c4dcc 100644 --- a/src/bin/lttng/commands/list_triggers.c +++ b/src/bin/lttng/commands/list_triggers.c @@ -214,7 +214,7 @@ void print_event_rule_tracepoint(const struct lttng_event_rule *event_rule) assert(event_rule_status == LTTNG_EVENT_RULE_STATUS_UNSET); } - event_rule_status = lttng_event_rule_tracepoint_get_exclusions_count( + event_rule_status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count( event_rule, &exclusions_count); assert(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK); if (exclusions_count > 0) { @@ -222,7 +222,7 @@ void print_event_rule_tracepoint(const struct lttng_event_rule *event_rule) for (i = 0; i < exclusions_count; i++) { const char *exclusion; - event_rule_status = lttng_event_rule_tracepoint_get_exclusion_at_index( + event_rule_status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( event_rule, i, &exclusion); 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 691ebdc11..58757bb24 100644 --- a/src/common/event-rule/tracepoint.c +++ b/src/common/event-rule/tracepoint.c @@ -98,7 +98,7 @@ static int lttng_event_rule_tracepoint_serialize( tracepoint = container_of( rule, struct lttng_event_rule_tracepoint, parent); - status = lttng_event_rule_tracepoint_get_exclusions_count(rule, &exclusion_count); + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(rule, &exclusion_count); assert(status == LTTNG_EVENT_RULE_STATUS_OK); pattern_len = strlen(tracepoint->pattern) + 1; @@ -114,7 +114,7 @@ static int lttng_event_rule_tracepoint_serialize( for (i = 0; i < exclusion_count; i++) { const char *exclusion; - status = lttng_event_rule_tracepoint_get_exclusion_at_index( + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( rule, i, &exclusion); assert(status == LTTNG_EVENT_RULE_STATUS_OK); @@ -163,7 +163,7 @@ static int lttng_event_rule_tracepoint_serialize( size_t len; const char *exclusion; - status = lttng_event_rule_tracepoint_get_exclusion_at_index( + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( rule, i, &exclusion); assert(status == LTTNG_EVENT_RULE_STATUS_OK); @@ -206,9 +206,9 @@ static bool lttng_event_rule_tracepoint_is_equal( a = container_of(_a, struct lttng_event_rule_tracepoint, parent); b = container_of(_b, struct lttng_event_rule_tracepoint, parent); - status = lttng_event_rule_tracepoint_get_exclusions_count(_a, &count_a); + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(_a, &count_a); assert(status == LTTNG_EVENT_RULE_STATUS_OK); - status = lttng_event_rule_tracepoint_get_exclusions_count(_b, &count_b); + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(_b, &count_b); assert(status == LTTNG_EVENT_RULE_STATUS_OK); /* Quick checks. */ @@ -248,10 +248,10 @@ static bool lttng_event_rule_tracepoint_is_equal( for (i = 0; i < count_a; i++) { const char *exclusion_a, *exclusion_b; - status = lttng_event_rule_tracepoint_get_exclusion_at_index( + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( _a, i, &exclusion_a); assert(status == LTTNG_EVENT_RULE_STATUS_OK); - status = lttng_event_rule_tracepoint_get_exclusion_at_index( + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( _b, i, &exclusion_b); assert(status == LTTNG_EVENT_RULE_STATUS_OK); if (strcmp(exclusion_a, exclusion_b)) { @@ -526,7 +526,7 @@ lttng_event_rule_tracepoint_generate_exclusions( abort(); } - event_rule_status = lttng_event_rule_tracepoint_get_exclusions_count( + event_rule_status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count( rule, &nb_exclusions); assert(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK); if (nb_exclusions == 0) { @@ -550,7 +550,7 @@ lttng_event_rule_tracepoint_generate_exclusions( const char *exclusion_str; event_rule_status = - lttng_event_rule_tracepoint_get_exclusion_at_index( + lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( rule, i, &exclusion_str); assert(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK); @@ -598,14 +598,14 @@ static unsigned long lttng_event_rule_tracepoint_hash( hash ^= lttng_log_level_rule_hash(tp_rule->log_level_rule); } - status = lttng_event_rule_tracepoint_get_exclusions_count(rule, + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(rule, &exclusion_count); assert(status == LTTNG_EVENT_RULE_STATUS_OK); for (i = 0; i < exclusion_count; i++) { const char *exclusion; - status = lttng_event_rule_tracepoint_get_exclusion_at_index( + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( rule, i, &exclusion); assert(status == LTTNG_EVENT_RULE_STATUS_OK); hash ^= hash_key_str(exclusion, lttng_ht_seed); @@ -883,7 +883,7 @@ skip_log_level_rule: goto end; } - status = lttng_event_rule_tracepoint_add_exclusion(rule, exclusion); + status = lttng_event_rule_tracepoint_add_name_pattern_exclusion(rule, exclusion); if (status != LTTNG_EVENT_RULE_STATUS_OK) { ERR("Failed to add event rule tracepoint exclusion \"%s\".", exclusion); @@ -1209,7 +1209,7 @@ end: return status; } -enum lttng_event_rule_status lttng_event_rule_tracepoint_add_exclusion( +enum lttng_event_rule_status lttng_event_rule_tracepoint_add_name_pattern_exclusion( struct lttng_event_rule *rule, const char *exclusion) { @@ -1272,7 +1272,7 @@ end: return status; } -enum lttng_event_rule_status lttng_event_rule_tracepoint_get_exclusions_count( +enum lttng_event_rule_status lttng_event_rule_tracepoint_get_name_pattern_exclusion_count( const struct lttng_event_rule *rule, unsigned int *count) { struct lttng_event_rule_tracepoint *tracepoint; @@ -1290,7 +1290,7 @@ end: return status; } -enum lttng_event_rule_status lttng_event_rule_tracepoint_get_exclusion_at_index( +enum lttng_event_rule_status lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index( const struct lttng_event_rule *rule, unsigned int index, const char **exclusion) @@ -1306,7 +1306,7 @@ enum lttng_event_rule_status lttng_event_rule_tracepoint_get_exclusion_at_index( tracepoint = container_of( rule, struct lttng_event_rule_tracepoint, parent); - if (lttng_event_rule_tracepoint_get_exclusions_count(rule, &count) != + if (lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(rule, &count) != LTTNG_EVENT_RULE_STATUS_OK) { goto end; } diff --git a/tests/regression/tools/notification/notification.c b/tests/regression/tools/notification/notification.c index 8ff11046e..cdba957bf 100644 --- a/tests/regression/tools/notification/notification.c +++ b/tests/regression/tools/notification/notification.c @@ -1492,7 +1492,7 @@ static void create_tracepoint_event_rule_trigger(const char *event_pattern, for (i = 0; i < exclusion_count; i++) { event_rule_status = - lttng_event_rule_tracepoint_add_exclusion( + lttng_event_rule_tracepoint_add_name_pattern_exclusion( event_rule, exclusions[i]); if (event_rule_status != LTTNG_EVENT_RULE_STATUS_OK) { diff --git a/tests/unit/test_condition.c b/tests/unit/test_condition.c index af9dd7a86..cc3659572 100644 --- a/tests/unit/test_condition.c +++ b/tests/unit/test_condition.c @@ -72,7 +72,7 @@ void test_condition_event_rule(void) ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting log level range"); for (i = 0; i < 3; i++) { - status = lttng_event_rule_tracepoint_add_exclusion( + status = lttng_event_rule_tracepoint_add_name_pattern_exclusion( tracepoint, exclusions[i]); ok(status == LTTNG_EVENT_RULE_STATUS_OK, "Setting exclusion pattern"); diff --git a/tests/unit/test_event_rule.c b/tests/unit/test_event_rule.c index 5a3973e09..6d7328dbb 100644 --- a/tests/unit/test_event_rule.c +++ b/tests/unit/test_event_rule.c @@ -42,7 +42,7 @@ int lttng_opt_mi; struct tracepoint_test { enum lttng_domain_type type; - bool support_exclusion; + bool support_name_pattern_exclusion; }; typedef const char *(*log_level_name_getter)(int log_level); @@ -58,7 +58,7 @@ void test_event_rule_tracepoint_by_domain(const struct tracepoint_test *test) const char *pattern="my_event_*"; const char *filter="msg_id == 23 && size >= 2048"; const char *tmp; - const char *exclusions[] = {"my_event_test1", "my_event_test2" ,"my_event_test3"}; + const char *name_pattern_exclusions[] = {"my_event_test1", "my_event_test2" ,"my_event_test3"}; struct lttng_log_level_rule *log_level_rule = NULL; const struct lttng_log_level_rule *log_level_rule_return = NULL; struct lttng_payload payload; @@ -100,33 +100,33 @@ void test_event_rule_tracepoint_by_domain(const struct tracepoint_test *test) ok(status == LTTNG_EVENT_RULE_STATUS_OK, "get log level rule."); } - if (test->support_exclusion) { + if (test->support_name_pattern_exclusion) { int i; for (i = 0; i < 3; i++) { - status = lttng_event_rule_tracepoint_add_exclusion(tracepoint, exclusions[i]); - ok(status == LTTNG_EVENT_RULE_STATUS_OK, "setting exclusions \"%s\"", exclusions[i]); + status = lttng_event_rule_tracepoint_add_name_pattern_exclusion(tracepoint, name_pattern_exclusions[i]); + ok(status == LTTNG_EVENT_RULE_STATUS_OK, "setting name pattern exclusions \"%s\"", name_pattern_exclusions[i]); } - status = lttng_event_rule_tracepoint_get_exclusions_count(tracepoint, &count); - ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting exclusion count."); + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(tracepoint, &count); + ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting name pattern exclusion count."); ok(count == 3, "count is %d/3", count); for (i = 0; i < count; i++) { - status = lttng_event_rule_tracepoint_get_exclusion_at_index(tracepoint, i, &tmp); - ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting exclusion at index %d.", i); - ok(!strncmp(exclusions[i], tmp, strlen(exclusions[i])), "%s == %s.", tmp, exclusions[i]); + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index(tracepoint, i, &tmp); + ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting name pattern exclusion at index %d.", i); + ok(!strncmp(name_pattern_exclusions[i], tmp, strlen(name_pattern_exclusions[i])), "%s == %s.", tmp, name_pattern_exclusions[i]); } } else { int i; for (i = 0; i < 3; i++) { - status = lttng_event_rule_tracepoint_add_exclusion(tracepoint, exclusions[i]); - ok(status == LTTNG_EVENT_RULE_STATUS_UNSUPPORTED, "setting exclusions unsupported \"%s\".", exclusions[i]); + status = lttng_event_rule_tracepoint_add_name_pattern_exclusion(tracepoint, name_pattern_exclusions[i]); + ok(status == LTTNG_EVENT_RULE_STATUS_UNSUPPORTED, "setting name pattern exclusions unsupported \"%s\".", name_pattern_exclusions[i]); } - status = lttng_event_rule_tracepoint_get_exclusions_count(tracepoint, &count); - ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting exclusion count."); + status = lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(tracepoint, &count); + ok(status == LTTNG_EVENT_RULE_STATUS_OK, "getting name pattern exclusion count."); ok(count == 0, "count is %d/0", count); }