From: Julien Desfossez Date: Wed, 29 Jun 2011 21:13:49 +0000 (-0400) Subject: Update ABI to select the output method X-Git-Tag: v2.0-pre1~26 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=96ba7208aa8009345a525148e32f78cd8d4693ab;p=lttng-modules.git Update ABI to select the output method Add output selection in lttng_kernel_channel to use mmap or splice. [ Merged, with a slight change: specified the enum values. ] Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index 6327d09a..0aa2cec0 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -289,12 +289,24 @@ int lttng_abi_create_channel(struct file *session_file, } switch (channel_type) { case PER_CPU_CHANNEL: - transport_name = chan_param.overwrite ? - "relay-overwrite" : "relay-discard"; + if (chan_param.output == LTTNG_KERNEL_SPLICE) { + transport_name = chan_param.overwrite ? + "relay-overwrite" : "relay-discard"; + } else if (chan_param.output == LTTNG_KERNEL_MMAP) { + transport_name = chan_param.overwrite ? + "relay-overwrite-mmap" : "relay-discard-mmap"; + } else { + return -EINVAL; + } fops = <tng_channel_fops; break; case METADATA_CHANNEL: - transport_name = "relay-metadata"; + if (chan_param.output == LTTNG_KERNEL_SPLICE) + transport_name = "relay-metadata"; + else if (chan_param.output == LTTNG_KERNEL_MMAP) + transport_name = "relay-metadata-mmap"; + else + return -EINVAL; fops = <tng_metadata_fops; break; default: diff --git a/ltt-debugfs-abi.h b/ltt-debugfs-abi.h index 9524cb03..e5ddcfa0 100644 --- a/ltt-debugfs-abi.h +++ b/ltt-debugfs-abi.h @@ -21,6 +21,14 @@ enum lttng_kernel_instrumentation { LTTNG_KERNEL_FUNCTION = 2, }; +/* + * LTTng consumer mode + */ +enum lttng_kernel_output { + LTTNG_KERNEL_SPLICE = 0, + LTTNG_KERNEL_MMAP = 1, +}; + /* * LTTng DebugFS ABI structures. */ @@ -31,6 +39,7 @@ struct lttng_kernel_channel { uint64_t num_subbuf; unsigned int switch_timer_interval; /* usecs */ unsigned int read_timer_interval; /* usecs */ + enum lttng_kernel_output output; /* splice, mmap */ }; /*