Separate session info from channel info in notification thread
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread.c
index c47b36533e2bdef05ad3ba4c609b9382e10856ed..62d47ee54182cfc3da2a27d3dbf4ba37638a67f4 100644 (file)
@@ -96,7 +96,7 @@ struct notification_thread_handle *notification_thread_handle_create(
                goto end;
        }
 
                goto end;
        }
 
-       event_pipe = lttng_pipe_open(O_CLOEXEC);
+       event_pipe = lttng_pipe_open(FD_CLOEXEC);
        if (!event_pipe) {
                ERR("event_pipe creation");
                goto error;
        if (!event_pipe) {
                ERR("event_pipe creation");
                goto error;
@@ -236,7 +236,7 @@ int notification_channel_socket_create(void)
 
        if (getuid() == 0) {
                ret = chown(sock_path, 0,
 
        if (getuid() == 0) {
                ret = chown(sock_path, 0,
-                               utils_get_group_id(tracing_group_name));
+                               utils_get_group_id(config.tracing_group_name.value));
                if (ret) {
                        ERR("Failed to set the notification channel socket's group");
                        ret = -1;
                if (ret) {
                        ERR("Failed to set the notification channel socket's group");
                        ret = -1;
@@ -350,11 +350,13 @@ void fini_thread_state(struct notification_thread_state *state)
                assert(!ret);
        }
        if (state->channels_ht) {
                assert(!ret);
        }
        if (state->channels_ht) {
-               ret = cds_lfht_destroy(state->channels_ht,
-                               NULL);
+               ret = cds_lfht_destroy(state->channels_ht, NULL);
+               assert(!ret);
+       }
+       if (state->sessions_ht) {
+               ret = cds_lfht_destroy(state->sessions_ht, NULL);
                assert(!ret);
        }
                assert(!ret);
        }
-
        if (state->notification_channel_socket >= 0) {
                notification_channel_socket_destroy(
                                state->notification_channel_socket);
        if (state->notification_channel_socket >= 0) {
                notification_channel_socket_destroy(
                                state->notification_channel_socket);
@@ -420,7 +422,11 @@ int init_thread_state(struct notification_thread_handle *handle,
        if (!state->channels_ht) {
                goto error;
        }
        if (!state->channels_ht) {
                goto error;
        }
-
+       state->sessions_ht = cds_lfht_new(DEFAULT_HT_SIZE,
+                       1, 0, CDS_LFHT_AUTO_RESIZE | CDS_LFHT_ACCOUNTING, NULL);
+       if (!state->sessions_ht) {
+               goto error;
+       }
        state->triggers_ht = cds_lfht_new(DEFAULT_HT_SIZE,
                        1, 0, CDS_LFHT_AUTO_RESIZE | CDS_LFHT_ACCOUNTING, NULL);
        if (!state->triggers_ht) {
        state->triggers_ht = cds_lfht_new(DEFAULT_HT_SIZE,
                        1, 0, CDS_LFHT_AUTO_RESIZE | CDS_LFHT_ACCOUNTING, NULL);
        if (!state->triggers_ht) {
This page took 0.025164 seconds and 5 git commands to generate.