Message ID | 20230418114506.46788-8-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2781500vqo; Tue, 18 Apr 2023 04:50:43 -0700 (PDT) X-Google-Smtp-Source: AKy350awV5tJI0pXSi5kuu7e8ZtYgRW6Ojt9oe7iGA4feFyV4lubmcaAJeJHd8fgAD/07UyU9jGm X-Received: by 2002:a17:902:8ecc:b0:1a5:2760:74ef with SMTP id x12-20020a1709028ecc00b001a5276074efmr2015771plo.25.1681818642881; Tue, 18 Apr 2023 04:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681818642; cv=none; d=google.com; s=arc-20160816; b=PNG/qn7ERqtWB0lro3CiUeGv7GQ+hRuvHV4mUdF5dv4tqBBeF/HJgxs/3dVyme4hlY JfanL2nE4vwbEnNm9pjqswNwO5v7KIiYTzjke5LYa9SylkPIlzHC1k2prIxzZBL7h1IU erDNgahb2SvSKczmkFdiQgmdM3QLpTe0kM4Zf9KBAxQ5UOdXl0+0KRck27X6IPEP1Yrk HJAYguunhqEAuR5wpcr1VEGfD1CJbDv1UfO0dSc9i4xSRMPThb4yFdL4LUg8KkzFxutR Bm9JpCREBX1aUcToJCLF4omuKEw8YgCyWCwJNfLvIWMxcC2IP37dFuJqBmbIQmZG+urb oozQ== 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 :dkim-signature; bh=WwKDQF91fMIKQyfYhueIEImrv9WMHVr603duA4Q1te0=; b=j4vr7Of6gW+GzGaCzsNkBC6wOZWP0314rG9vrl1c9lx5HbddoNunZM4gc0XH/niHv7 FF2sOt+TD6EehtKGVzqShXicCTQSd/Rya/L730esSQsVQEmbucLTkKmtjdKjpYWF/EWW sdK5/jLRrn3y6A/Y+74asIDrye/NxPx8hL25fXJ+6CyxGKyZax82Ls9WGAGgZxvKG02Q IfJStoh2OA45P0Ft5Iz9zBgYXiNRqvxxDSJ8x+KG7IfpXZhQxlJaHgsZoswNL9Xe8vF3 0BbbxiVECTQJrmmeJrFtUvU0Tl6N8KfwWCA9l7JxJP3UD/xwWwwMkdncGcVmyMnGicMN UaTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="nH+Zml/U"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170903028300b001a4ee96c00bsi15304188plr.357.2023.04.18.04.50.31; Tue, 18 Apr 2023 04:50:42 -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; dkim=pass header.i=@intel.com header.s=Intel header.b="nH+Zml/U"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231578AbjDRLqU (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Tue, 18 Apr 2023 07:46:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231535AbjDRLqJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Apr 2023 07:46:09 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E4E89EFA; Tue, 18 Apr 2023 04:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681818349; x=1713354349; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XvnhBQByfg3h7H+zzMbDixJv01cITD/50orz6/f0R8s=; b=nH+Zml/U6v7XXiV6TAYMPj640qDVeIKur3/O8rozyx2so/ngUiV9tgOW TR8+szejk/amPB7WadP5e2VHsN9k2sH5fRftFiVDME2zoUBxEkvpDVaEA lRW3/qgvirbWtEm3HFdsM9NZK4PB5TtR/aYSkDPdQjAqQcxQBinQGPzPe GmbPXkMda8C8e4GAmySsQi99WWxSYsi0JEEX7rHZdmZ+d9mWy4fvrR9fB sl62H+lHJINKzsAQ6Ei6tzuW8D/s13+j7lQ0uvFBqSzDrnn2cwW1/Wjji 2OZ5bWpGrlvitjMpoXJI3COnF2sgfN/baT8tYdHnDiLlw6I4T7rBMnJ4d A==; X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="346994331" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="346994331" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 04:45:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="723601600" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="723601600" Received: from yvolokit-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.213.103]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 04:45:46 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-kselftest@vger.kernel.org, Reinette Chatre <reinette.chatre@intel.com>, Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>, linux-kernel@vger.kernel.org Cc: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v2 07/24] selftests/resctrl: Remove duplicated preparation for span arg Date: Tue, 18 Apr 2023 14:44:49 +0300 Message-Id: <20230418114506.46788-8-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230418114506.46788-1-ilpo.jarvinen@linux.intel.com> References: <20230418114506.46788-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763514665080841246?= X-GMAIL-MSGID: =?utf-8?q?1763514665080841246?= |
Series |
selftests/resctrl: Fixes, cleanups, and rewritten CAT test
|
|
Commit Message
Ilpo Järvinen
April 18, 2023, 11:44 a.m. UTC
When no benchmark_cmd is given, benchmark_cmd[1] is set to span in main(). There's no need to do it again in run_mba_test(). Remove the duplicated preparation for span argument into benchmark_cmd[1] from run_mba_test(). It enables also removing has_ben argument from run_mba_test() as unnecessary. Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> --- tools/testing/selftests/resctrl/resctrl_tests.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
Comments
Hi Ilpo, On 4/18/2023 4:44 AM, Ilpo Järvinen wrote: > When no benchmark_cmd is given, benchmark_cmd[1] is set to span in > main(). There's no need to do it again in run_mba_test(). > > Remove the duplicated preparation for span argument into > benchmark_cmd[1] from run_mba_test(). It enables also removing has_ben > argument from run_mba_test() as unnecessary. I find the last sentence a bit hard to read. How about "After this, the has_ben argument to run_mba_test() can be removed.". > > Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > --- > tools/testing/selftests/resctrl/resctrl_tests.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c > index f1ed2c89f228..3c8ec68eb507 100644 > --- a/tools/testing/selftests/resctrl/resctrl_tests.c > +++ b/tools/testing/selftests/resctrl/resctrl_tests.c > @@ -99,8 +99,8 @@ static void run_mbm_test(bool has_ben, char **benchmark_cmd, unsigned long span, > umount_resctrlfs(); > } > > -static void run_mba_test(bool has_ben, char **benchmark_cmd, unsigned long span, > - int cpu_no, char *bw_report) > +static void run_mba_test(char **benchmark_cmd, unsigned long span, int cpu_no, > + char *bw_report) > { > int res; > > @@ -117,8 +117,6 @@ static void run_mba_test(bool has_ben, char **benchmark_cmd, unsigned long span, > goto umount; > } > > - if (!has_ben) > - sprintf(benchmark_cmd[1], "%lu", span); Can "span" also be removed? > res = mba_schemata_change(cpu_no, bw_report, benchmark_cmd); > ksft_test_result(!res, "MBA: schemata change\n"); > > @@ -297,7 +295,7 @@ int main(int argc, char **argv) > run_mbm_test(has_ben, benchmark_cmd, span, cpu_no, bw_report); > > if (mba_test) > - run_mba_test(has_ben, benchmark_cmd, span, cpu_no, bw_report); > + run_mba_test(benchmark_cmd, span, cpu_no, bw_report); > > if (cmt_test) > run_cmt_test(has_ben, benchmark_cmd, cpu_no); Reinette
On Fri, 21 Apr 2023, Reinette Chatre wrote: > On 4/18/2023 4:44 AM, Ilpo Järvinen wrote: > > When no benchmark_cmd is given, benchmark_cmd[1] is set to span in > > main(). There's no need to do it again in run_mba_test(). > > > > Remove the duplicated preparation for span argument into > > benchmark_cmd[1] from run_mba_test(). It enables also removing has_ben > > argument from run_mba_test() as unnecessary. > > I find the last sentence a bit hard to read. How about > "After this, the has_ben argument to run_mba_test() can be removed.". > > > > > Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> > > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > > --- > > tools/testing/selftests/resctrl/resctrl_tests.c | 8 +++----- > > 1 file changed, 3 insertions(+), 5 deletions(-) > > > > diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c > > index f1ed2c89f228..3c8ec68eb507 100644 > > --- a/tools/testing/selftests/resctrl/resctrl_tests.c > > +++ b/tools/testing/selftests/resctrl/resctrl_tests.c > > @@ -99,8 +99,8 @@ static void run_mbm_test(bool has_ben, char **benchmark_cmd, unsigned long span, > > umount_resctrlfs(); > > } > > > > -static void run_mba_test(bool has_ben, char **benchmark_cmd, unsigned long span, > > - int cpu_no, char *bw_report) > > +static void run_mba_test(char **benchmark_cmd, unsigned long span, int cpu_no, > > + char *bw_report) > > { > > int res; > > > > @@ -117,8 +117,6 @@ static void run_mba_test(bool has_ben, char **benchmark_cmd, unsigned long span, > > goto umount; > > } > > > > - if (!has_ben) > > - sprintf(benchmark_cmd[1], "%lu", span); > > Can "span" also be removed? Yes.
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index f1ed2c89f228..3c8ec68eb507 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -99,8 +99,8 @@ static void run_mbm_test(bool has_ben, char **benchmark_cmd, unsigned long span, umount_resctrlfs(); } -static void run_mba_test(bool has_ben, char **benchmark_cmd, unsigned long span, - int cpu_no, char *bw_report) +static void run_mba_test(char **benchmark_cmd, unsigned long span, int cpu_no, + char *bw_report) { int res; @@ -117,8 +117,6 @@ static void run_mba_test(bool has_ben, char **benchmark_cmd, unsigned long span, goto umount; } - if (!has_ben) - sprintf(benchmark_cmd[1], "%lu", span); res = mba_schemata_change(cpu_no, bw_report, benchmark_cmd); ksft_test_result(!res, "MBA: schemata change\n"); @@ -297,7 +295,7 @@ int main(int argc, char **argv) run_mbm_test(has_ben, benchmark_cmd, span, cpu_no, bw_report); if (mba_test) - run_mba_test(has_ben, benchmark_cmd, span, cpu_no, bw_report); + run_mba_test(benchmark_cmd, span, cpu_no, bw_report); if (cmt_test) run_cmt_test(has_ben, benchmark_cmd, cpu_no);