/*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
* Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* SPDX-License-Identifier: GPL-2.0-only
filter = NULL;
exclusion = NULL;
if (ret != LTTNG_OK) {
- goto error;
+ goto end;
}
/* Valid to set it after the goto error since uevent is still NULL */
if (ret < 0) {
if (ret == -LTTNG_UST_ERR_EXIST) {
ret = LTTNG_ERR_UST_EVENT_EXIST;
- goto end;
} else {
ret = LTTNG_ERR_UST_ENABLE_FAIL;
- goto error;
}
+ goto end;
}
DBG("Event UST %s %s in channel %s", uevent->attr.name,
free(filter);
free(exclusion);
return ret;
-
-error:
- /*
- * Only destroy event on creation time (not enabling time) because if the
- * event is found in the channel (to_create == 0), it means that at some
- * point the enable_event worked and it's thus valid to keep it alive.
- * Destroying it also implies that we also destroy it's shadow copy to sync
- * everyone up.
- */
- if (to_create) {
- /* In this code path, the uevent was not added to the hash table */
- trace_ust_destroy_event(uevent);
- }
- rcu_read_unlock();
- free(filter_expression);
- free(filter);
- free(exclusion);
- return ret;
}
/*
assert(event);
assert(agt);
+ rcu_read_lock();
aevent = agent_find_event(event->name, event->loglevel_type,
event->loglevel, filter_expression, agt);
if (!aevent) {
agent_destroy_event(aevent);
}
end:
+ rcu_read_unlock();
free(filter);
free(filter_expression);
return ret;
t_status = lttng_trigger_get_name(trigger, &trigger_name);
if (t_status != LTTNG_TRIGGER_STATUS_OK) {
- trigger_name = "(unnamed)";
+ trigger_name = "(anonymous)";
}
t_status = lttng_trigger_get_owner_uid(trigger, &trigger_owner_uid);
condition = lttng_trigger_get_const_condition(trigger);
assert(lttng_condition_get_type(condition) ==
- LTTNG_CONDITION_TYPE_ON_EVENT);
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- c_status = lttng_condition_on_event_get_rule(condition, &rule);
+ c_status = lttng_condition_event_rule_matches_get_rule(
+ condition, &rule);
assert(c_status == LTTNG_CONDITION_STATUS_OK);
- assert(lttng_event_rule_get_type(rule) ==
- LTTNG_EVENT_RULE_TYPE_TRACEPOINT);
+ switch (lttng_event_rule_get_type(rule)) {
+ case LTTNG_EVENT_RULE_TYPE_JUL_LOGGING:
+ case LTTNG_EVENT_RULE_TYPE_LOG4J_LOGGING:
+ case LTTNG_EVENT_RULE_TYPE_PYTHON_LOGGING:
+ break;
+ default:
+ abort();
+ break;
+ }
d_type = lttng_event_rule_get_domain_type(rule);
assert(d_type == agt->domain);