Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1765017rda; Tue, 24 Oct 2023 02:32:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0p3VnIJoAOWkbW3p6CfDA14xaW51B3pGMBrJavuWvbJlN6CC++v2jmkdGwSokLHJhG/eA X-Received: by 2002:a05:6a20:7da5:b0:15d:b407:b0a0 with SMTP id v37-20020a056a207da500b0015db407b0a0mr2693120pzj.26.1698139959957; Tue, 24 Oct 2023 02:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698139959; cv=none; d=google.com; s=arc-20160816; b=iQquQcQMNpgUvNLbKiicc8xEvvTMGESZLsydagpRMXG/lWqF5JvIwIiPgJLhE5SS3T bWxFiMCUdNjxSjp83QAd/E4SS+xR+VoFd1aNG9HiVLVQ6npQBvmuh+a1Ktwafa6MMvk4 qRuBOn4gEeIEyQBxA7nPmztMdizxB+LpgDleIktP4HmWhLYeB0Xw1Yv9+lqp+BL3VL/d CZ6HUFzJKJeu7OpvvqYNzszuTCz9BLkKjDXk5TFcwIb9Obeh8ATzv8t7O3Jcotc+HBMv QkjFNN69QuRLWyRnBNkLFQ5lLzJmAr6YmFZAq2eG/21UsaYGp2W9rk/zIEZjrHI6T4Bh /0Vw== 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=arD9ICiG9rKGU1TC/Us1CdJ/HwacxdFw/8qTiXJvxCw=; fh=gPQ6jqLSfsDb5bE3yrtO+AlT5R4d75RXkjC5xckz7Dk=; b=YUu1RWdVUgeivkuuMS0jtsytEuOFSTLxbsrIRotdFkuIXeyRA5h67B5I6qds9aga2Z NkxeCu2lm5UM40QZhix3qnaituGhem5+Q2G2R75iS0wysEBUpOf/gYYfe7p6qY5lVFrO qm+WfSRCYDeYRfiXvjAgLVEhoU7K40mcEc3/oR6OfPmsjBhQ3ELiDdY6d9bGqO0wu1y+ yWfkQy8r7kb3m3KRIFSUVLO1GKJOLhVvRhXOmYk6O6udwIHxQblj++sL/Hp+c7iwde6/ FlHB/llzehY4XAdB7fvtnoTbL1y4oeRjeya5m9HybAhRc6yBXpRMQ1PR6o51oxZCw1QW 2apw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jZTkEc/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q206-20020a632ad7000000b005ac2d06099esi7901245pgq.478.2023.10.24.02.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 02:32:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jZTkEc/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 69CC180C283D; Tue, 24 Oct 2023 02:32:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234200AbjJXJcQ (ORCPT + 99 others); Tue, 24 Oct 2023 05:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234182AbjJXJbP (ORCPT ); Tue, 24 Oct 2023 05:31:15 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3780C2705; Tue, 24 Oct 2023 02:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698139794; x=1729675794; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZIUmCvVW4L+pkZbqBv4Kna6ZMFqvsl2rUCxsV99jydw=; b=jZTkEc/q2oDnapkTvXlQ45KmEFAbL7TLrWR2KaagbnJU/rLtzYaNUKPQ OkYsLF0RydkZtQK0Ta3VPPhVJKJI2wXsF4p2DlADJskga8L7aE2bo23pt HFQ9Twnc2fxSubOIboKx6XSuB0UKfhhC4Pjtt3OIugE9OVNdq4Lvqy833 B9rIwxqSo+EV+Vq634w6g1BdJSPNaBWTeESHMtJEgqqu9voj3r+C/Kq/1 F/2BneIk6Vr5AFciNgqfFNGKGv7Q6wQYY3N+lipZvH+WwF0ikGCccsl8U eISLofR75PCwcN2fxthTXusf+UFVal7T3ZjWhhRJ5zmF5lXzLsIb/HFoX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="5644386" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="5644386" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 02:29:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="758410182" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="758410182" Received: from hprosing-mobl.ger.corp.intel.com (HELO localhost) ([10.249.40.219]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 02:29:50 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Reinette Chatre , Shuah Khan , Shaopeng Tan , =?UTF-8?q?Maciej=20Wiecz=C3=B3r-Retman?= , Fenghua Yu Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 22/24] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT Date: Tue, 24 Oct 2023 12:26:32 +0300 Message-Id: <20231024092634.7122-23-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231024092634.7122-1-ilpo.jarvinen@linux.intel.com> References: <20231024092634.7122-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=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 02:32:35 -0700 (PDT) To select test to run -t parameter can be used. However, -t cat currently maps to L3 CAT test which is confusing after L2 CAT test is be the next change. Allow selecting tests as groups and call L3 CAT test L3_CAT, "CAT" group will enable to both L3 and L2 CAT tests. Signed-off-by: Ilpo Järvinen --- 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 1ef047cadf4c..48a96acd9e31 100644 --- a/tools/testing/selftests/resctrl/cat_test.c +++ b/tools/testing/selftests/resctrl/cat_test.c @@ -282,7 +282,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 c148998bf6ad..f9a4cfd981f8 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -62,6 +62,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 @@ -70,6 +71,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 7846260e3f68..d89179541d7b 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -61,11 +61,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"); @@ -193,7 +197,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.30.2