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 1/5] ring-buffer: have benchmark test handle discarded events
Date: Tue, 16 Jun 2009 13:51:34 -0400	[thread overview]
Message-ID: <20090616175323.176206738@goodmis.org> (raw)
In-Reply-To: 20090616175133.317996432@goodmis.org

[-- Attachment #1: 0001-ring-buffer-have-benchmark-test-handle-discarded-eve.patch --]
[-- Type: text/plain, Size: 1640 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

With the addition of commit:

  c7b0930857e2278f2e7714db6294e94c57f623b0
  ring-buffer: prevent adding write in discarded area

The ring buffer may now add discarded events when a write passes
the end of a buffer page. Before, a discarded event was only added
when the tracer deliberately created one. The ring buffer benchmark
test does not handle discarded events when it reads the buffer and
fails when it encounters one.

Also fix the increment for large data entries (luckily, the test did
not add any yet).

[ Impact: fix false failure of ring buffer self test ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ring_buffer_benchmark.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c
index 8d68e14..cf6b0f5 100644
--- a/kernel/trace/ring_buffer_benchmark.c
+++ b/kernel/trace/ring_buffer_benchmark.c
@@ -102,8 +102,10 @@ static enum event_status read_page(int cpu)
 			event = (void *)&rpage->data[i];
 			switch (event->type_len) {
 			case RINGBUF_TYPE_PADDING:
-				/* We don't expect any padding */
-				KILL_TEST();
+				/* failed writes may be discarded events */
+				if (!event->time_delta)
+					KILL_TEST();
+				inc = event->array[0] + 4;
 				break;
 			case RINGBUF_TYPE_TIME_EXTEND:
 				inc = 8;
@@ -119,7 +121,7 @@ static enum event_status read_page(int cpu)
 					KILL_TEST();
 					break;
 				}
-				inc = event->array[0];
+				inc = event->array[0] + 4;
 				break;
 			default:
 				entry = ring_buffer_event_data(event);
-- 
1.6.3.1

-- 

  reply	other threads:[~2009-06-16 17:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 17:51 [PATCH 0/5] [GIT PULL] tracing/filters/ringbuffer: updates for 2.6.31 Steven Rostedt
2009-06-16 17:51 ` Steven Rostedt [this message]
2009-06-16 17:51 ` [PATCH 2/5] ring-buffer: remove unused variable Steven Rostedt
2009-06-16 17:51 ` [PATCH 3/5] ring-buffer: use commit counters for commit pointer accounting Steven Rostedt
2009-06-16 17:51 ` [PATCH 4/5] tracing/filters: free filter_string in destroy_preds() Steven Rostedt
2009-06-16 17:51 ` [PATCH 5/5] tracing/filters: fix race between filter setting and module unload Steven Rostedt
2009-06-16 19:28 ` [PATCH 0/5] [GIT PULL] tracing/filters/ringbuffer: updates for 2.6.31 Ingo Molnar
2009-06-16 19:36   ` Ingo Molnar
2009-06-16 19:48     ` Steven Rostedt
2009-06-16 19:58       ` 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=20090616175323.176206738@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