trigger: generate and add tracer token on registration
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-events.c
index b47a79528c329026870ed9afe4815b72da2be3fe..398ddc3896c39c7a94a67778a986057dceeae93c 100644 (file)
@@ -2232,9 +2232,14 @@ int handle_notification_thread_command_register_trigger(
        uid_t object_uid;
        gid_t object_gid;
        enum action_executor_status executor_status;
        uid_t object_uid;
        gid_t object_gid;
        enum action_executor_status executor_status;
+       const uint64_t trigger_tracer_token =
+                       state->trigger_id.next_tracer_token++;
 
        rcu_read_lock();
 
 
        rcu_read_lock();
 
+       /* Set the trigger's tracer token. */
+       lttng_trigger_set_tracer_token(trigger, trigger_tracer_token);
+
        if (lttng_trigger_get_name(trigger, &trigger_name) ==
                        LTTNG_TRIGGER_STATUS_UNSET) {
                const enum lttng_error_code ret_code = generate_trigger_name(
        if (lttng_trigger_get_name(trigger, &trigger_name) ==
                        LTTNG_TRIGGER_STATUS_UNSET) {
                const enum lttng_error_code ret_code = generate_trigger_name(
@@ -2473,6 +2478,8 @@ int handle_notification_thread_command_register_trigger(
 
 end:
        *cmd_result = LTTNG_OK;
 
 end:
        *cmd_result = LTTNG_OK;
+       DBG("Registered trigger: name = `%s`, tracer token = %" PRIu64,
+                       trigger_name, trigger_tracer_token);
 
 error_put_client_list:
        notification_client_list_put(client_list);
 
 error_put_client_list:
        notification_client_list_put(client_list);
This page took 0.03166 seconds and 4 git commands to generate.