Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp965002rdb; Fri, 16 Feb 2024 00:35:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXr62Pvw98m1EDR0zwaYDbSGgqXEMf0ene5DpWJiz9Us4EHg7cA7eGkcq+2Rr3D9PWU+p4IdMqvWOPqKE+mooTgKBHcckMIfAjxCj36Xw== X-Google-Smtp-Source: AGHT+IHIu/qNsFQPT9yCNRPmEFKFAnhdy8+lr3Rp9QpzYgi7MjhhdjzidkoLeAv+eof8zOepRzu5 X-Received: by 2002:a17:906:d550:b0:a3c:ffb8:d570 with SMTP id cr16-20020a170906d55000b00a3cffb8d570mr8128280ejc.3.1708072526013; Fri, 16 Feb 2024 00:35:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708072526; cv=pass; d=google.com; s=arc-20160816; b=CZx7pzBFZC6SpQoK+gRH4XPDpoEcGhHwowthtFwDEcNuiBBY4gbU6j4X5JRV1hHmv0 ranYPPVjjXa4oIwlPDxhqik183QvFDowJe1FS3HE5dl9I6rwWw1IEP8BPxBjzA5uO5SZ 7KtBgJ+CV8OF65b6oB07ABNcSaqfkcMFF87RntNOsOXzIxM7mGQNuYwzRq0uGydZwS0L kf70Kvum3uWK/BXXRIBp6T4M5xHdt/z1lRi7+Qg2zgnotm29k5/DbZ83G4c4sjKHsNnU WZscpNenTg2eq2IeCfDKPlBmO+J3HCl9FgjK8fyOI5r9x4NAB9YPzEUzMXjExAyWHRGC HSpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wOzp1pFgIcYTiPHAiv5f7UuLJOigPd8KBSsP0sYwjQ8=; fh=vsXTc+A87OxxPzw8nrMJDpzNxDeci757XxGoEWLRn38=; b=aCj6d4KtvBSsFLK3ERDbW7KgjEysE9yKKQGXXXtUwHkeShmbtKk8ySo31XQo0EeHzn xVNBpPTocfwQbCDC5aewhF0lIIALJve/oH97tik3KTI7KzUdt7VTpBrEElgf24itgHSx mnfGaTwKnksFbX6dHkEpWzXYD0htTzWWvBnATHECiwvP5pqe9HJweOKqNotzGIt4YVMe 1oY+ZqI4srJsu6eORRO/jcbQVa7B40cB6N4Hi6PV/fxRTnttEmtKAEenU+mt8ovgSctQ Uoas3l8zYFlMKFlsgjHIF/+qk6g9P8FrRXTVYzLtTyo0w7x27V+aV4KTOZewgkV0L3dK 2yig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j57sHRJE; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-68243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hs34-20020a1709073ea200b00a3bd6892088si1515083ejc.874.2024.02.16.00.35.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 00:35:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j57sHRJE; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-68243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8FD971F23EB4 for ; Fri, 16 Feb 2024 08:35:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5329217997; Fri, 16 Feb 2024 08:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j57sHRJE" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B45E9171B6; Fri, 16 Feb 2024 08:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708072517; cv=none; b=fR/nqCQXpEhJlTMNXU3evN/+MGXT2/Z8LQtWRGfTtVAVErMCeNLXf6NKdZObgIpfHu9PxxXGQImBiKDpSRQAJ4O3BSv71qTPJnehyrNtV/ajGt79mFPX6yKSm1Lnb79o0jXGjInV2KAWX6Mj7/AMWQVieDMlTksN0Dy3ChqitV8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708072517; c=relaxed/simple; bh=ITmCMI4xWgouC17/92dBGHeJbGzaQW2iSuy8CYT4Aao=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c6BrImbWCUnbBzodD8FusnpFziR45ifpcHzMGiWH+1G15K7SPQulPWLEk0yh7A4SvdgqfrAokM+kjYTD0H1Z8I+wSDEwv3PesuKwvbon3n5m1LvvtAQigXJAa4r/+fobFi8LOX9lF7fwVA7I5ZTy9gyssLWOljB+xtBbI4FeT9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=j57sHRJE; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708072515; x=1739608515; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ITmCMI4xWgouC17/92dBGHeJbGzaQW2iSuy8CYT4Aao=; b=j57sHRJEu1lOWZmbHe1oaQdZ703Js6woBBDZpqIwQXbFzjSPmeySlALZ yqypOXh6EAPOTMQLLB8ySYpVsba4JPiHOlbcoHN00CNGmHBSqQV0GgLH6 qQamVL9lbhEpgx8WvjDCaawKtGapEwuUq8W58oWiZWtqBDP7pIehfugCg eYqlRwh3QUi7M0FpMuCv5R2+LHEZAgsPBsAEq4UpB+8l9Xb1AlRCtxLhl xjwzy3+zvsFkT25JivG7xOwAUtodgFrlFLlzuMQ2tkXxE1EbG5ghIKBEs 1ZcQbR/THkisx99k3NxB63dFz3tc5/oOk7JpC/RtWSIxSgeIv59m7O8fS g==; X-IronPort-AV: E=McAfee;i="6600,9927,10985"; a="6024139" X-IronPort-AV: E=Sophos;i="6.06,164,1705392000"; d="scan'208";a="6024139" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2024 00:35:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,164,1705392000"; d="scan'208";a="8427146" Received: from zprzybys-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.138]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2024 00:35:13 -0800 From: Maciej Wieczor-Retman To: reinette.chatre@intel.com, shuah@kernel.org, fenghua.yu@intel.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, ilpo.jarvinen@linux.intel.com Subject: [PATCH v6 1/5] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT Date: Fri, 16 Feb 2024 09:34:56 +0100 Message-ID: <62192ad50be67f750b78a0e28a62b7704fbc63f5.1708072203.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Ilpo Järvinen To select test to run -t parameter can be used. However, -t cat currently maps to L3 CAT test which will be confusing after more CAT related tests will be 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 Reviewed-by: Reinette Chatre --- Changelog v5: - Add Reinette's reviewed-by tag. Changelog v3: - Expand group description in struct comment (Reinette). 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 | 3 +++ tools/testing/selftests/resctrl/resctrl_tests.c | 16 +++++++++++----- 3 files changed, 16 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 c52eaf46f24d..a1462029998e 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -65,6 +65,8 @@ struct user_params { /* * resctrl_test: resctrl test definition * @name: Test name + * @group: Test group - a common name for tests that share some characteristic + * (e.g., L3 CAT test belongs to the 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 +75,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