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");
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");
#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 */
#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;
#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>
/* 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;
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");
/* 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);
/* 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);
/* 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);
#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