From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Matt Fleming <mjf@gentoo.org>, Dave Airlie <airlied@gmail.com>
Subject: [PATCH 1/3] ring-buffer: fix check of try_to_discard result
Date: Wed, 05 Aug 2009 22:52:07 -0400 [thread overview]
Message-ID: <20090806025300.459675256@goodmis.org> (raw)
In-Reply-To: 20090806025206.306150861@goodmis.org
[-- Attachment #1: 0001-ring-buffer-fix-check-of-try_to_discard-result.patch --]
[-- Type: text/plain, Size: 994 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
The function ring_buffer_discard_commit inversed the code path
of the result of try_to_discard. It should skip incrementing the
entry counter if try_to_discard succeeded. But instead, it increments
the entry conder if it succeeded to discard, and does not increment
it if it fails.
The result of this bug is that filtering will make the stat counters
incorrect.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/ring_buffer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index bf27bb7..2fd1752 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1785,7 +1785,7 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer,
*/
RB_WARN_ON(buffer, !local_read(&cpu_buffer->committing));
- if (!rb_try_to_discard(cpu_buffer, event))
+ if (rb_try_to_discard(cpu_buffer, event))
goto out;
/*
--
1.6.3.3
--
next prev parent reply other threads:[~2009-08-06 2:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 2:52 [PATCH 0/3] [GIT PULL][2.6.31] ring-buffer/tracing: various fixes Steven Rostedt
2009-08-06 2:52 ` Steven Rostedt [this message]
2009-08-06 2:52 ` [PATCH 2/3] ring-buffer: do not disable ring buffer on oops_in_progress Steven Rostedt
2009-08-06 2:52 ` [PATCH 3/3] tracing: do not use functions starting with .L in recordmcount.pl Steven Rostedt
2009-08-06 4:11 ` [PATCH 0/3] [GIT PULL][2.6.31] ring-buffer/tracing: various fixes Robert Richter
2009-08-06 12:22 ` Ingo Molnar
2009-08-06 19:12 ` Steven Rostedt
2009-08-06 12:21 ` 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=20090806025300.459675256@goodmis.org \
--to=rostedt@goodmis.org \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mjf@gentoo.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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