Rename *exclusion* to *name_pattern_exclusion*
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 11 May 2021 22:58:05 +0000 (18:58 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 11 Jun 2021 20:51:57 +0000 (16:51 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ic72582dccdc2810dfc07fc66abf776c853d217b6

include/lttng/event-rule/tracepoint.h
src/bin/lttng/commands/add_trigger.c
src/bin/lttng/commands/list_triggers.c
src/common/event-rule/tracepoint.c
tests/regression/tools/notification/notification.c
tests/unit/test_condition.c
tests/unit/test_event_rule.c

index 728d87234fdc835dafb61f47bde51b5d771d83c8..f6e8d81823a1e49b80bd30a13c5994a5351d4625 100644 (file)
@@ -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);
index 88c8fa10783063273fbf4f49a0d4698322fe8777..eb1f40215aceba1adab815d8a22ade9604440064 100644 (file)
@@ -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 !=
index d33ed1fc4adc140a440ddb5b36cdf761b60ffb44..b511c4dccba19225f334ce358482a13a30bb5eb7 100644 (file)
@@ -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);
 
index 691ebdc117928b503ea9c000aa904cc928ee030c..58757bb24a4851cb9dd007b5fdcbce9a88ab9fea 100644 (file)
@@ -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;
        }
index 8ff11046edbd2618c6625e43d949a3b6ce6ed4c8..cdba957bfefd372a8837f304371861f53e5fe07b 100644 (file)
@@ -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) {
index af9dd7a86a9b59d0f371939693a5ee2f62ca3897..cc3659572f600907c40e01d5875db2435b77e1d2 100644 (file)
@@ -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");
index 5a3973e0942bcdb28aadb5287420970a52b5bf19..6d7328dbbe98f070b5a2ac4d36960c33af00f875 100644 (file)
@@ -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);
        }
 
This page took 0.033139 seconds and 4 git commands to generate.