From: David Goulet Date: Tue, 24 Jan 2012 22:43:54 +0000 (-0500) Subject: Remove default defines from lttng.h X-Git-Tag: v2.0-pre19~51 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bbccc3d2cb9f83aecf00a207de9eef68c766bf9c;p=lttng-tools.git Remove default defines from lttng.h They were not use in lttng.h and of no use for the user also. They are all moved to common/defaults.h. Signed-off-by: David Goulet --- diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 8bdfe121c..71e754018 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -27,15 +27,6 @@ #include #include -/* Default unix group name for tracing. */ -#define LTTNG_DEFAULT_TRACING_GROUP "tracing" - -/* Environment variable to set session daemon binary path. */ -#define LTTNG_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH" - -/* Default trace output directory name */ -#define LTTNG_DEFAULT_TRACE_DIR_NAME "lttng-traces" - /* * Event symbol length. Copied from LTTng kernel ABI. */ diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 0e92327cd..4e5771f03 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -77,7 +77,7 @@ struct consumer_data { /* Const values */ const char default_home_dir[] = DEFAULT_HOME_DIR; -const char default_tracing_group[] = LTTNG_DEFAULT_TRACING_GROUP; +const char default_tracing_group[] = DEFAULT_TRACING_GROUP; const char default_ust_sock_dir[] = DEFAULT_UST_SOCK_DIR; const char default_global_apps_pipe[] = DEFAULT_GLOBAL_APPS_PIPE; diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 0765c823b..34754c7ca 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -101,10 +101,10 @@ static int create_session() } if (have_name) { - ret = asprintf(&traces_path, "%s/" LTTNG_DEFAULT_TRACE_DIR_NAME + ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME "/%s-%s", alloc_path, session_name, datetime); } else { - ret = asprintf(&traces_path, "%s/" LTTNG_DEFAULT_TRACE_DIR_NAME + ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME "/%s", alloc_path, session_name); } diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 6e16995a9..a8cc2e72f 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -351,7 +351,7 @@ static int check_sessiond(void) pathname = opt_sessiond_path; } else { /* Try LTTNG_SESSIOND_PATH env variable */ - pathname = getenv(LTTNG_SESSIOND_PATH_ENV); + pathname = getenv(DEFAULT_SESSIOND_PATH_ENV); } /* Let's rock and roll */ diff --git a/src/common/defaults.h b/src/common/defaults.h index b15bdc9e2..aa383b326 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -19,6 +19,15 @@ #ifndef _DEFAULTS_H #define _DEFAULTS_H +/* Default unix group name for tracing. */ +#define DEFAULT_TRACING_GROUP "tracing" + +/* Environment variable to set session daemon binary path. */ +#define DEFAULT_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH" + +/* Default trace output directory name */ +#define DEFAULT_TRACE_DIR_NAME "lttng-traces" + /* Default size of a hash table */ #define DEFAULT_HT_SIZE 4 diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 0858c1a74..b7fc78161 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -906,5 +906,5 @@ int lttng_session_daemon_alive(void) static void __attribute__((constructor)) init() { /* Set default session group */ - lttng_set_tracing_group(LTTNG_DEFAULT_TRACING_GROUP); + lttng_set_tracing_group(DEFAULT_TRACING_GROUP); }