X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=73773bd137726c4f09cbd4508338f8b391ad8583;hb=c0e2990d32d1e55c783c7eb3299f23a7ce062270;hp=e8fd3110e21c2cacb8fe8bd07c2cac5c26f6a9ee;hpb=7c1f6da21f4d46d9c834820a2b26f0634c7365a9;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index e8fd3110e..73773bd13 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4360,7 +4360,7 @@ enum lttng_error_code synchronize_tracer_notifier_register( goto end_unlock_session_list; } - agent_add(agt, trigger_agents_ht_by_domain); + agent_add(agt, the_trigger_agents_ht_by_domain); } ret_code = trigger_agent_enable(trigger, agt); @@ -4501,6 +4501,10 @@ enum lttng_error_code synchronize_tracer_notifier_unregister( switch (trigger_domain) { case LTTNG_DOMAIN_KERNEL: ret_code = kernel_unregister_event_notifier(trigger); + if (ret_code != LTTNG_OK) { + goto end_unlock_session_list; + } + break; case LTTNG_DOMAIN_UST: ust_app_global_update_all_event_notifier_rules(); @@ -4513,16 +4517,11 @@ enum lttng_error_code synchronize_tracer_notifier_unregister( struct agent *agt = agent_find_by_event_notifier_domain( trigger_domain); - if (!agt) { - agt = agent_create(trigger_domain); - if (!agt) { - ret_code = LTTNG_ERR_NOMEM; - goto end_unlock_session_list; - } - - agent_add(agt, trigger_agents_ht_by_domain); - } - + /* + * This trigger was never registered in the first place. Calling + * this function under those circumstances is an internal error. + */ + assert(agt); ret_code = trigger_agent_disable(trigger, agt); if (ret_code != LTTNG_OK) { goto end_unlock_session_list; @@ -5321,8 +5320,8 @@ int cmd_rotate_session(struct ltt_session *session, chunk_being_archived = NULL; if (!quiet_rotation) { ret = notification_thread_command_session_rotation_ongoing( - notification_thread_handle, - session->name, session->uid, session->gid, + the_notification_thread_handle, session->name, + session->uid, session->gid, ongoing_rotation_chunk_id); if (ret != LTTNG_OK) { ERR("Failed to notify notification thread that a session rotation is ongoing for session %s",