Fix: don't keep vpid, procname, nor patchlevel environment for per-uid buffers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 28 Mar 2013 19:54:12 +0000 (15:54 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 28 Mar 2013 19:56:25 +0000 (15:56 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/ust-metadata.c
src/bin/lttng-sessiond/ust-registry.c
src/bin/lttng-sessiond/ust-registry.h

index 4c9d227af008a285bd17d8732ed906803351f275..8016d8ba5357512a07d38ac18485186d1798d20e 100644 (file)
@@ -1502,7 +1502,9 @@ static int setup_buffer_reg_pid(struct ust_app_session *ua_sess,
        ret = ust_registry_session_init(&reg_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(&reg_uid->registry->reg.ust, app,
+       ret = ust_registry_session_init(&reg_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;
        }
index 2735169747e9bfc8108cb5e009cd8a922eefffa8..b0f83d2721654b0351c872f082997bef2b0dc881 100644 (file)
@@ -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
                        );
index 19cff09fcd9d26aedb4a79194d10f7875e5fc810..6c483e4b71c3107b614cc6201a53719d88307fd9 100644 (file)
@@ -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);
index 1500f74aa54b885c6cd9401f8797e06e9c0e3316..3cd474b51abfebad76d98b6255ff6f736810ed73 100644 (file)
@@ -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,
This page took 0.029712 seconds and 4 git commands to generate.