Move all default values to defaults.h
authorDavid Goulet <dgoulet@efficios.com>
Fri, 20 Jan 2012 21:57:25 +0000 (16:57 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 20 Jan 2012 21:57:25 +0000 (16:57 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-consumerd/lttng-consumerd.c
src/bin/lttng-consumerd/lttng-consumerd.h
src/bin/lttng-sessiond/lttng-sessiond.h
src/bin/lttng-sessiond/main.c
src/common/defaults.h

index ab83c6a75ab0a7360e9b7eaefa0519002bec1a19..a637a904244979b5f8b0a310e458684a03162d19 100644 (file)
@@ -253,16 +253,16 @@ int main(int argc, char **argv)
        if (strlen(command_sock_path) == 0) {
                switch (opt_type) {
                case LTTNG_CONSUMER_KERNEL:
-                       snprintf(command_sock_path, PATH_MAX, KCONSUMERD_CMD_SOCK_PATH,
+                       snprintf(command_sock_path, PATH_MAX, DEFAULT_KCONSUMERD_CMD_SOCK_PATH,
                                        DEFAULT_LTTNG_RUNDIR);
                        break;
                case LTTNG_CONSUMER64_UST:
                        snprintf(command_sock_path, PATH_MAX,
-                                       USTCONSUMERD64_CMD_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
+                                       DEFAULT_USTCONSUMERD64_CMD_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
                        break;
                case LTTNG_CONSUMER32_UST:
                        snprintf(command_sock_path, PATH_MAX,
-                                       USTCONSUMERD32_CMD_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
+                                       DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
                        break;
                default:
                        WARN("Unknown consumerd type");
@@ -284,16 +284,16 @@ int main(int argc, char **argv)
        if (strlen(error_sock_path) == 0) {
                switch (opt_type) {
                case LTTNG_CONSUMER_KERNEL:
-                       snprintf(error_sock_path, PATH_MAX, KCONSUMERD_ERR_SOCK_PATH,
+                       snprintf(error_sock_path, PATH_MAX, DEFAULT_KCONSUMERD_ERR_SOCK_PATH,
                                        DEFAULT_LTTNG_RUNDIR);
                        break;
                case LTTNG_CONSUMER64_UST:
                        snprintf(error_sock_path, PATH_MAX,
-                                       USTCONSUMERD64_ERR_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
+                                       DEFAULT_USTCONSUMERD64_ERR_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
                        break;
                case LTTNG_CONSUMER32_UST:
                        snprintf(error_sock_path, PATH_MAX,
-                                       USTCONSUMERD32_ERR_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
+                                       DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH, DEFAULT_LTTNG_RUNDIR);
                        break;
                default:
                        WARN("Unknown consumerd type");
index e42b2fea5b9eddc9ec2cd5300c5606b25999aeaa..872a3e9169dae546c35222951d94ce0ec051dfc4 100644 (file)
 #ifndef _LTTNG_CONSUMERD_H
 #define _LTTNG_CONSUMERD_H
 
-#define CONSUMERD_RUNDIR                    "%s"
-
-/* Kernel consumer path */
-#define KCONSUMERD_PATH                     CONSUMERD_RUNDIR "/kconsumerd"
-#define KCONSUMERD_CMD_SOCK_PATH            KCONSUMERD_PATH "/command"
-#define KCONSUMERD_ERR_SOCK_PATH            KCONSUMERD_PATH "/error"
-
-/* UST 64-bit consumer path */
-#define USTCONSUMERD64_PATH                 CONSUMERD_RUNDIR "/ustconsumerd64"
-#define USTCONSUMERD64_CMD_SOCK_PATH        USTCONSUMERD64_PATH "/command"
-#define USTCONSUMERD64_ERR_SOCK_PATH        USTCONSUMERD64_PATH "/error"
-
-/* UST 32-bit consumer path */
-#define USTCONSUMERD32_PATH                 CONSUMERD_RUNDIR "/ustconsumerd32"
-#define USTCONSUMERD32_CMD_SOCK_PATH        USTCONSUMERD32_PATH "/command"
-#define USTCONSUMERD32_ERR_SOCK_PATH        USTCONSUMERD32_PATH "/error"
-
 #endif /* _LTTNG_CONSUMERD_H */
index 6a7006c0b8b90c37151e32610e532e63edb52ab2..238f27a80c0601e57b443e4812db77d8d863a88d 100644 (file)
 #include "session.h"
 #include "ust-app.h"
 
-#define DEFAULT_HOME_DIR            "/tmp"
-#define DEFAULT_UST_SOCK_DIR        DEFAULT_HOME_DIR "/ust-app-socks"
-#define DEFAULT_GLOBAL_APPS_PIPE    DEFAULT_UST_SOCK_DIR "/global"
-#define DEFAULT_TRACE_OUTPUT        DEFAULT_HOME_DIR "/lttng"
-
-#define DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH   "/lttng-ust-apps-wait"
-#define DEFAULT_HOME_APPS_WAIT_SHM_PATH     "/lttng-ust-apps-wait-%u"
-
 struct module_param {
        const char *name;
        int required;
index d7ed4eb0b0a7fc0ec18b99d7fd73a1a8c8b1485e..77b10787598616d418ed6d8258fafcff24040c9e 100644 (file)
@@ -38,7 +38,6 @@
 #include <unistd.h>
 #include <config.h>
 
-#include <bin/lttng-consumerd/lttng-consumerd.h>
 #include <common/common.h>
 #include <common/compat/poll.h>
 #include <common/defaults.h>
@@ -98,18 +97,18 @@ static char *rundir;
 /* Consumer daemon specific control data */
 static struct consumer_data kconsumer_data = {
        .type = LTTNG_CONSUMER_KERNEL,
-       .err_unix_sock_path = KCONSUMERD_ERR_SOCK_PATH,
-       .cmd_unix_sock_path = KCONSUMERD_CMD_SOCK_PATH,
+       .err_unix_sock_path = DEFAULT_KCONSUMERD_ERR_SOCK_PATH,
+       .cmd_unix_sock_path = DEFAULT_KCONSUMERD_CMD_SOCK_PATH,
 };
 static struct consumer_data ustconsumer64_data = {
        .type = LTTNG_CONSUMER64_UST,
-       .err_unix_sock_path = USTCONSUMERD64_ERR_SOCK_PATH,
-       .cmd_unix_sock_path = USTCONSUMERD64_CMD_SOCK_PATH,
+       .err_unix_sock_path = DEFAULT_USTCONSUMERD64_ERR_SOCK_PATH,
+       .cmd_unix_sock_path = DEFAULT_USTCONSUMERD64_CMD_SOCK_PATH,
 };
 static struct consumer_data ustconsumer32_data = {
        .type = LTTNG_CONSUMER32_UST,
-       .err_unix_sock_path = USTCONSUMERD32_ERR_SOCK_PATH,
-       .cmd_unix_sock_path = USTCONSUMERD32_CMD_SOCK_PATH,
+       .err_unix_sock_path = DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH,
+       .cmd_unix_sock_path = DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH,
 };
 
 static int dispatch_thread_exit;
@@ -4112,13 +4111,13 @@ static int set_consumer_sockets(struct consumer_data *consumer_data,
 
     switch (consumer_data->type) {
        case LTTNG_CONSUMER_KERNEL:
-               snprintf(path, PATH_MAX, KCONSUMERD_PATH, rundir);
+               snprintf(path, PATH_MAX, DEFAULT_KCONSUMERD_PATH, rundir);
                break;
        case LTTNG_CONSUMER64_UST:
-               snprintf(path, PATH_MAX, USTCONSUMERD64_PATH, rundir);
+               snprintf(path, PATH_MAX, DEFAULT_USTCONSUMERD64_PATH, rundir);
                break;
        case LTTNG_CONSUMER32_UST:
-               snprintf(path, PATH_MAX, USTCONSUMERD32_PATH, rundir);
+               snprintf(path, PATH_MAX, DEFAULT_USTCONSUMERD32_PATH, rundir);
                break;
        default:
                ERR("Consumer type unknown");
@@ -4304,9 +4303,9 @@ int main(int argc, char **argv)
 
                /* Setup kernel consumerd path */
                snprintf(kconsumer_data.err_unix_sock_path, PATH_MAX,
-                               KCONSUMERD_ERR_SOCK_PATH, rundir);
+                               DEFAULT_KCONSUMERD_ERR_SOCK_PATH, rundir);
                snprintf(kconsumer_data.cmd_unix_sock_path, PATH_MAX,
-                               KCONSUMERD_CMD_SOCK_PATH, rundir);
+                               DEFAULT_KCONSUMERD_CMD_SOCK_PATH, rundir);
 
                DBG2("Kernel consumer err path: %s",
                                kconsumer_data.err_unix_sock_path);
@@ -4360,9 +4359,9 @@ int main(int argc, char **argv)
 
        /* 32 bits consumerd path setup */
        snprintf(ustconsumer32_data.err_unix_sock_path, PATH_MAX,
-                       USTCONSUMERD32_ERR_SOCK_PATH, rundir);
+                       DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH, rundir);
        snprintf(ustconsumer32_data.cmd_unix_sock_path, PATH_MAX,
-                       USTCONSUMERD32_CMD_SOCK_PATH, rundir);
+                       DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH, rundir);
 
        DBG2("UST consumer 32 bits err path: %s",
                        ustconsumer32_data.err_unix_sock_path);
@@ -4371,9 +4370,9 @@ int main(int argc, char **argv)
 
        /* 64 bits consumerd path setup */
        snprintf(ustconsumer64_data.err_unix_sock_path, PATH_MAX,
-                       USTCONSUMERD64_ERR_SOCK_PATH, rundir);
+                       DEFAULT_USTCONSUMERD64_ERR_SOCK_PATH, rundir);
        snprintf(ustconsumer64_data.cmd_unix_sock_path, PATH_MAX,
-                       USTCONSUMERD64_CMD_SOCK_PATH, rundir);
+                       DEFAULT_USTCONSUMERD64_CMD_SOCK_PATH, rundir);
 
        DBG2("UST consumer 64 bits err path: %s",
                        ustconsumer64_data.err_unix_sock_path);
index 6be44c7c3d55403ebeafcaf04ba30ca54aba8aba..b15bdc9e2cb6b35ac4c67b8f0f4447726cd82d1a 100644 (file)
 #define _DEFAULTS_H
 
 /* Default size of a hash table */
-#define DEFAULT_HT_SIZE                 4
+#define DEFAULT_HT_SIZE                         4
+
+/* Default session daemon paths */
+#define DEFAULT_HOME_DIR                                               "/tmp"
+#define DEFAULT_UST_SOCK_DIR                    DEFAULT_HOME_DIR "/ust-app-socks"
+#define DEFAULT_GLOBAL_APPS_PIPE                DEFAULT_UST_SOCK_DIR "/global"
+#define DEFAULT_TRACE_OUTPUT                    DEFAULT_HOME_DIR "/lttng"
+
+#define DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH       "/lttng-ust-apps-wait"
+#define DEFAULT_HOME_APPS_WAIT_SHM_PATH         "/lttng-ust-apps-wait-%u"
+
+/* Default consumer paths */
+#define DEFAULT_CONSUMERD_RUNDIR                "%s"
+
+/* Kernel consumer path */
+#define DEFAULT_KCONSUMERD_PATH                 DEFAULT_CONSUMERD_RUNDIR "/kconsumerd"
+#define DEFAULT_KCONSUMERD_CMD_SOCK_PATH        DEFAULT_KCONSUMERD_PATH "/command"
+#define DEFAULT_KCONSUMERD_ERR_SOCK_PATH        DEFAULT_KCONSUMERD_PATH "/error"
+
+/* UST 64-bit consumer path */
+#define DEFAULT_USTCONSUMERD64_PATH             DEFAULT_CONSUMERD_RUNDIR "/ustconsumerd64"
+#define DEFAULT_USTCONSUMERD64_CMD_SOCK_PATH    DEFAULT_USTCONSUMERD64_PATH "/command"
+#define DEFAULT_USTCONSUMERD64_ERR_SOCK_PATH    DEFAULT_USTCONSUMERD64_PATH "/error"
+
+/* UST 32-bit consumer path */
+#define DEFAULT_USTCONSUMERD32_PATH             DEFAULT_CONSUMERD_RUNDIR "/ustconsumerd32"
+#define DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH    DEFAULT_USTCONSUMERD32_PATH "/command"
+#define DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH    DEFAULT_USTCONSUMERD32_PATH "/error"
+
 
 /* Default lttng run directory */
-#define DEFAULT_LTTNG_RUNDIR                "/var/run/lttng"
-#define DEFAULT_LTTNG_HOME_RUNDIR           "%s/.lttng"
+#define DEFAULT_LTTNG_RUNDIR                    "/var/run/lttng"
+#define DEFAULT_LTTNG_HOME_RUNDIR               "%s/.lttng"
 
 /* Default unix socket path */
-#define DEFAULT_GLOBAL_CLIENT_UNIX_SOCK     DEFAULT_LTTNG_RUNDIR "/client-lttng-sessiond"
-#define DEFAULT_GLOBAL_APPS_UNIX_SOCK       DEFAULT_LTTNG_RUNDIR "/apps-lttng-sessiond"
-#define DEFAULT_HOME_APPS_UNIX_SOCK         DEFAULT_LTTNG_HOME_RUNDIR "/apps-lttng-sessiond"
-#define DEFAULT_HOME_CLIENT_UNIX_SOCK       DEFAULT_LTTNG_HOME_RUNDIR "/client-lttng-sessiond"
+#define DEFAULT_GLOBAL_CLIENT_UNIX_SOCK         DEFAULT_LTTNG_RUNDIR "/client-lttng-sessiond"
+#define DEFAULT_GLOBAL_APPS_UNIX_SOCK           DEFAULT_LTTNG_RUNDIR "/apps-lttng-sessiond"
+#define DEFAULT_HOME_APPS_UNIX_SOCK             DEFAULT_LTTNG_HOME_RUNDIR "/apps-lttng-sessiond"
+#define DEFAULT_HOME_CLIENT_UNIX_SOCK           DEFAULT_LTTNG_HOME_RUNDIR "/client-lttng-sessiond"
 
 /*
  * Value taken from the hard limit allowed by the kernel when using setrlimit
This page took 0.030014 seconds and 4 git commands to generate.