Add channel output method selection
authorJulien Desfossez <julien.desfossez@polymtl.ca>
Wed, 29 Jun 2011 21:03:23 +0000 (17:03 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Thu, 30 Jun 2011 15:03:55 +0000 (11:03 -0400)
Sync with kernel code to select the output mode between splice and mmap.
Splice remains the default method.

Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
include/lttng-share.h
include/lttng/lttng.h
ltt-sessiond/main.c
ltt-sessiond/trace.c
lttng/commands/add_channel.c

index d6bb0532a234d670d39cbf751777bb0736dd5793..cd971c355044d9351dcd42f72f9b086df8f93a12 100644 (file)
@@ -36,6 +36,7 @@ typedef __s64 s64;
 #define DEFAULT_CHANNEL_SUBBUF_NUM           8       /* Must always be a power of 2 */
 #define DEFAULT_CHANNEL_SWITCH_TIMER         0       /* usec */
 #define DEFAULT_CHANNEL_READ_TIMER           200     /* usec */
+#define DEFAULT_CHANNEL_OUTPUT               0       /* splice, mmap (0: SPLICE, 1: MMAP, see lttng.h) */
 
 /*
  * lttng user-space instrumentation type
index d7799780a793148bacb47e4aed8a9bf13ba32443..c04d1b4eadb7d996b752570c85d406544ac0f290 100644 (file)
@@ -73,6 +73,14 @@ struct lttng_kernel_context {
        } u;
 };
 
+/*
+ * LTTng consumer mode
+ */
+enum lttng_kernel_output {
+       LTTNG_KERNEL_SPLICE       = 0,
+       LTTNG_KERNEL_MMAP         = 1,
+};
+
 /*
  * Either addr is used or symbol_name and offset.
  */
@@ -110,6 +118,7 @@ struct lttng_channel_attr {
        uint64_t num_subbuf;                       /* power of 2 */
        unsigned int switch_timer_interval;   /* usec */
        unsigned int read_timer_interval;     /* usec */
+       enum lttng_kernel_output output;        /* splice, mmap */
 };
 
 /*
index 6385366047c53d785d8a080a5a67433046063477..92e41b1c6aff91b1573843079cfd3420b38dc275 100644 (file)
@@ -720,6 +720,7 @@ static struct lttng_channel *init_default_channel(void)
        chan->attr.num_subbuf = DEFAULT_CHANNEL_SUBBUF_NUM;
        chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
        chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
+       chan->attr.output = DEFAULT_CHANNEL_OUTPUT;
 
 error:
        return chan;
index 1ab2857ce2a2328050d6fde0d8c70809d85ecbda..8b7be9215eeef9d3d8625e66e38bde3e5ccdbe23 100644 (file)
@@ -236,6 +236,7 @@ struct ltt_kernel_metadata *trace_create_kernel_metadata(void)
        chan->attr.num_subbuf = DEFAULT_CHANNEL_SUBBUF_NUM;
        chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
        chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
+       chan->attr.output = DEFAULT_CHANNEL_OUTPUT;
 
        /* Init metadata */
        lkm->fd = 0;
index ea7db820e0a1006ec754e6fd828cad7c9fa9e417..0cc8e4baa0b43ff2e1757d6d2e3926e62a1d6562 100644 (file)
@@ -144,6 +144,7 @@ static void init_channel_config(void)
        chan.attr.num_subbuf = DEFAULT_CHANNEL_SUBBUF_NUM;
        chan.attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
        chan.attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
+       chan.attr.output = DEFAULT_CHANNEL_OUTPUT;
 }
 
 /*
This page took 0.038515 seconds and 4 git commands to generate.