Skip to content

Commit

Permalink
perf test: Make the rdpmc test honour 'verbose' mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo committed May 2, 2012
1 parent f3054c7 commit 23080e4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/perf/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,8 +1549,6 @@ static int __test__rdpmc(void)
sa.sa_sigaction = segfault_handler;
sigaction(SIGSEGV, &sa, NULL);

fprintf(stderr, "\n\n");

fd = sys_perf_event_open(&attr, 0, -1, -1, 0);
if (fd < 0) {
die("Error: sys_perf_event_open() syscall returned "
Expand All @@ -1575,15 +1573,15 @@ static int __test__rdpmc(void)
loops *= 10;

delta = now - stamp;
fprintf(stderr, "%14d: %14Lu\n", n, (long long)delta);
pr_debug("%14d: %14Lu\n", n, (long long)delta);

delta_sum += delta;
}

munmap(addr, page_size);
close(fd);

fprintf(stderr, " ");
pr_debug(" ");

if (!delta_sum)
return -1;
Expand Down

0 comments on commit 23080e4

Please sign in to comment.