#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <urcu.h>
#include <common/common.h>
* The caller MUST acquire the session list lock before.
* Returns the unique identifier for the session.
*/
-static int add_session_list(struct ltt_session *ls)
+static unsigned int add_session_list(struct ltt_session *ls)
{
cds_list_add(&ls->list, <t_session_list.head);
return ++ltt_session_list.count;
* Delete a ltt_session structure to the global list.
*
* The caller MUST acquire the session list lock before.
+ * The session list count CANNOT be decremented, as it is used as unique
+ * identifier for the session in UST app hash table lookups.
*/
static void del_session_list(struct ltt_session *ls)
{
cds_list_del(&ls->list);
- /* Sanity check */
- if (ltt_session_list.count > 0) {
- ltt_session_list.count--;
- }
}
/*
new_session->id = add_session_list(new_session);
session_unlock_list();
- DBG("Tracing session %s created in %s with ID %d by UID %d GID %d",
+ DBG("Tracing session %s created in %s with ID %u by UID %d GID %d",
name, path, new_session->id,
new_session->uid, new_session->gid);