mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "J. Avila" <elavila@google.com>,
	mingo@redhat.com, john.stultz@linaro.org,
	linux-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: Potential Issue in Tracing Ring Buffer
Date: Thu, 26 Nov 2020 13:26:13 -0500	[thread overview]
Message-ID: <20201126132613.7f737afe@oasis.local.home> (raw)
In-Reply-To: <X79CrSX1rnpnbqPd@kroah.com>

On Thu, 26 Nov 2020 06:52:45 +0100
Greg KH <gregkh@linuxfoundation.org> wrote:

> On Tue, Nov 24, 2020 at 10:39:17PM +0000, J. Avila wrote:
> > Hello,
> > 
> > In the ftrace logs we've collected internally, we have found that there are
> > situations where time seems to go backwards; this breaks userspace tools which
> > expect time to always go forward in these logs. For example, in this snippet
> > from a db845c running a 5.10-rc4 kernel[1] (thanks for getting us the trace,
> > John!), we see:  
> 
> Does the patch at:
> 	https://lore.kernel.org/r/20201125225654.1618966-1-minchan@kernel.org
> 
> resolve this issue for you?
> 

I think I found the bug. Can you apply this patch and let me know if it
fixes the issue for you?

-- Steve

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index dc83b3fa9fe7..bccaf88d3706 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -3291,7 +3291,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
 			/* Nothing came after this event between C and E */
 			info->delta = ts - info->after;
 			(void)rb_time_cmpxchg(&cpu_buffer->write_stamp,
-					      info->after, info->ts);
+					      info->after, ts);
 			info->ts = ts;
 		} else {
 			/*


  reply	other threads:[~2020-11-26 18:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 22:39 J. Avila
2020-11-25  0:56 ` Steven Rostedt
2020-11-26  5:52 ` Greg KH
2020-11-26 18:26   ` Steven Rostedt [this message]
2020-11-30 14:48     ` Steven Rostedt
2020-11-30 18:13       ` William Mcvicker
2020-12-08 19:37         ` J. Avila
2020-12-08 20:00           ` 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=20201126132613.7f737afe@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=elavila@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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

all inboxes | Powered by JetHome®