+ if (ltt_traceable_app_list.count > 0) {
+ ltt_traceable_app_list.count--;
+ }
+
+ cds_list_for_each_entry(chan, <a->channels.head, list) {
+ trace_ust_destroy_channel(chan);
+ }
+}
+
+/*
+ * Return pointer to traceable apps list.
+ */
+struct ltt_traceable_app_list *get_traceable_apps_list(void)
+{
+ return <t_traceable_app_list;
+}
+
+/*
+ * Acquire traceable apps list lock.
+ */
+void lock_apps_list(void)
+{
+ pthread_mutex_lock(<t_traceable_app_list.lock);
+}
+
+/*
+ * Release traceable apps list lock.
+ */
+void unlock_apps_list(void)
+{
+ pthread_mutex_unlock(<t_traceable_app_list.lock);
+}
+
+/*
+ * Iterate over the traceable apps list and return a pointer or NULL if not
+ * found.
+ */
+static struct ltt_traceable_app *find_app_by_sock(int sock)
+{
+ struct ltt_traceable_app *iter;
+
+ cds_list_for_each_entry(iter, <t_traceable_app_list.head, list) {
+ if (iter->sock == sock) {
+ /* Found */
+ return iter;
+ }