From patchwork Tue Nov 1 09:43:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 13602 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2857479wru; Tue, 1 Nov 2022 03:03:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5qcdHga2gEJjHMvCmAMdByHM90xNzaszrLWW9ux5t88g6pN/IpYPqV1Uus0TmWmejxm5EQ X-Received: by 2002:a65:4c8e:0:b0:46f:75bb:905a with SMTP id m14-20020a654c8e000000b0046f75bb905amr16154997pgt.495.1667296994731; Tue, 01 Nov 2022 03:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667296994; cv=none; d=google.com; s=arc-20160816; b=MI2BSBAS/PCfpdXAbzLyxiWf5ozjGT1QbRfomHoFB+tNAeoas6PlSUd9a+UjJ1E30z wm8qkI20pmTnrWSMne3e0MwOzqBLwZGyGc9XmFu3y+rj4s6JZgYUiyh7wHZvMo2KtEt1 0BLmBL/ThZNhq4LY64+7BodusbgDkL8X7IoDpQitU21MJZfa6cs76tPpLCAza3CcjsdB gdzO9wXfgzZkvYpluFLAopcfqXy7SZJO7IIOUwCKaNs01TH6m7P6s9W/0peHcRc4Phhf zgkeo+QVcDjKiF/IIu8S1J0uj8yFUBb3d7ZmvQOy4Exjkl333nY6jGacETqWgClet8z4 ne8g== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e68-20020a636947000000b0046ebcc1c65bsi11634268pgc.739.2022.11.01.03.02.59; Tue, 01 Nov 2022 03:03:14 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748287613348341896?= X-GMAIL-MSGID: =?utf-8?q?1748287613348341896?= 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 Reviewed-by: Shuah Khan --- 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)