Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp401936rdf; Fri, 3 Nov 2023 04:25:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFe97TdBr6WWb3xcKk72m65nXtHb1X4ZfdHinnIy347Z0GQJTVFDyWOJWaG8o/yhuc+umNA X-Received: by 2002:aca:2806:0:b0:3ae:3d0:d74a with SMTP id 6-20020aca2806000000b003ae03d0d74amr21993517oix.52.1699010725098; Fri, 03 Nov 2023 04:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699010725; cv=none; d=google.com; s=arc-20160816; b=a1CA73P9WbOVaqlLW/0gUN3dww3e/dBbDL3TDzaieEO1M+rbXN4+NzgWrz3xhBTxiu LVqYscRk4nwgdZWu79gpZgGJrvykJi8Nkx/NWQJCPuESRO44iK+9bNmB3DewNvNCxuLQ wD22jIWoTOfIfXBFhmrIoN9GITwXI3nokBoiUO476vnCvo/i5RMVgikSMOTaj92XdYEs pRMcwIOfy2Ag6F5HiPh7+ovMn4iMy13mnAsU5o/90ESd4COIKcEmiy5wjKHMMkZs1Q4O Uz+04Zp8VNoBx1G59l3nuFC+7HSJGmNveM30ymFEdpRZjnfDd098flUF6w+Y2txwIk4U 7qEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=TL+LXYBfMTSuvz32a5Q7DH7mbuDtgiHuw3yyhpIY9EU=; fh=XHJC3rNtFqy9NBdwfesynq0dG98cBzq8Qrv2Usg7GS0=; b=FQTvnOVVdqJ/z/HvpZdHeH+os3GRGEw2aflNQCSXLg4Wp8A5VogoufTXxkWDc1LLod 6WJOO5oOY/Ry12ygU9zqaJUWyGe4WQX7S3dQvpfknVuNmD7rg8Qv3BBA2/K9HToE02Ri k5rFct0bQBYWA524oIwFJpnkYIImNlMKEhEfn+875bwlCcggRfMm3+VCTEdns2IugdjV C9/X6Ies/eSD7p8OAM+QCaXsCOWwOQIGI7etbOl9MHJFS5baK2FX2NBYf3EOhdu9ch9r a2SBjEPAJv5ENQRceNmgRR8oUHGa84GB/TAKwd9Z4EApmumv3au4O1Y1uUA49iOl/HHg XEfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jaxhAuAX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o13-20020a056a0015cd00b006c3398b42f2si1377989pfu.79.2023.11.03.04.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 04:25:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jaxhAuAX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7509A83852DC; Fri, 3 Nov 2023 04:25:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346964AbjKCLY6 (ORCPT + 99 others); Fri, 3 Nov 2023 07:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346918AbjKCLY6 (ORCPT ); Fri, 3 Nov 2023 07:24:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 480D8134; Fri, 3 Nov 2023 04:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699010692; x=1730546692; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=EExSE5kMyxSHF8UhIPZ9SnLdv7qwCLGarLJ+9vT1VuA=; b=jaxhAuAXTdDLYy2Ym8nu1a4NdLZslrrZxTvBIfvCjiECYyrmkMBpEvLn uQvHvhZlsktFh9frvuYjt3GdAIL0pnum3+uARKRjG8D/0Xaa3foAfKvyz YzRacNcCnH4qeWjJbHh/CPi4uvOR6eGUfpL5G2u01q2JYcp3Gzdhm1aUY 2MsZmRnv8QCUDx+xMlzaFRHqAWlpqOFvDSZqXXb7bK2eobQ+l4Iasbzmj tMemi4YXl+ez5DPavUcEzZigdS97k/TEBSaiyxPi8gdIrCnaA0DfNS1RF RiCADA8EwxZq5LOARR9YjUQAQQOSOR0XkpAzucilAy1mZmYAwf4qwbezE w==; X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="379328287" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="379328287" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 04:24:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="905312869" X-IronPort-AV: E=Sophos;i="6.03,273,1694761200"; d="scan'208";a="905312869" Received: from pors-mobl3.ger.corp.intel.com ([10.252.35.38]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 04:24:49 -0700 Date: Fri, 3 Nov 2023 13:24:47 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Reinette Chatre cc: linux-kselftest@vger.kernel.org, Shuah Khan , Shaopeng Tan , =?ISO-8859-15?Q?Maciej_Wiecz=F3r-Retman?= , Fenghua Yu , LKML Subject: Re: [PATCH 17/24] selftests/resctrl: Create struct for input parameter In-Reply-To: Message-ID: <2e266bb-653f-2fe2-9dbc-db8388f6aff1@linux.intel.com> References: <20231024092634.7122-1-ilpo.jarvinen@linux.intel.com> <20231024092634.7122-18-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1829071547-1699010691=:1725" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 04:25:22 -0700 (PDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1829071547-1699010691=:1725 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 2 Nov 2023, Reinette Chatre wrote: > On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > > > diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c > > index d3bf4368341e..5157a3f74fee 100644 > > --- a/tools/testing/selftests/resctrl/mba_test.c > > +++ b/tools/testing/selftests/resctrl/mba_test.c > > @@ -141,13 +141,13 @@ void mba_test_cleanup(void) > > remove(RESULT_FILE_NAME); > > } > > > > -int mba_schemata_change(int cpu_no, const char * const *benchmark_cmd) > > +int mba_schemata_change(const struct user_params *uparams) > > { > > struct resctrl_val_param param = { > > .resctrl_val = MBA_STR, > > .ctrlgrp = "c1", > > .mongrp = "m1", > > - .cpu_no = cpu_no, > > + .cpu_no = uparams->cpu, > > .filename = RESULT_FILE_NAME, > > .bw_report = "reads", > > .setup = mba_setup > > @@ -156,7 +156,7 @@ int mba_schemata_change(int cpu_no, const char * const *benchmark_cmd) > > > > remove(RESULT_FILE_NAME); > > > > - ret = resctrl_val(benchmark_cmd, ¶m); > > + ret = resctrl_val(uparams->benchmark_cmd, ¶m); > > if (ret) > > goto out; > > > > How about a new member of struct resctrl_val_param that points to > uparams? That would remove cpu_no from resctrl_val_param > and have everything available when a test needs to run ... not copying > some user parameters into struct resctrl_val_param and passing > others as parameters. I'm a bit allergic to adding more stuff into resctrl_val_param. It seems a structure where random stuff has been thrown at just because it exists. In general, your point is very valid though because the members of resctrl_val_param should be auditted through to see how many of them are even useful after adding uparams and struct resctrl_test. I could get rid of copying parameters from uparams to params and just passing uparams instead of benchmark_cmd into resctrl_val(). Would you be okay with that? Oh, and I really should rename resctrl_val() one day to something more meaningful too. :-) (but it won't be part of this series and will likely be another conflicty nightmare because resctrl_val_param too needs to be renamed...). -- i. --8323329-1829071547-1699010691=:1725--