Fix: use DEFAULT_SESSION_NAME when name was generated
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 23 Apr 2019 18:40:05 +0000 (14:40 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 1 May 2019 21:34:32 +0000 (17:34 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
src/bin/lttng-sessiond/kernel.c

index 251d934560dce04fbcaca8667d559d3d321485c4..cedb9346cea81d29fc8eb547bbcbe769c337cc38 100644 (file)
@@ -125,14 +125,24 @@ int kernel_create_session(struct ltt_session *session, int tracer_fd)
 
        DBG("Kernel session created (fd: %d)", lks->fd);
 
 
        DBG("Kernel session created (fd: %d)", lks->fd);
 
-       ret = kernctl_session_set_name(lks->fd, session->name);
+       /*
+        * This is necessary since the creation time is present in the session
+        * name when it is generated.
+        */
+       if (session->has_auto_generated_name) {
+               ret = kernctl_session_set_name(lks->fd, DEFAULT_SESSION_NAME);
+       } else {
+               ret = kernctl_session_set_name(lks->fd, session->name);
+       }
        if (ret) {
        if (ret) {
-               WARN("Could not set kernel session name");
+               WARN("Could not set kernel session name for session %" PRIu64 " name: %s",
+                       session->id, session->name);
        }
 
        ret = kernctl_session_set_creation_time(lks->fd, session->creation_time);
        if (ret) {
        }
 
        ret = kernctl_session_set_creation_time(lks->fd, session->creation_time);
        if (ret) {
-               WARN("Could not set kernel session creation time");
+               WARN("Could not set kernel session creation time for session %" PRIu64 " name: %s",
+                       session->id, session->name);
        }
 
        return 0;
        }
 
        return 0;
This page took 0.028611 seconds and 5 git commands to generate.