projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: The session list count should provide unique identifiers
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
session.c
diff --git
a/src/bin/lttng-sessiond/session.c
b/src/bin/lttng-sessiond/session.c
index cf2ef463e8ce20404746ae7dda5a28e44f538b84..13abe424c3b1c4472034fbd6be4473c3570abff4 100644
(file)
--- a/
src/bin/lttng-sessiond/session.c
+++ b/
src/bin/lttng-sessiond/session.c
@@
-21,7
+21,6
@@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <urcu.h>
#include <common/common.h>
#include <urcu.h>
#include <common/common.h>
@@
-55,7
+54,7
@@
static struct ltt_session_list ltt_session_list = {
* The caller MUST acquire the session list lock before.
* Returns the unique identifier for the session.
*/
* 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;
{
cds_list_add(&ls->list, <t_session_list.head);
return ++ltt_session_list.count;
@@
-65,14
+64,12
@@
static int add_session_list(struct ltt_session *ls)
* Delete a ltt_session structure to the global list.
*
* The caller MUST acquire the session list lock before.
* 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);
*/
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--;
- }
}
/*
}
/*
@@
-230,7
+227,7
@@
int session_create(char *name, char *path, uid_t uid, gid_t gid)
new_session->id = add_session_list(new_session);
session_unlock_list();
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);
name, path, new_session->id,
new_session->uid, new_session->gid);
This page took
0.025036 seconds
and
4
git commands to generate.