diff options
author | He Kuang <hekuang@huawei.com> | 2015-05-11 12:28:35 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-05-12 09:59:50 -0300 |
commit | 189c466f77d421aef5c196454ab2e9517af7abc9 (patch) | |
tree | b5b06e0fe65af5573b712b9d92d21b133e956ba9 /tools | |
parent | 7d5eaba9b33682b734e3a79c21c4a9a5f91624b1 (diff) | |
download | talos-obmc-linux-189c466f77d421aef5c196454ab2e9517af7abc9.tar.gz talos-obmc-linux-189c466f77d421aef5c196454ab2e9517af7abc9.zip |
perf tests: Fix to get negative exit codes
WEXITSTATUS consists of the least significant 8 bits of the status
argument, so we should convert the value to signed char if we have valid
negative exit codes. And the return value of test->func() contains
negative values:
enum {
TEST_OK = 0,
TEST_FAIL = -1,
TEST_SKIP = -2,
};
Before this patch:
$ perf test -v 1
...
test child finished with 254
---- end ----
vmlinux symtab matches kallsyms: FAILED!
After this patch:
$ perf test -v 1
...
test child finished with -2
---- end ----
vmlinux symtab matches kallsyms: Skip
Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1431347316-30401-1-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/tests/builtin-test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 4f4098167112..f42af98a5c16 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -219,7 +219,7 @@ static int run_test(struct test *test) wait(&status); if (WIFEXITED(status)) { - err = WEXITSTATUS(status); + err = (signed char)WEXITSTATUS(status); pr_debug("test child finished with %d\n", err); } else if (WIFSIGNALED(status)) { err = -1; |