From: Julien Desfossez Date: Wed, 29 Jun 2011 21:03:23 +0000 (-0400) Subject: Add channel output method selection X-Git-Tag: v2.0-pre1~65 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b9f1dd6997ea64db8c140c617d2a74cf90767e3b;p=lttng-tools.git Add channel output method selection Sync with kernel code to select the output mode between splice and mmap. Splice remains the default method. Signed-off-by: Julien Desfossez --- diff --git a/include/lttng-share.h b/include/lttng-share.h index d6bb0532a..cd971c355 100644 --- a/include/lttng-share.h +++ b/include/lttng-share.h @@ -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 diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index d7799780a..c04d1b4ea 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -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 */ }; /* diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index 638536604..92e41b1c6 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -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; diff --git a/ltt-sessiond/trace.c b/ltt-sessiond/trace.c index 1ab2857ce..8b7be9215 100644 --- a/ltt-sessiond/trace.c +++ b/ltt-sessiond/trace.c @@ -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; diff --git a/lttng/commands/add_channel.c b/lttng/commands/add_channel.c index ea7db820e..0cc8e4baa 100644 --- a/lttng/commands/add_channel.c +++ b/lttng/commands/add_channel.c @@ -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; } /*