From patchwork Mon Sep 4 09:50:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13373667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A34CBC83F2C for ; Mon, 4 Sep 2023 09:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ublsC7smJNPzfSxUzyS1+2saIufsQvYJVxJ7cJ+eT5w=; b=GuJB/fscstPZr4 +eJwgbk1GWEeiCBlbVA0xacrvQcW3QtCYR0Y6UYX98H9JW6BDpzdAn+npXWE3Ctk7Akxy/H7APtzz ZLS9IYVXVvLW8DlEdeROgGsGn1YlnJi0JMxhY+Eh3I2kl2LYbvtZReEktJW1Q+ntjzuB4LJRxcspi 6Ezbm7/94w6oKX4dq/Ub51TvKJnMDBM3P5hKYO20Ij75yHvp8R9aiHLzfW6+86pWQqrWa95U527zJ 99D1Q6mEytS9WyITzKgp0toSQgRWbjBHFbxqboK0AVr2MkD5Mrtm8fqRSpcRPjRDvseCxpUD070Jw PRq4SAPFcRyvLJiLeopQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qd6Fm-003iYF-0M; Mon, 04 Sep 2023 09:52:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qd6Fj-003iX0-1c for linux-arm-kernel@lists.infradead.org; Mon, 04 Sep 2023 09:52:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0C371042; Mon, 4 Sep 2023 02:52:50 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5EEED3F793; Mon, 4 Sep 2023 02:52:09 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com Cc: James Clark , John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Kajol Jain , Jing Zhang , Haixin Yu , Madhavan Srinivasan , Ravi Bangoria , Kan Liang , Yang Jihong , Eduard Zingerman , Miguel Ojeda , Liam Howlett , Chen Zhongjin , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/7] perf test: Check result of has_event(cycles) test Date: Mon, 4 Sep 2023 10:50:43 +0100 Message-Id: <20230904095104.1162928-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230904095104.1162928-1-james.clark@arm.com> References: <20230904095104.1162928-1-james.clark@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230904_025215_581791_CB4DC8E8 X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently the function always returns 0, so even when the has_event() test fails, the test still passes. Fix it by returning ret instead. Reviewed-by: Ian Rogers Signed-off-by: James Clark --- tools/perf/tests/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index 81229fa4f1e9..39be7f3b3a53 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c @@ -263,7 +263,7 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u expr__ctx_free(ctx); - return 0; + return ret; } DEFINE_SUITE("Simple expression parser", expr);