Add benchmark directory to git ignore
[lttng-tools.git] / ltt-sessiond / traceable-app.c
index 85d50393a6b9eaaa60eeb17bb963370656d9708a..cde3f97f2e5a798b47b28156b4e0def6d2ac9a58 100644 (file)
@@ -98,6 +98,24 @@ static struct ltt_traceable_app *find_app_by_sock(int sock)
        return NULL;
 }
 
+/*
+ * Iterate over the traceable apps list and return a pointer or NULL if not
+ * found.
+ */
+struct ltt_traceable_app *traceable_app_get_by_pid(pid_t pid)
+{
+       struct ltt_traceable_app *iter;
+
+       cds_list_for_each_entry(iter, &ltt_traceable_app_list.head, list) {
+               if (iter->pid == pid) {
+                       /* Found */
+                       return iter;
+               }
+       }
+
+       return NULL;
+}
+
 /*
  * Using pid and uid (of the app), allocate a new ltt_traceable_app struct and
  * add it to the global traceable app list.
This page took 0.022778 seconds and 4 git commands to generate.