DBG("Creating UST session");
- session_lock_list();
- uid = session_list_ptr->count;
- session_unlock_list();
-
+ uid = session->uid;
lus = trace_ust_create_session(session->path, uid, domain);
if (lus == NULL) {
ret = LTTCOMM_UST_SESS_FAIL;
* Add a ltt_session structure to the global list.
*
* The caller MUST acquire the session list lock before.
+ * Returns the unique identifier for the session.
*/
-static void add_session_list(struct ltt_session *ls)
+static int add_session_list(struct ltt_session *ls)
{
cds_list_add(&ls->list, <t_session_list.head);
- ltt_session_list.count++;
+ return ++ltt_session_list.count;
}
/*
/* Add new session to the session list */
session_lock_list();
- add_session_list(new_session);
+ new_session->uid = add_session_list(new_session);
session_unlock_list();
- DBG("Tracing session %s created in %s", name, path);
+ DBG("Tracing session %s created in %s with UID %d", name, path, new_session->uid);
return LTTCOMM_OK;