Add kernel trace data structure init functions
[lttng-tools.git] / ltt-sessiond / trace.h
index 910d38f041d55649742adf97588ae0e2b514d075..488fd757d3dfabf4d06a894ad2375876f6857cf6 100644 (file)
 #ifndef _LTT_TRACE_H
 #define _LTT_TRACE_H
 
-#include "ltt-sessiond.h"
-#include "session.h"
+#include <limits.h>
+#include <urcu/list.h>
 #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 {
        int fd;
@@ -38,21 +55,37 @@ struct ltt_kernel_event {
 /* Kernel channel */
 struct ltt_kernel_channel {
        int fd;
+       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;
+       int metadata_stream_fd;
+       unsigned int channel_count;
+       unsigned int stream_count_global;
        struct ltt_kernel_metadata *metadata;
-       struct ltt_kernel_channel *channel;
+       struct ltt_kernel_channel_list channel_list;
 };
 
 /* UST trace representation */
@@ -70,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);
+/*
+ * Function prototype
+ */
+
+/* Kernel session */
+struct ltt_kernel_session *trace_create_kernel_session(void);
+
+/* Kernel channel */
+struct ltt_kernel_channel *trace_create_kernel_channel(void);
+
+/* Kernel event */
+struct ltt_kernel_event *trace_create_kernel_event(char *name,
+               enum lttng_kernel_instrumentation type);
+
+/* Kernel metadata */
+struct ltt_kernel_metadata *trace_create_kernel_metadata(void);
+
+/* Kernel stream */
+struct ltt_kernel_stream *trace_create_kernel_stream(void);
 
 #endif /* _LTT_TRACE_H */
This page took 0.024588 seconds and 4 git commands to generate.