public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <rric@kernel.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
	Stephane Eranian <eranian@google.com>,
	Andi Kleen <ak@linux.intel.com>, Borislav Petkov <bp@alien8.de>
Subject: Re: [RFC 1/2] perf: add data_{offset,size} to user_page
Date: Thu, 15 May 2014 20:14:02 +0200	[thread overview]
Message-ID: <20140515181402.GB7541@rric.localhost> (raw)
In-Reply-To: <1400166510-9234-2-git-send-email-alexander.shishkin@linux.intel.com>

On 15.05.14 18:08:29, Alexander Shishkin wrote:
> @@ -488,9 +488,14 @@ struct perf_event_mmap_page {
>  	 * In this case the kernel will not over-write unread data.
>  	 *
>  	 * See perf_output_put_handle() for the data ordering.
> +	 *
> +	 * data_{offset,size} indicate the location and size of the perf record
> +	 * buffer within the mmapped area.
>  	 */
>  	__u64   data_head;		/* head in the data section */
>  	__u64	data_tail;		/* user-space written tail */
> +	__u64	data_offset;		/* where the buffer starts */
> +	__u64	data_size;		/* data buffer size */
>  };

Yeah, we need something like this also for other reasons. For
persistent events we don't know the buffer size when mmaping
existing/shared buffers. To determine the buffer size we could map the
first page only, read the size and then mremap() to the actual size.

Please keep this use case in mind too, also for the aux buffer. The
best would be if data_size is the mmap size.

Thanks,

-Robert

  reply	other threads:[~2014-05-15 18:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 15:08 [RFC 0/2] perf: add AUX space to ring_buffer Alexander Shishkin
2014-05-15 15:08 ` [RFC 1/2] perf: add data_{offset,size} to user_page Alexander Shishkin
2014-05-15 18:14   ` Robert Richter [this message]
2014-05-15 15:08 ` [RFC 2/2] perf: add AUX area to ring buffer for raw data streams Alexander Shishkin
2014-05-15 18:02   ` Robert Richter
2014-05-16  7:07     ` Alexander Shishkin
2014-05-19  8:58   ` Peter Zijlstra
2014-05-19 12:57     ` Alexander Shishkin
2014-05-20  9:51       ` Peter Zijlstra
2014-05-21 14:02         ` Alexander Shishkin
2014-06-05 11:58           ` Ingo Molnar

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=20140515181402.GB7541@rric.localhost \
    --to=rric@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    /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