public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 5/8] ring-buffer: Make benchmark handle missed events
Date: Tue, 27 Apr 2010 21:27:28 -0400	[thread overview]
Message-ID: <20100428013806.758542898@goodmis.org> (raw)
In-Reply-To: 20100428012723.119106602@goodmis.org

[-- Attachment #1: 0005-ring-buffer-Make-benchmark-handle-missed-events.patch --]
[-- Type: text/plain, Size: 1354 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

With the addition of the "missed events" flags that is stored in the
commit field of the ring buffer page, the ring_buffer_benchmark
was not updated to handle this. If events are missed, then the
missed events flag is set in the ring buffer page, the benchmark
will count that flag as part of the size of the page and will hit the BUG()
when it tries to read beyond the page.

The solution is simply to have the ring buffer benchmark mask off
the extra bits.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ring_buffer_benchmark.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c
index dc56556..302f8a6 100644
--- a/kernel/trace/ring_buffer_benchmark.c
+++ b/kernel/trace/ring_buffer_benchmark.c
@@ -113,7 +113,8 @@ static enum event_status read_page(int cpu)
 	ret = ring_buffer_read_page(buffer, &bpage, PAGE_SIZE, cpu, 1);
 	if (ret >= 0) {
 		rpage = bpage;
-		commit = local_read(&rpage->commit);
+		/* The commit may have missed event flags set, clear them */
+		commit = local_read(&rpage->commit) & 0xfffff;
 		for (i = 0; i < commit && !kill_test; i += inc) {
 
 			if (i >= (PAGE_SIZE - offsetof(struct rb_page, data))) {
-- 
1.7.0



  parent reply	other threads:[~2010-04-28  1:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28  1:27 [PATCH 0/8] [GIT PULL] tracing: various updates Steven Rostedt
2010-04-28  1:27 ` [PATCH 1/8] tracing: Add ftrace events for graph tracer Steven Rostedt
2010-04-28  1:27 ` [PATCH 2/8] tracing: Have graph flags passed in to ouput functions Steven Rostedt
2010-04-28  1:27 ` [PATCH 3/8] tracing: Add graph output support for irqsoff tracer Steven Rostedt
2010-04-28  1:27 ` [PATCH 4/8] ring-buffer: Make non-consuming read less expensive with lots of cpus Steven Rostedt
2010-04-28  1:27 ` Steven Rostedt [this message]
2010-04-28  1:27 ` [PATCH 6/8] tracing: Add documentation for trace commands mod, traceon/traceoff Steven Rostedt
2010-04-28  1:27 ` [PATCH 7/8] tracing: Show sample std dev in function profiling Steven Rostedt
2010-04-28  1:27 ` [PATCH 8/8] tracing: Fix sleep time " Steven Rostedt
2010-04-30  8:00 ` [PATCH 0/8] [GIT PULL] tracing: various updates Ingo Molnar
2010-04-30  9:47   ` 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=20100428013806.758542898@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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