RCU support for consumer's hash tables
[lttng-tools.git] / lttng-sessiond / trace-ust.h
index 18d3b5fc75e8586c0ca217d550db3592f3d2f6fb..c033ed6c57c7959f3f2836a8d1e039032f6fff2f 100644 (file)
 #include <limits.h>
 #include <urcu.h>
 #include <urcu/list.h>
+
 #include <lttng/lttng.h>
+#include <lttng-ht.h>
 
 #include "ust-ctl.h"
 
-#include "../hashtable/rculfhash.h"
-
 /* UST Stream list */
 struct ltt_ust_stream_list {
        unsigned int count;
@@ -38,15 +38,15 @@ struct ltt_ust_stream_list {
 /* Context hash table nodes */
 struct ltt_ust_context {
        struct lttng_ust_context ctx;
-       struct cds_lfht_node node;
+       struct lttng_ht_node_ulong node;
 };
 
 /* UST event */
 struct ltt_ust_event {
        unsigned int enabled;
        struct lttng_ust_event attr;
-       struct cds_lfht *ctx;
-       struct cds_lfht_node node;
+       struct lttng_ht *ctx;
+       struct lttng_ht_node_str node;
 };
 
 /* UST stream */
@@ -64,9 +64,9 @@ struct ltt_ust_channel {
        char name[LTTNG_UST_SYM_NAME_LEN];
        char pathname[PATH_MAX];
        struct lttng_ust_channel attr;
-       struct cds_lfht *ctx;
-       struct cds_lfht *events;
-       struct cds_lfht_node node;
+       struct lttng_ht *ctx;
+       struct lttng_ht *events;
+       struct lttng_ht_node_str node;
 };
 
 /* UST Metadata */
@@ -80,26 +80,26 @@ struct ltt_ust_metadata {
 
 /* UST domain global (LTTNG_DOMAIN_UST) */
 struct ltt_ust_domain_global {
-       struct cds_lfht *channels;
+       struct lttng_ht *channels;
 };
 
 /* UST domain pid (LTTNG_DOMAIN_UST_PID) */
 struct ltt_ust_domain_pid {
        pid_t pid;
-       struct cds_lfht *channels;
-       struct cds_lfht_node node;
+       struct lttng_ht *channels;
+       struct lttng_ht_node_ulong node;
 };
 
 /* UST domain exec name (LTTNG_DOMAIN_UST_EXEC_NAME) */
 struct ltt_ust_domain_exec {
        char exec_name[LTTNG_UST_SYM_NAME_LEN];
-       struct cds_lfht *channels;
-       struct cds_lfht_node node;
+       struct lttng_ht *channels;
+       struct lttng_ht_node_str node;
 };
 
 /* UST session */
 struct ltt_ust_session {
-       int uid;   /* Unique identifier of session */
+       int id;    /* Unique identifier of session */
        int start_trace;
        char pathname[PATH_MAX];
        struct ltt_ust_domain_global domain_global;
@@ -108,8 +108,11 @@ struct ltt_ust_session {
         * contains a HT of channels. See ltt_ust_domain_exec and
         * ltt_ust_domain_pid data structures.
         */
-       struct cds_lfht *domain_pid;
-       struct cds_lfht *domain_exec;
+       struct lttng_ht *domain_pid;
+       struct lttng_ht *domain_exec;
+       /* UID/GID of the user owning the session */
+       uid_t uid;
+       gid_t gid;
 };
 
 #ifdef HAVE_LIBLTTNG_UST_CTL
@@ -117,15 +120,15 @@ struct ltt_ust_session {
 /*
  * Lookup functions. NULL is returned if not found.
  */
-struct ltt_ust_event *trace_ust_find_event_by_name(struct cds_lfht *ht,
+struct ltt_ust_event *trace_ust_find_event_by_name(struct lttng_ht *ht,
                char *name);
-struct ltt_ust_channel *trace_ust_find_channel_by_name(struct cds_lfht *ht,
+struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht,
                char *name);
 
 /*
  * Create functions malloc() the data structure.
  */
-struct ltt_ust_session *trace_ust_create_session(char *path, unsigned int uid,
+struct ltt_ust_session *trace_ust_create_session(char *path, int session_id,
                struct lttng_domain *domain);
 struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr,
                char *path);
@@ -146,14 +149,14 @@ void trace_ust_destroy_event(struct ltt_ust_event *event);
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
 static inline
-struct ltt_ust_event *trace_ust_find_event_by_name(struct cds_lfht *ht,
+struct ltt_ust_event *trace_ust_find_event_by_name(struct lttng_ht *ht,
                char *name)
 {
        return NULL;
 }
 
 static inline
-struct ltt_ust_channel *trace_ust_find_channel_by_name(struct cds_lfht *ht,
+struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht,
                char *name)
 {
        return NULL;
@@ -201,6 +204,12 @@ static inline
 void trace_ust_destroy_event(struct ltt_ust_event *event)
 {
 }
+static inline
+struct ltt_ust_context *trace_ust_create_context(
+               struct lttng_event_context *ctx)
+{
+       return NULL;
+}
 
 #endif /* HAVE_LIBLTTNG_UST_CTL */
 
This page took 0.0259 seconds and 4 git commands to generate.