+/*
+ * add_traceable_app
+ *
+ * Add a traceable application structure to the global
+ * list protected by a mutex.
+ */
+static void add_traceable_app(struct ltt_traceable_app *lta)
+{
+ pthread_mutex_lock(<t_traceable_app_list_mutex);
+ cds_list_add(<a->list, <t_traceable_app_list.head);
+ traceable_app_count++;
+ pthread_mutex_unlock(<t_traceable_app_list_mutex);
+}
+
+/*
+ * del_traceable_app
+ *
+ * Delete a traceable application structure from the
+ * global list protected by a mutex.
+ */
+static void del_traceable_app(struct ltt_traceable_app *lta)
+{
+ pthread_mutex_lock(<t_traceable_app_list_mutex);
+ cds_list_del(<a->list);
+ /* Sanity check */
+ if (traceable_app_count != 0) {
+ traceable_app_count--;
+ }
+ pthread_mutex_unlock(<t_traceable_app_list_mutex);
+}
+
+/*
+ * add_session_list
+ *
+ * Add a ltt_session structure to the global list.
+ */
+static void add_session_list(struct ltt_session *ls)
+{
+ cds_list_add(&ls->list, <t_session_list.head);
+ session_count++;
+}
+
+/*
+ * del_session_list
+ *
+ * Delete a ltt_session structure to the global list.
+ */
+static void del_session_list(struct ltt_session *ls)
+{
+ cds_list_del(&ls->list);
+ /* Sanity check */
+ if (session_count != 0) {
+ session_count--;
+ }
+}
+
+/*
+ * send_unix_sock
+ *
+ * Send data on a unix socket using the liblttsessiondcomm API.
+ *
+ * Return lttcomm error code.
+ */
+static int send_unix_sock(int sock, void *buf, size_t len)
+{
+ /* Check valid length */
+ if (len <= 0) {
+ return -1;
+ }
+
+ return lttcomm_send_unix_sock(sock, buf, len);
+}
+