Fix RCU-related hangs: incorrect lttng_ht_destroy use
[lttng-tools.git] / src / bin / lttng-sessiond / ust-metadata.c
index 45512ac7ba0df66ec1b2b19368b175c18198d3ae..b0f83d2721654b0351c872f082997bef2b0dc881 100644 (file)
@@ -372,6 +372,7 @@ int ust_metadata_event_statedump(struct ust_registry_session *session,
                "};\n\n");
        if (ret)
                goto end;
+       event->metadata_dumped = 1;
 
 end:
        return ret;
@@ -424,6 +425,8 @@ int ust_metadata_channel_statedump(struct ust_registry_session *session,
 
        ret = lttng_metadata_printf(session,
                "};\n\n");
+       /* Flag success of metadata dump. */
+       chan->metadata_dumped = 1;
 
 end:
        return ret;
@@ -517,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],
@@ -525,6 +530,8 @@ int ust_metadata_session_statedump(struct ust_registry_session *session,
        int ret = 0;
        char hostname[HOST_NAME_MAX];
 
+       assert(session);
+
        uuid_c = session->uuid;
 
        snprintf(uuid_s, sizeof(uuid_s),
@@ -579,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;
@@ -595,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
                        );
This page took 0.023587 seconds and 4 git commands to generate.