aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-test.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-04-26 15:22:09 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-02 14:14:12 -0400
commit23080e4cd224013c06444e7850fe0bcb55c129ff (patch)
treefd51e74b7630eec9e156ac1c87635704251a0a50 /tools/perf/builtin-test.c
parentf3054c778e367d624ca0dfe68b8498b5c463a9d1 (diff)
perf test: Make the rdpmc test honour 'verbose' mode
It was unconditionally printing debug stuff when in non -v mode we should just print the name and result of the test. Now: [root@sandy ~]# perf test rdpmc 6: x86 rdpmc test: Ok [root@sandy ~]# perf test -v rdpmc 6: x86 rdpmc test: --- start --- 0: 6030 1: 60030 2: 600050 3: 6000056 4: 60000070 5: 600000266 ---- end ---- x86 rdpmc test: Ok [root@sandy ~]# Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-0tjedaozsy9oarq30nvzg74b@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r--tools/perf/builtin-test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 1c5b9801ac61..5502a4a2a4f6 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -1549,8 +1549,6 @@ static int __test__rdpmc(void)
1549 sa.sa_sigaction = segfault_handler; 1549 sa.sa_sigaction = segfault_handler;
1550 sigaction(SIGSEGV, &sa, NULL); 1550 sigaction(SIGSEGV, &sa, NULL);
1551 1551
1552 fprintf(stderr, "\n\n");
1553
1554 fd = sys_perf_event_open(&attr, 0, -1, -1, 0); 1552 fd = sys_perf_event_open(&attr, 0, -1, -1, 0);
1555 if (fd < 0) { 1553 if (fd < 0) {
1556 die("Error: sys_perf_event_open() syscall returned " 1554 die("Error: sys_perf_event_open() syscall returned "
@@ -1575,7 +1573,7 @@ static int __test__rdpmc(void)
1575 loops *= 10; 1573 loops *= 10;
1576 1574
1577 delta = now - stamp; 1575 delta = now - stamp;
1578 fprintf(stderr, "%14d: %14Lu\n", n, (long long)delta); 1576 pr_debug("%14d: %14Lu\n", n, (long long)delta);
1579 1577
1580 delta_sum += delta; 1578 delta_sum += delta;
1581 } 1579 }
@@ -1583,7 +1581,7 @@ static int __test__rdpmc(void)
1583 munmap(addr, page_size); 1581 munmap(addr, page_size);
1584 close(fd); 1582 close(fd);
1585 1583
1586 fprintf(stderr, " "); 1584 pr_debug(" ");
1587 1585
1588 if (!delta_sum) 1586 if (!delta_sum)
1589 return -1; 1587 return -1;