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.
*
* 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);
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 !=
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) {
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);
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;
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);
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);
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. */
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)) {
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) {
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);
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);
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);
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)
{
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;
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)
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;
}
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) {
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");
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);
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;
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);
}