common: Add index allocator for error counters
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 507937ca1259415915a0aa71849ea4645fcfa0ec..90a011fd9ad72a0f44efe2418d1706842e796dff 100644 (file)
@@ -4300,7 +4300,8 @@ enum lttng_error_code synchronize_tracer_notifier_register(
                struct lttng_trigger *trigger, const struct lttng_credentials *cmd_creds)
 {
        enum lttng_error_code ret_code;
-       struct lttng_condition *condition = lttng_trigger_get_condition(trigger);
+       const struct lttng_condition *condition =
+                       lttng_trigger_get_const_condition(trigger);
        const char *trigger_name;
        uid_t trigger_owner;
        enum lttng_trigger_status trigger_status;
@@ -4512,16 +4513,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;
This page took 0.03763 seconds and 4 git commands to generate.