Add UST namespace contexts
[lttng-tools.git] / src / bin / lttng-sessiond / sessiond-config.c
index d514aefc75e8ba85639cf0f80a3e9f5ec54b51fd..f1e3dea9dd27ee726e67a311f6f118a9981628f6 100644 (file)
@@ -15,6 +15,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include "version.h"
 #include "sessiond-config.h"
 #include <assert.h>
 #include "lttng-ust-ctl.h"
@@ -270,7 +271,7 @@ int sessiond_config_init(struct sessiond_config *config)
                ret = config_set_paths_non_root(config);
        }
        if (ret < 0) {
-               goto end;
+               goto error;
        }
 
        /* 32 bits consumerd path setup */
@@ -278,7 +279,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 32-bit consumer path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd32_path, str);
        str = NULL;
@@ -287,7 +288,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 32-bit consumer error socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd32_err_unix_sock_path, str);
        str = NULL;
@@ -296,7 +297,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 32-bit consumer command socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd32_cmd_unix_sock_path, str);
        str = NULL;
@@ -306,7 +307,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 64-bit consumer path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd64_path, str);
        str = NULL;
@@ -315,7 +316,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 64-bit consumer error socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd64_err_unix_sock_path, str);
        str = NULL;
@@ -324,7 +325,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set 64-bit consumer command socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->consumerd64_cmd_unix_sock_path, str);
        str = NULL;
@@ -334,7 +335,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set kernel consumer path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->kconsumerd_path, str);
        str = NULL;
@@ -343,7 +344,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set kernel consumer error socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->kconsumerd_err_unix_sock_path, str);
        str = NULL;
@@ -352,7 +353,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        config->rundir.value);
        if (ret < 0) {
                ERR("Failed to set kernel consumer command socket path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->kconsumerd_cmd_unix_sock_path, str);
        str = NULL;
@@ -361,7 +362,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        DEFAULT_LTTNG_SESSIOND_PIDFILE);
        if (ret < 0) {
                ERR("Failed to set PID file path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->pid_file_path, str);
        str = NULL;
@@ -370,7 +371,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        DEFAULT_LTTNG_SESSIOND_LOCKFILE);
        if (ret < 0) {
                ERR("Failed to set lock file path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->lock_file_path, str);
        str = NULL;
@@ -379,7 +380,7 @@ int sessiond_config_init(struct sessiond_config *config)
                        DEFAULT_LTTNG_SESSIOND_AGENTPORT_FILE);
        if (ret < 0) {
                ERR("Failed to set agent port file path");
-               goto end;
+               goto error;
        }
        config_string_set(&config->agent_port_file_path, str);
        str = NULL;
@@ -403,7 +404,9 @@ int sessiond_config_init(struct sessiond_config *config)
 #error "Unknown bitness"
 #endif
        ret = 0;
-end:
+       return ret;
+error:
+       sessiond_config_fini(config);
        return ret;
 }
 
@@ -413,6 +416,7 @@ void sessiond_config_fini(struct sessiond_config *config)
        config_string_fini(&config->tracing_group_name);
        config_string_fini(&config->kmod_probes_list);
        config_string_fini(&config->kmod_extra_probes_list);
+       config_string_fini(&config->rundir);
        config_string_fini(&config->apps_unix_sock_path);
        config_string_fini(&config->client_unix_sock_path);
        config_string_fini(&config->wait_shm_path);
@@ -494,6 +498,19 @@ LTTNG_HIDDEN
 void sessiond_config_log(struct sessiond_config *config)
 {
        DBG_NO_LOC("[sessiond configuration]");
+       DBG_NO_LOC("\tversion                        %s", VERSION);
+       if (GIT_VERSION[0] != '\0') {
+               DBG_NO_LOC("\tgit version                    %s", GIT_VERSION);
+       }
+       if (EXTRA_VERSION_NAME[0] != '\0') {
+               DBG_NO_LOC("\textra version name             %s", EXTRA_VERSION_NAME);
+       }
+       if (EXTRA_VERSION_DESCRIPTION[0] != '\0') {
+               DBG_NO_LOC("\textra version description:\n\t%s", EXTRA_VERSION_DESCRIPTION);
+       }
+       if (EXTRA_VERSION_PATCHES[0] != '\0') {
+               DBG_NO_LOC("\textra version patches:\n\t%s", EXTRA_VERSION_PATCHES);
+       }
        DBG_NO_LOC("\tverbose:                       %i", config->verbose);
        DBG_NO_LOC("\tverbose consumer:              %i", config->verbose_consumer);
        DBG_NO_LOC("\tquiet mode:                    %s", config->quiet ? "True" : "False");
This page took 0.026866 seconds and 4 git commands to generate.