Change kernel traces output directory
[lttng-tools.git] / ltt-sessiond / trace.h
index 444126ba01e4322c7727a3341f85fd13467e8e90..591af85730299c8c0832d11ab303236d4aeaed6d 100644 (file)
@@ -3,8 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation; only version 2
+ * of the License.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 #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 */
+#include <lttng/lttng.h>
+
+#include "lttng-kernel.h"
 
 /* Kernel event list */
 struct ltt_kernel_event_list {
@@ -48,6 +44,8 @@ struct ltt_kernel_channel_list {
 /* Kernel event */
 struct ltt_kernel_event {
        int fd;
+       int enabled;
+       struct lttng_kernel_context *ctx;
        struct lttng_kernel_event *event;
        struct cds_list_head list;
 };
@@ -55,9 +53,12 @@ struct ltt_kernel_event {
 /* Kernel channel */
 struct ltt_kernel_channel {
        int fd;
+       int enabled;
        char *pathname;
        unsigned int stream_count;
-       struct lttng_kernel_channel *channel;
+       unsigned int event_count;
+       struct lttng_kernel_context *ctx;
+       struct lttng_channel *channel;
        struct ltt_kernel_event_list events_list;
        struct ltt_kernel_stream_list stream_list;
        struct cds_list_head list;
@@ -67,7 +68,7 @@ struct ltt_kernel_channel {
 struct ltt_kernel_metadata {
        int fd;
        char *pathname;
-       struct lttng_kernel_channel *conf;
+       struct lttng_channel *conf;
 };
 
 /* Channel stream */
@@ -82,8 +83,10 @@ struct ltt_kernel_stream {
 struct ltt_kernel_session {
        int fd;
        int metadata_stream_fd;
+       int kconsumer_fds_sent;
        unsigned int channel_count;
        unsigned int stream_count_global;
+       char *trace_path;
        struct ltt_kernel_metadata *metadata;
        struct ltt_kernel_channel_list channel_list;
 };
@@ -103,14 +106,21 @@ struct ltt_ust_marker {
        char *channel;
 };
 
+/*
+ * Get functions.
+ */
+struct ltt_kernel_event *get_kernel_event_by_name(
+               char *name, struct ltt_kernel_channel *channel);
+struct ltt_kernel_channel *get_kernel_channel_by_name(
+               char *name, struct ltt_kernel_session *session);
+
 /*
  * 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_channel *trace_create_kernel_channel(struct lttng_channel *chan, char *path);
+struct ltt_kernel_event *trace_create_kernel_event(struct lttng_event *ev);
+struct ltt_kernel_metadata *trace_create_kernel_metadata(char *path);
 struct ltt_kernel_stream *trace_create_kernel_stream(void);
 
 /*
This page took 0.023932 seconds and 4 git commands to generate.