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
* 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);
/*
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. */
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);
} 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();
}
/* 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'.",
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);
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;
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;
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;
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;
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;
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'",
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);
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.");