X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=ltt-sessiond%2Ftraceable-app.c;h=cde3f97f2e5a798b47b28156b4e0def6d2ac9a58;hp=85d50393a6b9eaaa60eeb17bb963370656d9708a;hb=56c868797e71638aa5449ead20f5bb8763f2e005;hpb=f8f0c3d1337c4eda5fb76a323ffe6c21c926a21e diff --git a/ltt-sessiond/traceable-app.c b/ltt-sessiond/traceable-app.c index 85d50393a..cde3f97f2 100644 --- a/ltt-sessiond/traceable-app.c +++ b/ltt-sessiond/traceable-app.c @@ -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, <t_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.