#include <lttng/event-rule/event-rule-internal.h>
#include <lttng/event-rule/tracepoint.h>
#include <lttng/condition/condition.h>
-#include <lttng/condition/on-event-internal.h>
-#include <lttng/condition/on-event.h>
+#include <lttng/condition/event-rule-matches-internal.h>
+#include <lttng/condition/event-rule-matches.h>
#include <lttng/trigger/trigger-internal.h>
#include <common/sessiond-comm/sessiond-comm.h>
condition = lttng_trigger_get_condition(trigger);
assert(condition);
- assert(lttng_condition_get_type(condition) == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(lttng_condition_get_type(condition) ==
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- assert(LTTNG_CONDITION_STATUS_OK == lttng_condition_on_event_get_rule(condition, &event_rule));
+ assert(LTTNG_CONDITION_STATUS_OK ==
+ lttng_condition_event_rule_matches_get_rule(
+ condition, &event_rule));
assert(event_rule);
+ ua_event_notifier_rule->error_counter_index =
+ lttng_condition_event_rule_matches_get_error_counter_index(condition);
/* Acquire the event notifier's reference to the trigger. */
lttng_trigger_get(trigger);
condition = lttng_trigger_get_const_condition(
ua_event_notifier_rule->trigger);
assert(condition);
- assert(lttng_condition_get_type(condition) == LTTNG_CONDITION_TYPE_ON_EVENT);
+ assert(lttng_condition_get_type(condition) ==
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES);
- condition_status = lttng_condition_on_event_get_rule(
+ condition_status = lttng_condition_event_rule_matches_get_rule(
condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
}
/* Set the capture bytecodes. */
- cond_status = lttng_condition_on_event_get_capture_descriptor_count(
+ cond_status = lttng_condition_event_rule_matches_get_capture_descriptor_count(
condition, &capture_bytecode_count);
assert(cond_status == LTTNG_CONDITION_STATUS_OK);
for (i = 0; i < capture_bytecode_count; i++) {
const struct lttng_bytecode *capture_bytecode =
- lttng_condition_on_event_get_capture_bytecode_at_index(
+ lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
condition, i);
ret = set_ust_capture(app, capture_bytecode, i,
event_notifier_error_accounting_status = event_notifier_error_accounting_register_app(app);
if (event_notifier_error_accounting_status != EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK) {
+ if (event_notifier_error_accounting_status == EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_APP_DEAD) {
+ DBG3("Failed to setup event notifier error accounting (application is dead): app socket fd = %d",
+ app->sock);
+ ret = 0;
+ goto error_accounting;
+ }
+
ERR("Failed to setup event notifier error accounting for app");
ret = -1;
- goto error;
+ goto error_accounting;
}
return ret;
+error_accounting:
+ lttng_ret = notification_thread_command_remove_tracer_event_source(
+ the_notification_thread_handle,
+ lttng_pipe_get_readfd(
+ app->event_notifier_group.event_pipe));
+ if (lttng_ret != LTTNG_OK) {
+ ERR("Failed to remove application tracer event source from notification thread");
+ }
+
error:
ustctl_release_object(app->sock, app->event_notifier_group.object);
free(app->event_notifier_group.object);
token = lttng_trigger_get_tracer_token(trigger);
condition = lttng_trigger_get_condition(trigger);
- if (lttng_condition_get_type(condition) != LTTNG_CONDITION_TYPE_ON_EVENT) {
+ if (lttng_condition_get_type(condition) !=
+ LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES) {
/* Does not apply */
continue;
}
- condition_status = lttng_condition_on_event_borrow_rule_mutable(condition, &event_rule);
+ condition_status =
+ lttng_condition_event_rule_matches_borrow_rule_mutable(
+ condition, &event_rule);
assert(condition_status == LTTNG_CONDITION_STATUS_OK);
if (lttng_event_rule_get_domain_type(event_rule) == LTTNG_DOMAIN_KERNEL) {
rcu_read_unlock();
}
-void ust_app_update_event_notifier_error_count(struct lttng_trigger *trigger)
-{
- uint64_t error_count = 0;
- enum event_notifier_error_accounting_status status;
- struct lttng_condition *condition = lttng_trigger_get_condition(trigger);
-
- status = event_notifier_error_accounting_get_count(trigger, &error_count);
- if (status != EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK) {
- ERR("Error getting trigger error count.");
- }
-
- lttng_condition_on_event_set_error_count(condition, error_count);
-}
-
/*
* Add context to a specific channel for global UST domain.
*/