X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=ltt-sessiond%2Ftrace.h;h=444126ba01e4322c7727a3341f85fd13467e8e90;hp=6e86915b60ef69f0519485dfb5291982f955aa17;hb=333f285e479a22c99122aa92b988b10c597551e4;hpb=20fe210416ef1cc0e9b85e5a40c58344e3185fd6 diff --git a/ltt-sessiond/trace.h b/ltt-sessiond/trace.h index 6e86915b6..444126ba0 100644 --- a/ltt-sessiond/trace.h +++ b/ltt-sessiond/trace.h @@ -19,33 +19,73 @@ #ifndef _LTT_TRACE_H #define _LTT_TRACE_H -#include "ltt-sessiond.h" -#include "session.h" +#include +#include #include "lttng-kernel.h" +/* Default kernel channel attributes */ +#define DEFAULT_KERNEL_OVERWRITE 0 +#define DEFAULT_KERNEL_SUBBUF_SIZE 4096 /* bytes */ +#define DEFAULT_KERNEL_SUBBUF_NUM 8 /* Must always be a power of 2 */ +#define DEFAULT_KERNEL_SWITCH_TIMER 0 /* usec */ +#define DEFAULT_KERNEL_READ_TIMER 200 /* usec */ + /* Kernel event list */ struct ltt_kernel_event_list { struct cds_list_head head; }; +/* Channel stream list */ +struct ltt_kernel_stream_list { + struct cds_list_head head; +}; + +/* Channel list */ +struct ltt_kernel_channel_list { + struct cds_list_head head; +}; + /* Kernel event */ struct ltt_kernel_event { - char name[NAME_MAX]; int fd; + struct lttng_kernel_event *event; struct cds_list_head list; }; /* Kernel channel */ struct ltt_kernel_channel { int fd; - struct lttng_channel *channel; + char *pathname; + unsigned int stream_count; + struct lttng_kernel_channel *channel; struct ltt_kernel_event_list events_list; + struct ltt_kernel_stream_list stream_list; + struct cds_list_head list; +}; + +/* Metadata */ +struct ltt_kernel_metadata { + int fd; + char *pathname; + struct lttng_kernel_channel *conf; +}; + +/* Channel stream */ +struct ltt_kernel_stream { + int fd; + char *pathname; + int state; + struct cds_list_head list; }; /* Kernel session */ struct ltt_kernel_session { int fd; - struct ltt_kernel_channel *channel; + int metadata_stream_fd; + unsigned int channel_count; + unsigned int stream_count_global; + struct ltt_kernel_metadata *metadata; + struct ltt_kernel_channel_list channel_list; }; /* UST trace representation */ @@ -63,10 +103,24 @@ struct ltt_ust_marker { char *channel; }; -int get_trace_count_per_session(struct ltt_session *session); -void get_traces_per_session(struct ltt_session *session, struct lttng_trace *traces); -int ust_create_trace(struct command_ctx *cmd_ctx); -int ust_start_trace(struct command_ctx *cmd_ctx); -int ust_stop_trace(struct command_ctx *cmd_ctx); +/* + * Create functions malloc() the data structure. + */ +struct ltt_kernel_session *trace_create_kernel_session(void); +struct ltt_kernel_channel *trace_create_kernel_channel(void); +struct ltt_kernel_event *trace_create_kernel_event(char *name, + enum lttng_kernel_instrumentation type); +struct ltt_kernel_metadata *trace_create_kernel_metadata(void); +struct ltt_kernel_stream *trace_create_kernel_stream(void); + +/* + * Destroy functions free() the data structure and remove from linked list if + * it's applies. + */ +void trace_destroy_kernel_session(struct ltt_kernel_session *session); +void trace_destroy_kernel_metadata(struct ltt_kernel_metadata *metadata); +void trace_destroy_kernel_channel(struct ltt_kernel_channel *channel); +void trace_destroy_kernel_event(struct ltt_kernel_event *event); +void trace_destroy_kernel_stream(struct ltt_kernel_stream *stream); #endif /* _LTT_TRACE_H */