X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=750b4b32904511e37925e7e559bb92208f0c341c;hb=cd9c532cd057a13ca7e1fde757ae20d40d831a20;hp=3af7e394786c33c8a4eba27223165f148703ad20;hpb=db786d4499cdc45cb071ab96c5b63c7d8b3206c1;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 3af7e3947..750b4b329 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1271,6 +1271,8 @@ static struct ust_app_event_notifier_rule *alloc_ust_app_event_notifier_rule( assert(LTTNG_CONDITION_STATUS_OK == lttng_condition_on_event_get_rule(condition, &event_rule)); assert(event_rule); + ua_event_notifier_rule->error_counter_index = + lttng_condition_on_event_get_error_counter_index(condition); /* Acquire the event notifier's reference to the trigger. */ lttng_trigger_get(trigger); @@ -4065,13 +4067,29 @@ int ust_app_setup_event_notifier_group(struct ust_app *app) 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); @@ -5991,20 +6009,6 @@ void ust_app_global_update_all_event_notifier_rules(void) 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. */