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 7/7] ring-buffer: have benchmark test print to trace buffer
Date: Wed, 17 Jun 2009 19:26:02 -0400 [thread overview]
Message-ID: <20090617232630.908465956@goodmis.org> (raw)
In-Reply-To: 20090617232555.164629684@goodmis.org
[-- Attachment #1: 0007-ring-buffer-have-benchmark-test-print-to-trace-buffe.patch --]
[-- Type: text/plain, Size: 3826 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Currently the output of the ring buffer benchmark/test prints to
the console. This test runs for ten seconds every ten seconds and
ouputs the result after every iteration. This needlessly fills up
the logs.
This patch makes the ring buffer benchmark/test print to the ftrace
buffer using trace_printk. To view the test results, you must examine
the debug/tracing/trace file.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/ring_buffer_benchmark.c | 37 +++++++++++++++++----------------
1 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c
index cf6b0f5..573d3cc 100644
--- a/kernel/trace/ring_buffer_benchmark.c
+++ b/kernel/trace/ring_buffer_benchmark.c
@@ -203,7 +203,7 @@ static void ring_buffer_producer(void)
* Hammer the buffer for 10 secs (this may
* make the system stall)
*/
- pr_info("Starting ring buffer hammer\n");
+ trace_printk("Starting ring buffer hammer\n");
do_gettimeofday(&start_tv);
do {
struct ring_buffer_event *event;
@@ -239,7 +239,7 @@ static void ring_buffer_producer(void)
#endif
} while (end_tv.tv_sec < (start_tv.tv_sec + RUN_TIME) && !kill_test);
- pr_info("End ring buffer hammer\n");
+ trace_printk("End ring buffer hammer\n");
if (consumer) {
/* Init both completions here to avoid races */
@@ -262,49 +262,50 @@ static void ring_buffer_producer(void)
overruns = ring_buffer_overruns(buffer);
if (kill_test)
- pr_info("ERROR!\n");
- pr_info("Time: %lld (usecs)\n", time);
- pr_info("Overruns: %lld\n", overruns);
+ trace_printk("ERROR!\n");
+ trace_printk("Time: %lld (usecs)\n", time);
+ trace_printk("Overruns: %lld\n", overruns);
if (disable_reader)
- pr_info("Read: (reader disabled)\n");
+ trace_printk("Read: (reader disabled)\n");
else
- pr_info("Read: %ld (by %s)\n", read,
+ trace_printk("Read: %ld (by %s)\n", read,
read_events ? "events" : "pages");
- pr_info("Entries: %lld\n", entries);
- pr_info("Total: %lld\n", entries + overruns + read);
- pr_info("Missed: %ld\n", missed);
- pr_info("Hit: %ld\n", hit);
+ trace_printk("Entries: %lld\n", entries);
+ trace_printk("Total: %lld\n", entries + overruns + read);
+ trace_printk("Missed: %ld\n", missed);
+ trace_printk("Hit: %ld\n", hit);
/* Convert time from usecs to millisecs */
do_div(time, USEC_PER_MSEC);
if (time)
hit /= (long)time;
else
- pr_info("TIME IS ZERO??\n");
+ trace_printk("TIME IS ZERO??\n");
- pr_info("Entries per millisec: %ld\n", hit);
+ trace_printk("Entries per millisec: %ld\n", hit);
if (hit) {
/* Calculate the average time in nanosecs */
avg = NSEC_PER_MSEC / hit;
- pr_info("%ld ns per entry\n", avg);
+ trace_printk("%ld ns per entry\n", avg);
}
if (missed) {
if (time)
missed /= (long)time;
- pr_info("Total iterations per millisec: %ld\n", hit + missed);
+ trace_printk("Total iterations per millisec: %ld\n",
+ hit + missed);
/* it is possible that hit + missed will overflow and be zero */
if (!(hit + missed)) {
- pr_info("hit + missed overflowed and totalled zero!\n");
+ trace_printk("hit + missed overflowed and totalled zero!\n");
hit--; /* make it non zero */
}
/* Caculate the average time in nanosecs */
avg = NSEC_PER_MSEC / (hit + missed);
- pr_info("%ld ns per entry\n", avg);
+ trace_printk("%ld ns per entry\n", avg);
}
}
@@ -355,7 +356,7 @@ static int ring_buffer_producer_thread(void *arg)
ring_buffer_producer();
- pr_info("Sleeping for 10 secs\n");
+ trace_printk("Sleeping for 10 secs\n");
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ * SLEEP_TIME);
__set_current_state(TASK_RUNNING);
--
1.6.3.1
--
next prev parent reply other threads:[~2009-06-17 23:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 23:25 [PATCH 0/7] [GIT PULL][for 2.6.31] ring-buffer: various clean ups Steven Rostedt
2009-06-17 23:25 ` [PATCH 1/7] ring-buffer: use BUF_PAGE_HDR_SIZE in calculating index Steven Rostedt
2009-06-17 23:25 ` [PATCH 2/7] ring-buffer: remove useless warn on check Steven Rostedt
2009-06-17 23:25 ` [PATCH 3/7] ring-buffer: remove useless compile check for buffer_page size Steven Rostedt
2009-06-17 23:25 ` [PATCH 4/7] ring-buffer: check for less than two in size allocation Steven Rostedt
2009-06-17 23:26 ` [PATCH 5/7] ring-buffer: add locks around rb_per_cpu_empty Steven Rostedt
2009-06-17 23:26 ` [PATCH 6/7] ring-buffer: do not grab locks in nmi Steven Rostedt
2009-06-17 23:26 ` Steven Rostedt [this message]
2009-06-20 15:26 ` [PATCH 0/7] [GIT PULL][for 2.6.31] ring-buffer: various clean ups 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=20090617232630.908465956@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