switch (ua_sess->buffer_type) {
case LTTNG_BUFFER_PER_PID:
ret = snprintf(ua_sess->path, sizeof(ua_sess->path),
- DEFAULT_UST_TRACE_PID_PATH "/%s-%d-%s", app->name, app->pid,
- datetime);
+ DEFAULT_UST_TRACE_PID_PATH "/%s-%d-%s-%ld", app->name, app->pid,
+ datetime, ua_sess->id);
break;
case LTTNG_BUFFER_PER_UID:
ret = snprintf(ua_sess->path, sizeof(ua_sess->path),
switch (ua_sess->buffer_type) {
case LTTNG_BUFFER_PER_PID:
ret = snprintf(tmp_shm_path, sizeof(tmp_shm_path),
- "/" DEFAULT_UST_TRACE_PID_PATH "/%s-%d-%s",
- app->name, app->pid, datetime);
+ "/" DEFAULT_UST_TRACE_PID_PATH "/%s-%d-%s-%ld",
+ app->name, app->pid, datetime, ua_sess->id);
break;
case LTTNG_BUFFER_PER_UID:
ret = snprintf(tmp_shm_path, sizeof(tmp_shm_path),
}
/*
- * Return ust app pointer or NULL if not found. RCU read side lock MUST be
+ * Check if a ust_app with a given pid is present. RCU read side lock MUST be
* acquired before calling this function.
*/
-struct ust_app *ust_app_find_by_pid(pid_t pid)
+bool ust_app_with_pid_exists(pid_t pid)
{
- struct ust_app *app = NULL;
struct lttng_ht_node_ulong *node;
struct lttng_ht_iter iter;
+ bool present = false;
lttng_ht_lookup(ust_app_ht, (void *)((unsigned long) pid), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
if (node == NULL) {
- DBG2("UST app no found with pid %d", pid);
- goto error;
+ DBG2("UST app not found with pid %d", pid);
+ goto end;
}
- DBG2("Found UST app by pid %d", pid);
-
- app = caa_container_of(node, struct ust_app, pid_n);
-
-error:
- return app;
+ present = true;
+end:
+ return present;
}
/*