Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744AbbEOGpH (ORCPT ); Fri, 15 May 2015 02:45:07 -0400 Received: from terminus.zytor.com ([198.137.202.10]:58210 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753869AbbEOGpC (ORCPT ); Fri, 15 May 2015 02:45:02 -0400 Date: Thu, 14 May 2015 23:44:46 -0700 From: tip-bot for He Kuang Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, acme@redhat.com, wangnan0@huawei.com, jolsa@kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, hekuang@huawei.com, mingo@kernel.org Reply-To: mingo@kernel.org, hekuang@huawei.com, tglx@linutronix.de, a.p.zijlstra@chello.nl, jolsa@kernel.org, wangnan0@huawei.com, acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com In-Reply-To: <1431347316-30401-1-git-send-email-hekuang@huawei.com> References: <1431347316-30401-1-git-send-email-hekuang@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tests: Fix to get negative exit codes Git-Commit-ID: 189c466f77d421aef5c196454ab2e9517af7abc9 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2052 Lines: 64 Commit-ID: 189c466f77d421aef5c196454ab2e9517af7abc9 Gitweb: http://git.kernel.org/tip/189c466f77d421aef5c196454ab2e9517af7abc9 Author: He Kuang AuthorDate: Mon, 11 May 2015 12:28:35 +0000 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 12 May 2015 09:59:50 -0300 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 Acked-by: Jiri Olsa Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1431347316-30401-1-git-send-email-hekuang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/builtin-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 4f40981..f42af98 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/