Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4690205rdb; Tue, 12 Dec 2023 06:53:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoV3oGWYZM+d5R/OX4aEKWQR0XBpF1s83wDokVPGWrVGRkQlkDmSL0/KCiwrx7etgMCLbs X-Received: by 2002:a17:902:e74e:b0:1cf:6453:b268 with SMTP id p14-20020a170902e74e00b001cf6453b268mr3591257plf.53.1702392804979; Tue, 12 Dec 2023 06:53:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702392804; cv=none; d=google.com; s=arc-20160816; b=0mMZovX26lmj9QLM+Yoqh5U0ZsSY+RXdP06uTQKLu/Jqcc3SnSvezdjr1JThsd21cp JNeWnIlFD5Jco+IyZbb0kj2cSL6++KiQBHuDMLIp7sF/B5y2t+SAWH/P6VZ2ab/p+TeJ dbWaa5EsT1TKkpVM7wAC3uUS6goZICYYdRhiLDNUgb+iCKqNthdTnGhdk/KSajFvL6O0 mP+t2SS801F5YlC0TXJnRrf5VVHUmqn/K3KEQ/zGOLEZlZlz5GW7HBFGvp5XHVysl3SB jk9DtZCBadu1SgmtxiQNap3cjxM3EQFZN2uDBM2aefVr4d5T3X/02W0S8lbR4biixxOJ xdyQ== 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=Bd25NDSSPmKXvMlTFgGdIH3oOc9efpPMfRvQnPGGW+c=; fh=/pACME0x50g4vorTSG5vEdNwgU981WFvy8LGbk4DPBk=; b=J+SRmMwtgo9gheEXiBKs8Kt8qcMNJUgOHNgeUu0coOvzpRHiwxe+hy903n8nJEFK3T 70u6BbQLzuleA69ZLyg38cFnE1FXiT46CJeDJ6fGP9vDLNk49S2yD8H3Hl2r/jmX40VR B5I4845Yby+ANNiUyjI6gcipk9p0YnZPFD8G/FZ0YmrMt1rqYYOraJgn9icoIb0LCBxg SYMxv99PVXoYzdL+YT3tNRykGi362VJ98mYiiMj7c4BV3mdKIzQ7y78kX9rXT1xZ17Wg hLbQPo2dj3Wh0gV3zPj+ZDB9nLCOrcC51bNaDmvuZgBZBzv2+LL1rTvPYyStUFFz1R/2 hJCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=B0XUR+4k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i18-20020a17090332d200b001d0a96d328esi7993290plr.265.2023.12.12.06.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:53:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=B0XUR+4k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 995498077556; Tue, 12 Dec 2023 06:53:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376947AbjLLOxM (ORCPT + 99 others); Tue, 12 Dec 2023 09:53:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376965AbjLLOxL (ORCPT ); Tue, 12 Dec 2023 09:53:11 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72115E3; Tue, 12 Dec 2023 06:53:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702392797; x=1733928797; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Jcr2FtX75/VKzbUe5j+yQUXHStpz5ABl2PqxNo5qGOI=; b=B0XUR+4k0SBkrwiCKGCYuueNdNp08wqhdmXpJKaTTIqZknkN/PH/WyrS RvQqM2W6R+yKcZgjkJn1sKQQxGIP5hr9zDeLqTwbNyquIIpDMuDZwRnNL z1ZoL6eSTWJBNm11uRTrRgbR8VRg8ucHfnrv6ylzPxNTnhD9vwAZKc4ax 8ypWsmeG2sMDikKB/EU+hCaMkpqQ6jH+3b8fevXL7v+4ABBauIjxOzeQr gaPK6pNV3k69UymEZlAn3bhG2i6/zwUrJoSDH5Paoqk+e2h4B1orJ36IT oIj5b/G+yuzmCqhNc6s8joA21og+LlME10fNsl4gOrdG9M/aZU1/u8kKl w==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="481014336" X-IronPort-AV: E=Sophos;i="6.04,270,1695711600"; d="scan'208";a="481014336" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 06:53:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,270,1695711600"; d="scan'208";a="15023887" Received: from mdabrows-mobl1.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.5.65]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 06:53:14 -0800 From: Maciej Wieczor-Retman To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 1/4] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT Date: Tue, 12 Dec 2023 15:52:51 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 06:53:23 -0800 (PST) From: Ilpo Järvinen To select test to run -t parameter can be used. However, -t cat currently maps to L3 CAT test which is confusing after more CAT related tests are added. Allow selecting tests as groups and call L3 CAT test "L3_CAT", "CAT" group will enable all CAT related tests. Signed-off-by: Ilpo Järvinen Signed-off-by: Maciej Wieczor-Retman --- Changelog v2: - Move this patch from Ilpo's series here (Ilpo). tools/testing/selftests/resctrl/cat_test.c | 3 ++- tools/testing/selftests/resctrl/resctrl.h | 2 ++ tools/testing/selftests/resctrl/resctrl_tests.c | 16 +++++++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c index 24af8310288a..39fc9303b8e8 100644 --- a/tools/testing/selftests/resctrl/cat_test.c +++ b/tools/testing/selftests/resctrl/cat_test.c @@ -295,7 +295,8 @@ static int cat_run_test(const struct resctrl_test *test, const struct user_param } struct resctrl_test l3_cat_test = { - .name = "CAT", + .name = "L3_CAT", + .group = "CAT", .resource = "L3", .feature_check = test_resource_feature_check, .run_test = cat_run_test, diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index c54efcf1412a..739e16d08a7b 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -65,6 +65,7 @@ struct user_params { /* * resctrl_test: resctrl test definition * @name: Test name + * @group: Test group (e.g., L2 and L3 CAT test belong to CAT group), can be NULL * @resource: Resource to test (e.g., MB, L3, L2, etc.) * @vendor_specific: Bitmask for vendor-specific tests (can be 0 for universal tests) * @disabled: Test is disabled @@ -73,6 +74,7 @@ struct user_params { */ struct resctrl_test { const char *name; + const char *group; const char *resource; unsigned int vendor_specific; bool disabled; diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index 75fc49ba3efb..3044179ee6e9 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -65,11 +65,15 @@ static void cmd_help(void) printf("usage: resctrl_tests [-h] [-t test list] [-n no_of_bits] [-b benchmark_cmd [option]...]\n"); printf("\t-b benchmark_cmd [option]...: run specified benchmark for MBM, MBA and CMT\n"); printf("\t default benchmark is builtin fill_buf\n"); - printf("\t-t test list: run tests specified in the test list, "); + printf("\t-t test list: run tests/groups specified by the list, "); printf("e.g. -t mbm,mba,cmt,cat\n"); - printf("\t\tSupported tests:\n"); - for (i = 0; i < ARRAY_SIZE(resctrl_tests); i++) - printf("\t\t\t%s\n", resctrl_tests[i]->name); + printf("\t\tSupported tests (group):\n"); + for (i = 0; i < ARRAY_SIZE(resctrl_tests); i++) { + if (resctrl_tests[i]->group) + printf("\t\t\t%s (%s)\n", resctrl_tests[i]->name, resctrl_tests[i]->group); + else + printf("\t\t\t%s\n", resctrl_tests[i]->name); + } printf("\t-n no_of_bits: run cache tests using specified no of bits in cache bit mask\n"); printf("\t-p cpu_no: specify CPU number to run the test. 1 is default\n"); printf("\t-h: help\n"); @@ -199,7 +203,9 @@ int main(int argc, char **argv) bool found = false; for (i = 0; i < ARRAY_SIZE(resctrl_tests); i++) { - if (!strcasecmp(token, resctrl_tests[i]->name)) { + if (!strcasecmp(token, resctrl_tests[i]->name) || + (resctrl_tests[i]->group && + !strcasecmp(token, resctrl_tests[i]->group))) { if (resctrl_tests[i]->disabled) tests++; resctrl_tests[i]->disabled = false; -- 2.43.0