Fix errors due to lttng.h cleanup
[lttng-tools.git] / ltt-sessiond / main.c
index 1c9c0dd4771af49ea039f5183f46b9dd9f6f1d4b..4b2fb52c2dd256e5a68809af7107d1dc78631c29 100644 (file)
@@ -55,7 +55,7 @@
 
 /* Const values */
 const char default_home_dir[] = DEFAULT_HOME_DIR;
-const char default_tracing_group[] = DEFAULT_TRACING_GROUP;
+const char default_tracing_group[] = LTTNG_DEFAULT_TRACING_GROUP;
 const char default_ust_sock_dir[] = DEFAULT_UST_SOCK_DIR;
 const char default_global_apps_pipe[] = DEFAULT_GLOBAL_APPS_PIPE;
 
@@ -90,50 +90,6 @@ static sem_t kconsumerd_sem;
 
 static pthread_mutex_t kconsumerd_pid_mutex;   /* Mutex to control kconsumerd pid assignation */
 
-/*
- *  free_kernel_session
- *
- *  Free all data structure inside a kernel session and the session pointer.
- */
-static void free_kernel_session(struct ltt_kernel_session *session)
-{
-       struct ltt_kernel_channel *chan;
-       struct ltt_kernel_stream *stream;
-       struct ltt_kernel_event *event;
-
-       /* Clean metadata */
-       close(session->metadata_stream_fd);
-       close(session->metadata->fd);
-       free(session->metadata->conf);
-       free(session->metadata);
-
-       cds_list_for_each_entry(chan, &session->channel_list.head, list) {
-               /* Clean all event(s) */
-               cds_list_for_each_entry(event, &chan->events_list.head, list) {
-                       close(event->fd);
-                       free(event->event);
-                       free(event);
-               }
-
-               /* Clean streams */
-               cds_list_for_each_entry(stream, &chan->stream_list.head, list) {
-                       close(stream->fd);
-                       free(stream->pathname);
-                       free(stream);
-               }
-               /* Clean channel */
-               close(chan->fd);
-               free(chan->channel);
-               free(chan->pathname);
-               free(chan);
-       }
-
-       close(session->fd);
-       free(session);
-
-       DBG("All kernel session data structures freed");
-}
-
 /*
  *  teardown_kernel_session
  *
@@ -144,7 +100,7 @@ static void teardown_kernel_session(struct ltt_session *session)
 {
        if (session->kernel_session != NULL) {
                DBG("Tearing down kernel session");
-               free_kernel_session(session->kernel_session);
+               trace_destroy_kernel_session(session->kernel_session);
                /* Extra precaution */
                session->kernel_session = NULL;
                /* Decrement session count */
@@ -666,6 +622,7 @@ static int create_trace_dir(struct ltt_kernel_session *session)
 
        /* Create all channel directories */
        cds_list_for_each_entry(chan, &session->channel_list.head, list) {
+               DBG("Creating trace directory at %s", chan->pathname);
                ret = mkdir(chan->pathname, S_IRWXU | S_IRWXG );
                if (ret < 0) {
                        perror("mkdir trace path");
@@ -680,7 +637,6 @@ error:
        return ret;
 }
 
-
 /*
  *     process_client_msg
  *
This page took 0.024761 seconds and 4 git commands to generate.