From: Mathieu Desnoyers Date: Thu, 28 Mar 2013 19:54:12 +0000 (-0400) Subject: Fix: don't keep vpid, procname, nor patchlevel environment for per-uid buffers X-Git-Tag: v2.2.0-rc1~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=af6142cf6f9ff4657f3c80b4c19df50247a86e91;p=lttng-tools.git Fix: don't keep vpid, procname, nor patchlevel environment for per-uid buffers Signed-off-by: Mathieu Desnoyers Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 4c9d227af..8016d8ba5 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1502,7 +1502,9 @@ static int setup_buffer_reg_pid(struct ust_app_session *ua_sess, ret = ust_registry_session_init(®_pid->registry->reg.ust, app, app->bits_per_long, app->uint8_t_alignment, app->uint16_t_alignment, app->uint32_t_alignment, - app->uint64_t_alignment, app->long_alignment, app->byte_order); + app->uint64_t_alignment, app->long_alignment, + app->byte_order, app->version.major, + app->version.minor); if (ret < 0) { goto error; } @@ -1553,10 +1555,12 @@ static int setup_buffer_reg_uid(struct ltt_ust_session *usess, } /* Initialize registry. */ - ret = ust_registry_session_init(®_uid->registry->reg.ust, app, + ret = ust_registry_session_init(®_uid->registry->reg.ust, NULL, app->bits_per_long, app->uint8_t_alignment, app->uint16_t_alignment, app->uint32_t_alignment, - app->uint64_t_alignment, app->long_alignment, app->byte_order); + app->uint64_t_alignment, app->long_alignment, + app->byte_order, app->version.major, + app->version.minor); if (ret < 0) { goto error; } diff --git a/src/bin/lttng-sessiond/ust-metadata.c b/src/bin/lttng-sessiond/ust-metadata.c index 273516974..b0f83d272 100644 --- a/src/bin/lttng-sessiond/ust-metadata.c +++ b/src/bin/lttng-sessiond/ust-metadata.c @@ -520,7 +520,9 @@ uint64_t measure_clock_offset(void) * Should be called with session registry mutex held. */ int ust_metadata_session_statedump(struct ust_registry_session *session, - struct ust_app *app) + struct ust_app *app, + uint32_t major, + uint32_t minor) { unsigned char *uuid_c; char uuid_s[UUID_STR_LEN], @@ -529,7 +531,6 @@ int ust_metadata_session_statedump(struct ust_registry_session *session, char hostname[HOST_NAME_MAX]; assert(session); - assert(app); uuid_c = session->uuid; @@ -585,12 +586,10 @@ int ust_metadata_session_statedump(struct ust_registry_session *session, " domain = \"ust\";\n" " tracer_name = \"lttng-ust\";\n" " tracer_major = %u;\n" - " tracer_minor = %u;\n" - " tracer_patchlevel = %u;\n", + " tracer_minor = %u;\n", hostname, - app->version.major, - app->version.minor, - app->version.patchlevel + major, + minor ); if (ret) goto end; @@ -601,8 +600,10 @@ int ust_metadata_session_statedump(struct ust_registry_session *session, */ if (app) { ret = lttng_metadata_printf(session, + " tracer_patchlevel = %u;\n" " vpid = %d;\n" " procname = \"%s\";\n", + app->version.patchlevel, (int) app->pid, app->name ); diff --git a/src/bin/lttng-sessiond/ust-registry.c b/src/bin/lttng-sessiond/ust-registry.c index 19cff09fc..6c483e4b7 100644 --- a/src/bin/lttng-sessiond/ust-registry.c +++ b/src/bin/lttng-sessiond/ust-registry.c @@ -452,13 +452,14 @@ int ust_registry_session_init(struct ust_registry_session **sessionp, uint32_t uint32_t_alignment, uint32_t uint64_t_alignment, uint32_t long_alignment, - int byte_order) + int byte_order, + uint32_t major, + uint32_t minor) { int ret; struct ust_registry_session *session; assert(sessionp); - assert(app); session = zmalloc(sizeof(*session)); if (!session) { @@ -487,7 +488,7 @@ int ust_registry_session_init(struct ust_registry_session **sessionp, } pthread_mutex_lock(&session->lock); - ret = ust_metadata_session_statedump(session, app); + ret = ust_metadata_session_statedump(session, app, major, minor); pthread_mutex_unlock(&session->lock); if (ret) { ERR("Failed to generate session metadata (errno = %d)", ret); diff --git a/src/bin/lttng-sessiond/ust-registry.h b/src/bin/lttng-sessiond/ust-registry.h index 1500f74aa..3cd474b51 100644 --- a/src/bin/lttng-sessiond/ust-registry.h +++ b/src/bin/lttng-sessiond/ust-registry.h @@ -216,7 +216,9 @@ int ust_registry_session_init(struct ust_registry_session **sessionp, uint32_t uint32_t_alignment, uint32_t uint64_t_alignment, uint32_t long_alignment, - int byte_order); + int byte_order, + uint32_t major, + uint32_t minor); void ust_registry_session_destroy(struct ust_registry_session *session); int ust_registry_create_event(struct ust_registry_session *session, @@ -230,7 +232,7 @@ void ust_registry_destroy_event(struct ust_registry_channel *chan, /* app can be NULL for registry shared across applications. */ int ust_metadata_session_statedump(struct ust_registry_session *session, - struct ust_app *app); + struct ust_app *app, uint32_t major, uint32_t minor); int ust_metadata_channel_statedump(struct ust_registry_session *session, struct ust_registry_channel *chan); int ust_metadata_event_statedump(struct ust_registry_session *session,