Metadata: add vpid_datetime field to metadta env
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 4bee504969bae5685782f9198a939816692008cb..8b3028c57201f98ffdefe19ded346b9956399b4c 100644 (file)
@@ -1831,15 +1831,12 @@ static void shadow_copy_channel(struct ust_app_channel *ua_chan,
 static void shadow_copy_session(struct ust_app_session *ua_sess,
                struct ltt_ust_session *usess, struct ust_app *app)
 {
-       time_t rawtime;
        struct tm *timeinfo;
        char datetime[16];
        int ret;
        char tmp_shm_path[PATH_MAX];
 
-       /* Get date and time for unique app path */
-       time(&rawtime);
-       timeinfo = localtime(&rawtime);
+       timeinfo = localtime(&app->registration_time);
        strftime(datetime, sizeof(datetime), "%Y%m%d-%H%M%S", timeinfo);
 
        DBG2("Shadow copy of session handle %d", ua_sess->handle);
@@ -1993,7 +1990,7 @@ static int setup_buffer_reg_pid(struct ust_app_session *ua_sess,
                        app->byte_order, app->version.major,
                        app->version.minor, reg_pid->root_shm_path,
                        reg_pid->shm_path,
-                       ua_sess->euid, ua_sess->egid);
+                       ua_sess->euid, ua_sess->egid, ua_sess->tracing_id, app->uid);
        if (ret < 0) {
                /*
                 * reg_pid->registry->reg.ust is NULL upon error, so we need to
@@ -2060,7 +2057,8 @@ static int setup_buffer_reg_uid(struct ltt_ust_session *usess,
                        app->uint64_t_alignment, app->long_alignment,
                        app->byte_order, app->version.major,
                        app->version.minor, reg_uid->root_shm_path,
-                       reg_uid->shm_path, usess->uid, usess->gid);
+                       reg_uid->shm_path, usess->uid, usess->gid,
+                       ua_sess->tracing_id, app->uid);
        if (ret < 0) {
                /*
                 * reg_uid->registry->reg.ust is NULL upon error, so we need to
@@ -3376,6 +3374,8 @@ void ust_app_add(struct ust_app *app)
        assert(app);
        assert(app->notify_sock >= 0);
 
+       app->registration_time = time(NULL);
+
        rcu_read_lock();
 
        /*
This page took 0.025624 seconds and 5 git commands to generate.