X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=ltt-sessiond%2Ftrace-ust.h;h=e2901a7fa346262eb72db2c96c854ea32f332b36;hb=2bdd86d4c47902237c691d3c5409f32f205df81e;hp=fa86cb94f5fa921a263c2bcff484d8ac71b4ae0c;hpb=97ee3a894d61db2c12b0fe09ee22f76140449a6f;p=lttng-tools.git diff --git a/ltt-sessiond/trace-ust.h b/ltt-sessiond/trace-ust.h index fa86cb94f..e2901a7fa 100644 --- a/ltt-sessiond/trace-ust.h +++ b/ltt-sessiond/trace-ust.h @@ -19,11 +19,30 @@ #ifndef _LTT_TRACE_UST_H #define _LTT_TRACE_UST_H +#include #include #include - #include -#include + +/* + * FIXME: temporary workaround: we use a lttng-tools local version of + * lttng-ust-abi.h if UST is not found. Eventually, we should use our + * own internal structures within lttng-tools instead of relying on the + * UST ABI. + */ +#ifdef CONFIG_CONFIG_LTTNG_TOOLS_HAVE_UST +#include +#else +#include "lttng-ust-abi.h" +#endif + +/* + * UST session list. + */ +struct ltt_ust_session_list { + unsigned int count; + struct cds_list_head head; +}; /* UST event list */ struct ltt_ust_event_list { @@ -31,6 +50,12 @@ struct ltt_ust_event_list { struct cds_list_head head; }; +/* UST Stream list */ +struct ltt_ust_stream_list { + unsigned int count; + struct cds_list_head head; +}; + /* UST Channel list */ struct ltt_ust_channel_list { unsigned int count; @@ -41,40 +66,68 @@ struct ltt_ust_channel_list { struct ltt_ust_event { int handle; int enabled; - struct lttng_ust_context *ctx; - struct lttng_ust_event *event; + /* + * TODO: need internal representation to support more than a + * single context. + */ + struct lttng_ust_context ctx; + struct lttng_ust_event attr; + struct cds_list_head list; + struct object_data *obj; +}; + +/* UST stream */ +struct ltt_ust_stream { + struct object_data *obj; struct cds_list_head list; + char *pathname; }; /* UST channel */ struct ltt_ust_channel { int handle; int enabled; - char *name; - char *trace_path; /* Trace file path name */ - struct lttng_ust_context *ctx; - struct lttng_ust_channel *attr; + char name[LTTNG_UST_SYM_NAME_LEN]; + char trace_path[PATH_MAX]; /* Trace file path name */ + /* + * TODO: need internal representation to support more than a + * single context. + */ + struct lttng_ust_context ctx; + struct lttng_ust_channel attr; struct ltt_ust_event_list events; struct cds_list_head list; + struct object_data *obj; + unsigned int stream_count; + struct ltt_ust_stream_list stream_list; }; /* UST Metadata */ struct ltt_ust_metadata { int handle; - char *trace_path; /* Trace file path name */ - struct lttng_ust_channel *attr; + struct object_data *obj; + char *pathname; /* Trace file path name */ + struct lttng_ust_channel attr; + struct object_data *stream_obj; }; /* UST session */ struct ltt_ust_session { + int sock; /* socket to send cmds to app */ int handle; int enabled; - int uconsumer_fds_sent; - char *path; + int consumer_fds_sent; + int consumer_fd; + char path[PATH_MAX]; + struct lttng_domain domain; struct ltt_ust_metadata *metadata; struct ltt_ust_channel_list channels; + struct cds_list_head list; + struct object_data *obj; }; +#ifdef CONFIG_LTTNG_TOOLS_HAVE_UST + /* * Lookup functions. NULL is returned if not found. */ @@ -82,13 +135,16 @@ struct ltt_ust_event *trace_ust_get_event_by_name( char *name, struct ltt_ust_channel *channel); struct ltt_ust_channel *trace_ust_get_channel_by_name( char *name, struct ltt_ust_session *session); +struct ltt_ust_session *trace_ust_get_session_by_pid( + struct ltt_ust_session_list *session_list, pid_t pid); /* * Create functions malloc() the data structure. */ -struct ltt_ust_session *trace_ust_create_session(void); -struct ltt_ust_channel *trace_ust_create_channel(char *name, char *path, - struct lttng_ust_channel *attr); +struct ltt_ust_session *trace_ust_create_session(char *path, pid_t pid, + 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); @@ -101,4 +157,67 @@ void trace_ust_destroy_metadata(struct ltt_ust_metadata *metadata); void trace_ust_destroy_channel(struct ltt_ust_channel *channel); void trace_ust_destroy_event(struct ltt_ust_event *event); +#else + +static inline +struct ltt_ust_event *trace_ust_get_event_by_name( + char *name, struct ltt_ust_channel *channel) +{ + return NULL; +} +static inline +struct ltt_ust_channel *trace_ust_get_channel_by_name( + char *name, struct ltt_ust_session *session) +{ + return NULL; +} +static inline +struct ltt_ust_session *trace_ust_get_session_by_pid( + struct ltt_ust_session_list *session_list, pid_t pid) +{ + return NULL; +} + +static inline +struct ltt_ust_session *trace_ust_create_session(char *path, pid_t pid, + struct lttng_domain *domain) +{ + return NULL; +} +static inline +struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr, + char *path) +{ + return NULL; +} +static inline +struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev) +{ + return NULL; +} +static inline +struct ltt_ust_metadata *trace_ust_create_metadata(char *path) +{ + return NULL; +} + +static inline +void trace_ust_destroy_session(struct ltt_ust_session *session) +{ +} +static inline +void trace_ust_destroy_metadata(struct ltt_ust_metadata *metadata) +{ +} +static inline +void trace_ust_destroy_channel(struct ltt_ust_channel *channel) +{ +} +static inline +void trace_ust_destroy_event(struct ltt_ust_event *event) +{ +} + +#endif + #endif /* _LTT_TRACE_UST_H */