From patchwork Mon Nov 20 11:13:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 167081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp2127230vqn; Mon, 20 Nov 2023 03:20:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHA/XP+bSPymM4h67QA/Wc3lBRqscEYixv0UZNbF44TZJDnBjZTsAS1Oxg3GzLM4XMZyiMy X-Received: by 2002:a05:6808:1496:b0:3a7:1b28:4bc9 with SMTP id e22-20020a056808149600b003a71b284bc9mr7824576oiw.54.1700479199861; Mon, 20 Nov 2023 03:19:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700479199; cv=none; d=google.com; s=arc-20160816; b=q6+5iTVAvN3FbC4tAy5qOywids0hQU8hFCAkxfYG5MoxHgfjeev2oVgop1pC840xzX sDugpuQw9qQi3l2aPBrPQTVblNfeOC8fP4FZW/qnPc9qM1MUB26hx2DuGAAgd3QyZMIn sIxQwVv/Lm/H6xGnPKQO9Ntul/F0KmfAQbiYl4PkpaP/UXksRclT8f87knAvP8emGo5H uroiooE2abWMSJnIV+bAuOL1eY1MUSVSiJu2rSdwvRwCWJTiD8/B8QHFTQprFJgHNkXt lx+bQacNrl7oZO9TKAWXACLCgdnlHmXOAN9/dN2xFbAkPezce0x9OCj+IyD2vpzacw/I o/sA== 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=FiZ7Ae+wKNwZPORFBnvxx1Qbkrmz5ZWYGpgVCEiUUwg=; fh=gPQ6jqLSfsDb5bE3yrtO+AlT5R4d75RXkjC5xckz7Dk=; b=jWH1WLR5zm2bNdhiRmLVA2U+w7gm1YF5DkVy+EMjVAIJ7BrrDJq62J9Z49o9tySQ6B b91SrRSneqaBonedf7F1RMvY8dpoGLOgRKlLaDZKxeoV21bqZPyT9y2aFm6SkXsHC5bu +7qmMqSZHXniI58EeRpOtjlRdnIDH8cVKJnG15yTzoSuaj9qWta72KuQm1sTAw3t/zVp KWufAhPX6Jh4YPvZWC0iBJnmzztBWWtyCkVbvzis9VZfwH8yYNGttaNSXAUxAvk7+MHt V1l7mJQIt6elxTI1c5NXuC4pWhPrt69sJ4rz8mQt+PClDjizrzyCIbD45VN+6MuKjaZp 5naQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OiQqHarE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 143-20020a630095000000b005bdf596397bsi7832456pga.732.2023.11.20.03.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 03:19:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OiQqHarE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 70F1B8067A44; Mon, 20 Nov 2023 03:19:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233058AbjKTLTV (ORCPT + 27 others); Mon, 20 Nov 2023 06:19:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232984AbjKTLSn (ORCPT ); Mon, 20 Nov 2023 06:18:43 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED99710DA; Mon, 20 Nov 2023 03:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700479054; x=1732015054; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YjHBr9jtSW2NF2jd5L+qwwZNfHWmiNVZEiAJFuAKXls=; b=OiQqHarE+PXSKy76xe8OUgItElPUh2+EXhnqgVZjefStq+vwDJFU5y33 4FOOpBkNhyZQNbqxSFVkkHoKh6FpE5gE8xby+enRSmbGHUKz21WJDYTNS MkybcvvNPa+kX/nx3Vc7hCdQafuBtojGTpOIc6NNYRcTsPb0cjtzHIIQ/ likkIzW3pnvD4duRDQ9/Ykz3A3AtROvvxCRVmVWcNcAz7Q82wqaXFTOsB ywnSM9FeHvsi5KPlkM78Xcz5j6KVDccaTAKugm8KhCvUIhr8da0SeFj33 NMdUv1C8L720vwaN0zkp7/vTR3J14uQxtwciDqd5ln9+7I5V07QNp5hml Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10899"; a="390457965" X-IronPort-AV: E=Sophos;i="6.04,213,1695711600"; d="scan'208";a="390457965" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 03:17:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10899"; a="801127615" X-IronPort-AV: E=Sophos;i="6.04,213,1695711600"; d="scan'208";a="801127615" Received: from sc9itsct4906.amr.corp.intel.com (HELO localhost) ([10.249.46.107]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 03:17:29 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Reinette Chatre , Shuah Khan , Shaopeng Tan , =?utf-8?q?Maciej_Wiecz=C3=B3r-R?= =?utf-8?q?etman?= , Fenghua Yu Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 26/26] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT Date: Mon, 20 Nov 2023 13:13:40 +0200 Message-Id: <20231120111340.7805-27-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231120111340.7805-1-ilpo.jarvinen@linux.intel.com> References: <20231120111340.7805-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 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,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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 03:19:57 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783081677670459874 X-GMAIL-MSGID: 1783081677670459874 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 --- 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 293b42ccd39f..869fd280c993 100644 --- a/tools/testing/selftests/resctrl/cat_test.c +++ b/tools/testing/selftests/resctrl/cat_test.c @@ -289,7 +289,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 9b49065cc6da..2f0fa8a604e6 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -60,6 +60,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 @@ -68,6 +69,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 fec677d41cf4..3d8fd1d3ca43 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"); @@ -197,7 +201,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;