All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Donnefort <vdonnefort@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH v2 1/2] ring-buffer: Introducing ring-buffer mapping functions
Date: Wed, 29 Mar 2023 16:08:17 +0100	[thread overview]
Message-ID: <ZCRUYQHORVund9PC@google.com> (raw)
In-Reply-To: <ZCRDXaTVfNwxdRJZ@google.com>

On Wed, Mar 29, 2023 at 02:55:41PM +0100, Vincent Donnefort wrote:
> On Wed, Mar 29, 2023 at 09:36:46AM -0400, Steven Rostedt wrote:
> > On Wed, 29 Mar 2023 14:31:07 +0100
> > Vincent Donnefort <vdonnefort@google.com> wrote:
> > 
> > > We can say we update cpu_buffer->reader_page->read on the get_reader_page ioctl,
> > > to the most recent value possible, which will have the consequence of actually
> > > "flushing" those events?
> > 
> > Yes. It should be no different than doing a normal read of the
> > trace_pipe_raw file, which does the same.
> > 
> > > 
> > > If the reader decides to read events past this value then it just can't expect
> > > them to not be duplicated?
> > > 
> > > I suppose it'd be down the reader to store meta->read somehwere?
> > > 
> > >    prev_read = meta->read
> > >    ioctl(fd, TRACE_MMAP_IOCTL_GET_READER_PAGE)
> > >    /* read events from prev_read to meta->read */
> > 
> > Yes, in fact it shouldn't need to call the ioctl until after it read it.
> > 
> > Maybe, we should have the ioctl take a parameter of how much was read?
> > To prevent races?
> 
> Races would only be with other consuming readers. In that case we'd probably
> have many other problems anyway as I suppose nothing would prevent another one
> of swapping the page while our userspace reader is still processing it?
> 
> I don't know if this is worth splitting the ABI between the meta-page and the
> ioctl parameters for this?
> 
> Or maybe we should say the meta-page contains things modified by the writer and
> parameters modified by the reader are passed by the get_reader_page ioctl i.e.
> the reader page ID and cpu_buffer->reader_page->read? (for the hyp tracing, we
> have up to 4 registers for the HVC which would replace in our case the ioctl)

Or we can keep everything in the meta-page but update the "reader bits" only
during the get_reader_page ioctl.

I can prepare something around those lines for the v3.

> 
> > 
> > That is, it should pass in the page->commit that it used to to read the
> > pages.
> > 
> > -- Steve

  reply	other threads:[~2023-03-29 15:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 10:22 [PATCH v2 0/2] Introducing trace buffer mapping by user-space Vincent Donnefort
2023-03-22 10:22 ` [PATCH v2 1/2] ring-buffer: Introducing ring-buffer mapping functions Vincent Donnefort
2023-03-29  2:44   ` Steven Rostedt
2023-03-29  9:19     ` Vincent Donnefort
2023-03-29 11:03       ` Steven Rostedt
2023-03-29 12:07         ` Steven Rostedt
2023-03-29 12:27           ` Vincent Donnefort
2023-03-29 12:23         ` Vincent Donnefort
2023-03-29 12:47           ` Steven Rostedt
2023-03-29 13:10             ` Vincent Donnefort
2023-03-29 13:14               ` Steven Rostedt
2023-03-30 14:48             ` Vincent Donnefort
2023-03-29 12:51         ` Steven Rostedt
2023-03-29 13:01           ` Vincent Donnefort
2023-03-29 13:11             ` Steven Rostedt
2023-03-29 13:31               ` Vincent Donnefort
2023-03-29 13:36                 ` Steven Rostedt
2023-03-29 13:55                   ` Vincent Donnefort
2023-03-29 15:08                     ` Vincent Donnefort [this message]
2023-03-29 15:32                     ` Steven Rostedt
2023-03-30 10:30                       ` Vincent Donnefort
2023-03-30 15:21                         ` Steven Rostedt
2023-03-22 10:22 ` [PATCH v2 2/2] tracing: Allow user-space mapping of the ring-buffer Vincent Donnefort

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=ZCRUYQHORVund9PC@google.com \
    --to=vdonnefort@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.