Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [ltt-dev] [LTTNG-MODULES v2 2/2] Update ABI to select the output method
Date: Wed, 29 Jun 2011 17:11:29 -0400	[thread overview]
Message-ID: <20110629211129.GB31053@Krystal> (raw)
In-Reply-To: <1309380815-23597-2-git-send-email-julien.desfossez@polymtl.ca>

* Julien Desfossez (julien.desfossez at polymtl.ca) wrote:
> Add output selection in lttng_kernel_channel to use mmap or splice.
> 

Merged, with a slight change: specified the enum values. Thanks,

Mathieu

> Signed-off-by: Julien Desfossez <julien.desfossez at polymtl.ca>
> ---
>  ltt-debugfs-abi.c |   18 +++++++++++++++---
>  ltt-debugfs-abi.h |    9 +++++++++
>  2 files changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c
> index 6327d09..0aa2cec 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 = &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:
> diff --git a/ltt-debugfs-abi.h b/ltt-debugfs-abi.h
> index e3a7160..e333655 100644
> --- a/ltt-debugfs-abi.h
> +++ b/ltt-debugfs-abi.h
> @@ -22,6 +22,14 @@ enum lttng_kernel_instrumentation {
>  };
>  
>  /*
> + * LTTng consumer mode
> + */
> +enum lttng_kernel_output {
> +	LTTNG_KERNEL_SPLICE,
> +	LTTNG_KERNEL_MMAP,
> +};
> +
> +/*
>   * 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 */
>  };
>  
>  /*
> -- 
> 1.7.4.1
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




  reply	other threads:[~2011-06-29 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 20:53 [ltt-dev] [LTTNG-MODULES PATCH v2 1/2] Add mmap client mode Julien Desfossez
2011-06-29 20:53 ` [ltt-dev] [LTTNG-MODULES v2 2/2] Update ABI to select the output method Julien Desfossez
2011-06-29 21:11   ` Mathieu Desnoyers [this message]
2011-06-29 21:10 ` [ltt-dev] [LTTNG-MODULES PATCH v2 1/2] Add mmap client mode Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110629211129.GB31053@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox