Update ABI to select the output method
authorJulien Desfossez <julien.desfossez@polymtl.ca>
Wed, 29 Jun 2011 21:13:49 +0000 (17:13 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 29 Jun 2011 21:13:49 +0000 (17:13 -0400)
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 <julien.desfossez@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-debugfs-abi.c
ltt-debugfs-abi.h

index 6327d09a65d713fde5e6dd36dbf269163f9ad257..0aa2cec03381ea0f58d121f1136cc6e7544b9455 100644 (file)
@@ -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 = &lttng_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 = &lttng_metadata_fops;
                break;
        default:
index 9524cb03f6d7a5e83b2b0ae730db279a2cb0ed80..e5ddcfa0965ded2110b8c2bfa12aa04c6c763272 100644 (file)
@@ -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 */
 };
 
 /*
This page took 0.027436 seconds and 4 git commands to generate.