From: Vincent Donnefort <vdonnefort@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH] libtracefs: Update the kbuf for previous read in trace_mmap_load_subbuf()
Date: Wed, 24 Jan 2024 17:54:00 +0000 [thread overview]
Message-ID: <ZbFOuC0ak6JiOGCJ@google.com> (raw)
In-Reply-To: <20240124115651.6a00a668@gandalf.local.home>
On Wed, Jan 24, 2024 at 11:56:51AM -0500, Steven Rostedt wrote:
> On Tue, 23 Jan 2024 17:41:59 +0000
> Vincent Donnefort <vdonnefort@google.com> wrote:
>
> > On Tue, Jan 23, 2024 at 12:33:37PM -0500, Steven Rostedt wrote:
> > > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> > >
> > > The trace_mmap() checks if the mmapped data has any previously read data
> > > (the reader.read value of the meta page is non-zero), then it will pre-read
> > > the kbuf to move its internal reader pointer to the same value.
> > >
> > > But when tracefs_cpu_read_buf() calls trace_mmap_load_subbuf(), its
> > > kbuf->subbuffer will not be the same as the mapped data and
> > > kbuffer_load_subbuffer() is called on it and it is returned. But that means
> > > its read pointer has not been updated, and the read data will restart again.
> > >
> > > When the kbuf is updated in trace_mmap_load_subbuf() check the tmap->kbuf to
> > > see if it already read any of the data, and move the kbuffer forward just
> > > like the trace_mmap() does.
> > >
> > > Link: https://lore.kernel.org/linux-trace-devel/Za-Md51snPcIoYFn@google.com/
> > >
> > > Fixes: 2ed14b59 ("libtracefs: Add ring buffer memory mapping APIs")
> > > Reported-by: Vincent Donnefort <vdonnefort@google.com>
> > > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> >
> > That fixes fast-forward, event already read are now skipped.
>
> Can I also add your "Tested-by" tag then?
>
> -- Steve
Of course, I wasn't sure you were using those tags for libtracefs. Will make it
more explicit next time!
next prev parent reply other threads:[~2024-01-24 17:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 17:33 [PATCH] libtracefs: Update the kbuf for previous read in trace_mmap_load_subbuf() Steven Rostedt
2024-01-23 17:41 ` Vincent Donnefort
2024-01-24 16:56 ` Steven Rostedt
2024-01-24 17:54 ` Vincent Donnefort [this message]
2024-01-24 17:58 ` Steven Rostedt
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=ZbFOuC0ak6JiOGCJ@google.com \
--to=vdonnefort@google.com \
--cc=linux-trace-devel@vger.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.