X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng-sessiond%2Ftrace-ust.h;h=c033ed6c57c7959f3f2836a8d1e039032f6fff2f;hp=f0b639cba23da1fa68902450f6ce3278ea34b556;hb=6065ceec9574bf18eb79ae707f627322f2713d18;hpb=ba5d816ea3010aa4a2a205e3c594b5464f82291a diff --git a/lttng-sessiond/trace-ust.h b/lttng-sessiond/trace-ust.h index f0b639cba..c033ed6c5 100644 --- a/lttng-sessiond/trace-ust.h +++ b/lttng-sessiond/trace-ust.h @@ -23,12 +23,12 @@ #include #include #include + #include +#include #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,20 +120,22 @@ 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); struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev); struct ltt_ust_metadata *trace_ust_create_metadata(char *path); +struct ltt_ust_context *trace_ust_create_context( + struct lttng_event_context *ctx); /* * Destroy functions free() the data structure and remove from linked list if @@ -144,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; @@ -199,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 */