diff options
author | Wang Nan <wangnan0@huawei.com> | 2015-11-03 11:44:42 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-11-03 15:45:40 +0100 |
commit | 597bdeb4ab7396c43935eded15f82e3e100b3ff3 (patch) | |
tree | 289c61adebac5e14fde781cb31764409a514d6bf /tools/perf/tests/llvm.c | |
parent | Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
download | linux-597bdeb4ab7396c43935eded15f82e3e100b3ff3.tar.xz linux-597bdeb4ab7396c43935eded15f82e3e100b3ff3.zip |
perf test: Keep test result clean if '-v' not set
According to [1], 'perf test' should avoid output too much information
if '-v' is not set, only 'Ok', 'FAIL' or 'Skip' need to be printed.
This patch removes several messages sent directly to stderr to make
the output clean.
Before this patch:
# perf test dummy
23: Test using a dummy software event to keep tracking : (not supported) Ok
After this patch:
# perf test dummy
23: Test using a dummy software event to keep tracking : Skip
[1] http://lkml.kernel.org/r/20151020134155.GE4400@redhat.com
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1446547486-229499-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/llvm.c')
-rw-r--r-- | tools/perf/tests/llvm.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c index 52d55971f66f..512d3620e9f9 100644 --- a/tools/perf/tests/llvm.c +++ b/tools/perf/tests/llvm.c @@ -36,7 +36,7 @@ static int test__bpf_parsing(void *obj_buf, size_t obj_buf_sz) static int test__bpf_parsing(void *obj_buf __maybe_unused, size_t obj_buf_sz __maybe_unused) { - fprintf(stderr, " (skip bpf parsing)"); + pr_debug("Skip bpf parsing\n"); return 0; } #endif @@ -55,7 +55,7 @@ int test__llvm(void) * and clang is not found in $PATH, and this is not perf test -v */ if (verbose == 0 && !llvm_param.user_set_param && llvm__search_clang()) { - fprintf(stderr, " (no clang, try 'perf test -v LLVM')"); + pr_debug("No clang and no verbosive, skip this test\n"); return TEST_SKIP; } @@ -86,11 +86,8 @@ int test__llvm(void) err = llvm__compile_bpf("-", &obj_buf, &obj_buf_sz); verbose = old_verbose; - if (err) { - if (!verbose) - fprintf(stderr, " (use -v to see error message)"); - return -1; - } + if (err) + return TEST_FAIL; err = test__bpf_parsing(obj_buf, obj_buf_sz); free(obj_buf); |