Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2056129rwi; Tue, 1 Nov 2022 03:21:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6eL37sTa/SAgMIYETjoDOTRnregYMtw2piqPouiPtGZuWtLAniURAMy2+7N6eIp+ia2aE6 X-Received: by 2002:a63:124c:0:b0:460:633b:5702 with SMTP id 12-20020a63124c000000b00460633b5702mr108406pgs.9.1667298083223; Tue, 01 Nov 2022 03:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667298083; cv=none; d=google.com; s=arc-20160816; b=KU5XAeIRhZHpwWfCQ0+DDPayIPvO7Hrq8Ns+x5ePpCjIJoe2HZNoborb/HlrJAGcM5 YL8kH/bllYhzEyeleH/JMX/YEQEon3PEV/k6vcobzsjVfmOX5H8aVMiQE2MuBZzL1klg gArCIR4x8HWO81Qn6GteoTFWr8I7dp7UPMHnumh0Rv3hH3lxwJJvm0hm2/QHfv/qdEHq VT2623xlD7jQ6TYaZJwust9q17t3cwKEBgW1Nj/7jlr4i8dP0uOgsKHrBQp+I7uMhQy0 /KQHMFkwCtweHyPH2NY7xUDSINzAc0lhvRi5UXg+59jSIqWWlRWzTHP1nIF7M3/x1Bkk k0iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4/leZs/yTV2UyGmUZNp1m/SrXznL7PQwsrbEqUOsxD0=; b=0FD+EGIwzhQ6zpKHq75Izbv02cFXfOUCaY2+6c+vKUc9iIjn4b1zlRPXR0q6GZGdZC B0aJC1OHMnKLnGvt5fWEknkfBRiRyOxMrrKZg36U5u5EXsiNQkmdY4pW1TZoOZXSya4j NmmQLY/vyGY5Apqxr6IVNK910YHr5P5HXgCNPQTSItFDjYeR/rPqfvrMTdaQ1qgbt9u3 4+vn/inT4LbhslwlVeOn+EqCO+p1n9o6ggnhnmR6TWxFBkGX0LnpiZ8RJ8aRHfq8AhDh sxX+3jFctbj2Dx6OHBBIImlndEi+hDNwDxc1PmI83LZK5VO1MpI4DMFP+tnqoBLytaOo 8ZaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l10-20020a17090a49ca00b001fd9be4fb6csi10606082pjm.39.2022.11.01.03.21.10; Tue, 01 Nov 2022 03:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230410AbiKAJsy (ORCPT + 97 others); Tue, 1 Nov 2022 05:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbiKAJsu (ORCPT ); Tue, 1 Nov 2022 05:48:50 -0400 Received: from esa1.hc1455-7.c3s2.iphmx.com (esa1.hc1455-7.c3s2.iphmx.com [207.54.90.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BA6C29; Tue, 1 Nov 2022 02:48:49 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="94441000" X-IronPort-AV: E=Sophos;i="5.95,230,1661785200"; d="scan'208";a="94441000" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa1.hc1455-7.c3s2.iphmx.com with ESMTP; 01 Nov 2022 18:48:47 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id CBBC4C1388; Tue, 1 Nov 2022 18:48:46 +0900 (JST) Received: from oym-om4.fujitsu.com (oym-om4.o.css.fujitsu.com [10.85.58.164]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 1E858D9490; Tue, 1 Nov 2022 18:48:46 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om4.fujitsu.com (Postfix) with ESMTP id 02B3F40164011; Tue, 1 Nov 2022 18:48:46 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com Subject: [PATCH v3 2/5] selftests/resctrl: Return MBA check result and make it to output message Date: Tue, 1 Nov 2022 18:43:38 +0900 Message-Id: <20221101094341.3383073-3-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221101094341.3383073-1-tan.shaopeng@jp.fujitsu.com> References: <20221101094341.3383073-1-tan.shaopeng@jp.fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since MBA check result is not returned, the MBA test result message is always output as "ok" regardless of whether the MBA check result is true or false. Make output message to be "not ok" if MBA check result is failed. Reviewed-by: Reinette Chatre Signed-off-by: Shaopeng Tan --- tools/testing/selftests/resctrl/mba_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c index 1a1bdb6180cf..5d14802add4d 100644 --- a/tools/testing/selftests/resctrl/mba_test.c +++ b/tools/testing/selftests/resctrl/mba_test.c @@ -51,7 +51,7 @@ static int mba_setup(int num, ...) return 0; } -static void show_mba_info(unsigned long *bw_imc, unsigned long *bw_resc) +static bool show_mba_info(unsigned long *bw_imc, unsigned long *bw_resc) { int allocation, runs; bool failed = false; @@ -97,6 +97,8 @@ static void show_mba_info(unsigned long *bw_imc, unsigned long *bw_resc) failed ? "Fail:" : "Pass:"); if (failed) ksft_print_msg("At least one test failed\n"); + + return failed; } static int check_results(void) @@ -132,9 +134,7 @@ static int check_results(void) fclose(fp); - show_mba_info(bw_imc, bw_resc); - - return 0; + return show_mba_info(bw_imc, bw_resc); } void mba_test_cleanup(void) -- 2.27.0