From: David Goulet Date: Tue, 22 Jan 2013 19:57:24 +0000 (-0500) Subject: Use default value for metadata file name X-Git-Tag: v2.2.0-rc1~93 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=30079b6ba2522a6c3ac329fcaaa779bd4bf04f4a;p=lttng-tools.git Use default value for metadata file name Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index 25f0e4799..7fae5b0e9 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -124,7 +124,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, session->metadata->fd, session->metadata->conf->attr.subbuf_size, 0, /* for kernel */ - "metadata", + DEFAULT_METADATA_NAME, 1); health_code_update(&health_thread_kernel); @@ -148,7 +148,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, session->gid, consumer->net_seq_index, 1, /* Metadata flag set */ - "metadata", + DEFAULT_METADATA_NAME, pathname, session->id); diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index e07d27e67..81bf535f6 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -418,7 +418,7 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) lum->handle = -1; /* Set metadata trace path */ - ret = snprintf(lum->pathname, PATH_MAX, "%s/metadata", path); + ret = snprintf(lum->pathname, PATH_MAX, "%s/" DEFAULT_METADATA_NAME, path); if (ret < 0) { PERROR("asprintf ust metadata"); goto error_free_metadata; diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 9e6d81f2a..f46183bd3 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1468,7 +1468,7 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, } ret = snprintf(ua_sess->metadata->pathname, PATH_MAX, - "%s/metadata", ua_sess->path); + "%s/" DEFAULT_METADATA_NAME, ua_sess->path); if (ret < 0) { PERROR("asprintf UST create stream"); goto error; diff --git a/src/bin/lttng-sessiond/ust-consumer.c b/src/bin/lttng-sessiond/ust-consumer.c index ffa642937..ea9c85703 100644 --- a/src/bin/lttng-sessiond/ust-consumer.c +++ b/src/bin/lttng-sessiond/ust-consumer.c @@ -227,7 +227,7 @@ static int send_metadata(struct consumer_socket *sock, usess->metadata->obj->shm_fd, usess->metadata->attr.subbuf_size, usess->metadata->obj->memory_map_size, - "metadata", + DEFAULT_METADATA_NAME, 1); health_code_update(&health_thread_cmd); @@ -289,7 +289,7 @@ static int send_metadata(struct consumer_socket *sock, usess->gid, consumer->net_seq_index, 1, /* Flag metadata set */ - "metadata", + DEFAULT_METADATA_NAME, pathname, usess->id); diff --git a/src/common/defaults.h b/src/common/defaults.h index 0dde57964..0e3aecf87 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -22,6 +22,13 @@ /* Default unix group name for tracing. */ #define DEFAULT_TRACING_GROUP "tracing" +/* + * This value is defined in the CTF specification (see + * git://git.efficios.com/ctf.git in the file + * common-trace-format-specification.txt. + */ +#define DEFAULT_METADATA_NAME "metadata" + /* Environment variable to set session daemon binary path. */ #define DEFAULT_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH"