Make libustctl list only online pids v3
[ust.git] / libust / tracectl.c
index bc0a07c046d26333f36ef1b19145f79c8ba53fa8..2f45d6be5d66fe249a197135e178755af33c597a 100644 (file)
@@ -1228,12 +1228,19 @@ static struct ustcomm_sock * init_app_socket(int epoll_fd)
        char *dir_name, *sock_name;
        int result;
        struct ustcomm_sock *sock = NULL;
+       time_t mtime;
 
        dir_name = ustcomm_user_sock_dir();
        if (!dir_name)
                return NULL;
 
-       result = asprintf(&sock_name, "%s/%d", dir_name, (int)getpid());
+       mtime = ustcomm_pid_st_mtime(getpid());
+       if (!mtime) {
+               goto free_dir_name;
+       }
+
+       result = asprintf(&sock_name, "%s/%d.%ld", dir_name,
+                         (int) getpid(), (long) mtime);
        if (result < 0) {
                ERR("string overflow allocating socket name, "
                    "UST thread bailing");
This page took 0.022689 seconds and 4 git commands to generate.