diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-08 21:53:06 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-09 10:39:02 -0400 |
commit | 32c7f7383a096a4fc878fdda686c7725945e8a8f (patch) | |
tree | f41ec7b4377764e130dbfcaaf5b177687b622617 | |
parent | d5cb2aef4fda355fbafe8db4f425b73ea94d2019 (diff) |
perf test: Remove die() calls
Just use pr_err() + return -1 and let the other tests run as well and
then the perf's main() exit doing whatever it needs.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.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-n5ahw26e94klmde9cz6rxsdf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-test.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index cf33e5081c36..6ae102eba5fa 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c | |||
@@ -1023,14 +1023,16 @@ static int __test__rdpmc(void) | |||
1023 | 1023 | ||
1024 | fd = sys_perf_event_open(&attr, 0, -1, -1, 0); | 1024 | fd = sys_perf_event_open(&attr, 0, -1, -1, 0); |
1025 | if (fd < 0) { | 1025 | if (fd < 0) { |
1026 | die("Error: sys_perf_event_open() syscall returned " | 1026 | pr_debug("Error: sys_perf_event_open() syscall returned " |
1027 | "with %d (%s)\n", fd, strerror(errno)); | 1027 | "with %d (%s)\n", fd, strerror(errno)); |
1028 | return -1; | ||
1028 | } | 1029 | } |
1029 | 1030 | ||
1030 | addr = mmap(NULL, page_size, PROT_READ, MAP_SHARED, fd, 0); | 1031 | addr = mmap(NULL, page_size, PROT_READ, MAP_SHARED, fd, 0); |
1031 | if (addr == (void *)(-1)) { | 1032 | if (addr == (void *)(-1)) { |
1032 | die("Error: mmap() syscall returned " | 1033 | pr_debug("Error: mmap() syscall returned with (%s)\n", |
1033 | "with (%s)\n", strerror(errno)); | 1034 | strerror(errno)); |
1035 | goto out_close; | ||
1034 | } | 1036 | } |
1035 | 1037 | ||
1036 | for (n = 0; n < 6; n++) { | 1038 | for (n = 0; n < 6; n++) { |
@@ -1051,9 +1053,9 @@ static int __test__rdpmc(void) | |||
1051 | } | 1053 | } |
1052 | 1054 | ||
1053 | munmap(addr, page_size); | 1055 | munmap(addr, page_size); |
1054 | close(fd); | ||
1055 | |||
1056 | pr_debug(" "); | 1056 | pr_debug(" "); |
1057 | out_close: | ||
1058 | close(fd); | ||
1057 | 1059 | ||
1058 | if (!delta_sum) | 1060 | if (!delta_sum) |
1059 | return -1; | 1061 | return -1; |