From patchwork Thu Feb 22 21:35:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 205072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp223533dyb; Thu, 22 Feb 2024 13:37:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVrpEjKDwvoy0NMd+i3a1crHA08ReRUBJJ9nALkcrZIzIO/60JdtPh7JqyPWR5qV7mJ3lkMevvaZ6JY83pmGFiAOlMFCQ== X-Google-Smtp-Source: AGHT+IGhw5h1+ICaKY1dkcLRogPKyK1lxa917nA2m3B/MyT2FyrDGHQDAXgWaDLd1sBPjul/vlWk X-Received: by 2002:a05:6a20:d90a:b0:1a0:a92f:f486 with SMTP id jd10-20020a056a20d90a00b001a0a92ff486mr109766pzb.59.1708637827153; Thu, 22 Feb 2024 13:37:07 -0800 (PST) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ei5-20020a056a0080c500b006e462f4c5acsi7840357pfb.327.2024.02.22.13.37.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:37:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77409-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=lhh+RvjC; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-77409-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77409-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E3738287DF9 for ; Thu, 22 Feb 2024 21:36:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E05A112D215; Thu, 22 Feb 2024 21:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="lhh+RvjC" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.62]) (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 C170112D1F8; Thu, 22 Feb 2024 21:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637766; cv=fail; b=kDzpIPeHDAebofEBmhKEKIMomS5gOcVPlOTYtisdAXiSfXOj+wWqXar0Z2RsACU0MS70M3Lc1ZW1D+Mp8jwiAy92DpMzexajCc1wm7kpSKGpgypd8Dlj4DjUrLOaISKH/KRcw9nax8UhD6CVjySKhTQ+PQNM0+nPPnc4F9zPlzk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637766; c=relaxed/simple; bh=XmFx/Vm+R1wlwYghrHII4BkxGnxfNXyryQDmmATu1AM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d0wlRcw3DLRhqaJ1YoG40162N+Uecw5+3nK/t/pnw31WUFGSQz2qLYo/dZS9UBsbWtbDz9W8++vaVBvxJZhQuaaJX9Hg3iubuG4iqIP0rcq4gBt4++IvPIzGr4huO1yVSkE+7BBosB85Ls6VmPWdVlFljOhL/xwP9h7QlPT+F6c= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=lhh+RvjC; arc=fail smtp.client-ip=40.107.243.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JmXLXdhGNl0m97QdLmEBBKPXmm3PoRcf4qGLeAN53Bn9xWHLPARS8R+JK3/MwQREpbuAm1WN2bR3VK57dc88/EP1F/5TJ21F1ts4iJupcqXoSJDH5Oon7CthhaLLFv/ED5yiZVIdYsh7kKEzThZ2hYSdSKFbZ8eijnm2D29/g6l+a7L7egrsLedmKb2M6AygoG0HQbkN+PqnzgsSzvLsIEUZPJGFsN9iN80tVdjDuiZCqleK/dw5O7Wa1VkfMkDKuM4FmURRMF3gwM/wVQHdv+r9jVGONumGaCtRFiX2V9RPKC0O3EHG5Jh3pUyyR7Tuk8/+Jle3O65Q+XHx6FV3Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sokW/1SVjBLwv7iWek3JwDcw56P5NX04QetPcphla7w=; b=boxtlXSu2sPmLCycX2QoX14yt4s5NJ0FqtGt7XbVKAVYvbJ6tK5nF1NlhBf6Zew71frru6mztH6FPMYl+v/XmniV7P+7NQOQrp6liW8PNeIoEUkCW5jiU0r+dchx5hM+9Zp6RVUl3a7N+b1/hLf3S8jax+MxsmR6BddzAc5X68g1NSNa9pqEBqpipULjFYxPltzi7M82SifKSE4xc71xzfDPSR0oajxyU+pa4f8/UEgLm4OA/oNGfpJ2hNdnZHbC4TVJp+iVWTyBYfcxM4q7/3IR2iR3n1QX5VfGCMHRosezlESGMoKROsr/NjF/STuqJ9e1MOPXpVTW58sWqJWgpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sokW/1SVjBLwv7iWek3JwDcw56P5NX04QetPcphla7w=; b=lhh+RvjCcthGQA7jXum5AoLmZHeOOIH80WeQmUTp7YWkd5nT6wydJqVOworpoPVJmJtJwsTRgDju2sCJma+h/8tqBQUGTP3PvVVCbtE6K0JCe87db8FZPQQ6AoQsUQeOnbTo85UTyGeZf/nnqC3fSYmh4VPIBbShXE+1ROgjXpk= Received: from DS7PR03CA0304.namprd03.prod.outlook.com (2603:10b6:8:2b::16) by CH3PR12MB9079.namprd12.prod.outlook.com (2603:10b6:610:1a1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.21; Thu, 22 Feb 2024 21:36:02 +0000 Received: from DS1PEPF00017099.namprd05.prod.outlook.com (2603:10b6:8:2b:cafe::b9) by DS7PR03CA0304.outlook.office365.com (2603:10b6:8:2b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.43 via Frontend Transport; Thu, 22 Feb 2024 21:36:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017099.mail.protection.outlook.com (10.167.18.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Thu, 22 Feb 2024 21:36:02 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 22 Feb 2024 15:36:01 -0600 From: Babu Moger To: , , CC: , , , , , , Subject: [PATCH 1/4] selftests/resctrl: Rename variable imcs and num_of_imcs() to generic names Date: Thu, 22 Feb 2024 15:35:45 -0600 Message-ID: <458712890b9ac90b9e027ac1500881aedd58068c.1708637563.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017099:EE_|CH3PR12MB9079:EE_ X-MS-Office365-Filtering-Correlation-Id: 828efee6-1322-43ff-97dc-08dc33ee4476 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CkePfRjl4kw2O5wbAD4dzMAZ8G7/5nJWw/YCL796cXyJQBNrH591VPSuDBtdLSGARDYOeLvP4KT/9O/23KX5q3GQEUzKBEPQDytoImOd1Jp6hkYRUWLHMFqNvFiG/8OEqwMef+5dvvvORwlbM6GpT6OQZspqn/r0kGdSFgo6XZ7ElJrqqLkdzmXMaI80uJmR2SIkjA2f8OHOZjghwFWI1XT46LF+u80hp0uS/2QxbfJaD7zvVW2DtdoPP36ORxTLKFeF8s3WLyAieWisuXgTRVIBDTuJwGe3hXf9EiVpGpUHCSsvxwtvqNRwpy7jn+xTNsZ9btZ3SNkToBVXlLNxjRjOgnasTJJeMjvc8UAsRhuFszgTrRads4RFY43CpIRb98rjciPxnb2tYQAUvekDFA0lo70XO5Q62gkq06u7T6eq50cFMZL7KUD5N3uwUWOdF6QbbAfh3Ew2/qOz7wHAqEFP/UVOaX3yyDf8x/FatHepkIBf+hChkI9IKBkp288ZdPW9HpI7bPGj0p+kQfnm+pGugXPQfzMAA/SmmDhVQhQUQgWvzfCBN5KBVVOhO+KRJcd/j7ltwIWYDnBr5Vf7SRuLwfVEbae5ykASEU/th5WTwSbo9PAESV1lMLqQQ48e9iOdAlo4enH/q1PHzWRcFw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(36860700004)(46966006)(40470700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 21:36:02.2686 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 828efee6-1322-43ff-97dc-08dc33ee4476 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017099.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9079 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791636618438837880 X-GMAIL-MSGID: 1791636618438837880 In an effort to support MBM and MBA tests for AMD, renaming for variable and functions to generic names. For Intel, the memory controller is called Integrated Memory Controllers (IMC). For AMD, it is called Unified Memory Controller (UMC). No functional change. Signed-off-by: Babu Moger --- tools/testing/selftests/resctrl/resctrl_val.c | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 88789678917b..52e23a8076d3 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -60,7 +60,7 @@ struct imc_counter_config { }; static char mbm_total_path[1024]; -static int imcs; +static int number_of_mem_ctrls; static struct imc_counter_config imc_counters_config[MAX_IMCS][2]; void membw_initialize_perf_event_attr(int i, int j) @@ -211,15 +211,16 @@ static int read_from_imc_dir(char *imc_dir, int count) } /* - * A system can have 'n' number of iMC (Integrated Memory Controller) - * counters, get that 'n'. For each iMC counter get it's type and config. + * A system can have 'n' number of iMC (Integrated Memory Controller for + * Intel) counters, get that 'n'. In case of AMD it is called UMC (Unified + * Memory Controller). For each iMC/UMC counter get it's type and config. * Also, each counter has two configs, one for read and the other for write. * A config again has two parts, event and umask. * Enumerate all these details into an array of structures. * * Return: >= 0 on success. < 0 on failure. */ -static int num_of_imcs(void) +static int get_number_of_mem_ctrls(void) { char imc_dir[512], *temp; unsigned int count = 0; @@ -279,12 +280,12 @@ static int initialize_mem_bw_imc(void) { int imc, j; - imcs = num_of_imcs(); - if (imcs <= 0) - return imcs; + number_of_mem_ctrls = get_number_of_mem_ctrls(); + if (number_of_mem_ctrls <= 0) + return number_of_mem_ctrls; /* Initialize perf_event_attr structures for all iMC's */ - for (imc = 0; imc < imcs; imc++) { + for (imc = 0; imc < number_of_mem_ctrls; imc++) { for (j = 0; j < 2; j++) membw_initialize_perf_event_attr(imc, j); } @@ -309,7 +310,7 @@ static int get_mem_bw_imc(int cpu_no, char *bw_report, float *bw_imc) /* Start all iMC counters to log values (both read and write) */ reads = 0, writes = 0, of_mul_read = 1, of_mul_write = 1; - for (imc = 0; imc < imcs; imc++) { + for (imc = 0; imc < number_of_mem_ctrls; imc++) { for (j = 0; j < 2; j++) { ret = open_perf_event(imc, cpu_no, j); if (ret) @@ -322,7 +323,7 @@ static int get_mem_bw_imc(int cpu_no, char *bw_report, float *bw_imc) sleep(1); /* Stop counters after a second to get results (both read and write) */ - for (imc = 0; imc < imcs; imc++) { + for (imc = 0; imc < number_of_mem_ctrls; imc++) { for (j = 0; j < 2; j++) membw_ioctl_perf_event_ioc_disable(imc, j); } @@ -331,7 +332,7 @@ static int get_mem_bw_imc(int cpu_no, char *bw_report, float *bw_imc) * Get results which are stored in struct type imc_counter_config * Take over flow into consideration before calculating total b/w */ - for (imc = 0; imc < imcs; imc++) { + for (imc = 0; imc < number_of_mem_ctrls; imc++) { struct imc_counter_config *r = &imc_counters_config[imc][READ]; struct imc_counter_config *w = @@ -368,7 +369,7 @@ static int get_mem_bw_imc(int cpu_no, char *bw_report, float *bw_imc) writes += w->return_value.value * of_mul_write * SCALE; } - for (imc = 0; imc < imcs; imc++) { + for (imc = 0; imc < number_of_mem_ctrls; imc++) { close(imc_counters_config[imc][READ].fd); close(imc_counters_config[imc][WRITE].fd); } From patchwork Thu Feb 22 21:35:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 205076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp226445dyb; Thu, 22 Feb 2024 13:44:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUmC/y0pOpgzGtIzBZQc4eNJ0smbX0EP8M9F1EwQFKdz9Eo/PLCQSU7Ox833VVlAcjHivBf0ZLZT/WnRoinycoPuoxlsA== X-Google-Smtp-Source: AGHT+IFapKL2IlRlHfrB71uQcqvbYR54zUid1CgPF8ieC8h+tbIUql0hrVz4zhEhUj77PFzSTRuH X-Received: by 2002:a05:6a20:37a7:b0:19c:881d:78e6 with SMTP id q39-20020a056a2037a700b0019c881d78e6mr88439pze.42.1708638254631; Thu, 22 Feb 2024 13:44:14 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u7-20020a655c07000000b005dc0b3095b3si10780111pgr.283.2024.02.22.13.44.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:44:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77410-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hQmXQk1j; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-77410-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77410-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0AE86B24CB3 for ; Thu, 22 Feb 2024 21:36:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B70F5137913; Thu, 22 Feb 2024 21:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="hQmXQk1j" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2074.outbound.protection.outlook.com [40.107.220.74]) (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 B8AE373F3F; Thu, 22 Feb 2024 21:36:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637773; cv=fail; b=Lrb7cuf+xKaQyJYKWdR29MlvxDmaZsTOM1JrF9pdncREXnnJsaakicoDzXooa+FMOworU85SbuemZkA/e2Ga2INzQzVEdaiNaID/lzSmAGSuaPNG7at3z7QstnOkh0Qpz6LN6ux+nk2plDgP219z3HzjSxH6W9dDTImxIFJ8PKU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637773; c=relaxed/simple; bh=WHzPfkLmU1pX8pc7gX5AtwW8b+ThTUf2zFTzDo6yPyQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LfKuHK9Pg9lqY5R7PtveXK66xtXNm0IZ6aog3u5tvGEq2MqslCBOaKo0CUb/paRen2V0MzSyrUXP4Apl4yyJFRHuIlUg0n1VHoRsO6URP3IaInyufCb0lcvawwmsbU2pGI38cSCFsYZOxsyKUK1OHSW+THRl7yv+HIT3M2Jkh00= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=hQmXQk1j; arc=fail smtp.client-ip=40.107.220.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VEbCho1h21o+EWvs2XSrvYbNn7kHXL8WEZBbc+zyoJnVweafxE3KFIjn1pWmQQPLwbcc5qGfdXybnlcgOsV+2Yfn6/jnWU/LKXtyc+2DIep9t2iaU98z3vIUf2okkN1bjtOWipjkWmBC0LG48ZdlSytHc00Gyxy0X9BQNPSOR/1A5jiSSjmAAJZ2pyW8yXf0rQnlQE9Hbzr1diXo0nWJyTdHHtKOb6AQ6y0ZG+wLcNCyvqyY+je4sNni9496lZ8w4dCfY25glFggmfjlmwoZQfs4+a/mk3RPMxsC6moX+AxBT14e88YA3FQCqhVOxPBHeOTpjePpYTo3RbzfzLGEjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Bq0AKnY5EmQ1Ouikp0DFJNwiBV4LxWGqaBTsFCeQnZI=; b=SgGctIWDs8fgELyqAPS0i5eTu4Au6bbWMomiV8N6z4xZl+xLs0Y+0AnweIiBaaTM9EgjYfq/JyE68tZXBeIpTckkWysK/AuJiPiP1yalb9NY06lO+Ds9nQtNBZfJ0SQ/r3v2QyvoL1WiLqm3ax8JDhklc6Sh/eb3bGlopFeNFGo2smAVMrGBXVl1oy03xoSF3yenYk2VAIaPXpkkaGYIRIxxnYM2QwkBGX6DmZnbEc7BpvV5x0bnDUxkxJ48VbhAnJWBOjbaN68kUHAN/kVaqZouy0oXc26pE55Ukz6CzLvuDq2QDNzPpBYCPkWe5J7/Gaq25DPMpMc/MRv6IxNTqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Bq0AKnY5EmQ1Ouikp0DFJNwiBV4LxWGqaBTsFCeQnZI=; b=hQmXQk1jlTU3AxdiiQ0YKtt8ubdLlAWNiloEWaNTsCm6o3wc8+xIDbV6ZPJ2KaPTZcclBmn1SONrnSp9CeZPKd0YA7lwTOCzQH6hJOw5bviGrREE1OjNlCxUwlBCe7/B5K9qgHagAWOIs6FANgtKrT5V9g1O1x/S7MXGuJL9Bxs= Received: from DM6PR03CA0040.namprd03.prod.outlook.com (2603:10b6:5:100::17) by IA0PR12MB7625.namprd12.prod.outlook.com (2603:10b6:208:439::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.24; Thu, 22 Feb 2024 21:36:09 +0000 Received: from DS1PEPF00017097.namprd05.prod.outlook.com (2603:10b6:5:100:cafe::bf) by DM6PR03CA0040.outlook.office365.com (2603:10b6:5:100::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.43 via Frontend Transport; Thu, 22 Feb 2024 21:36:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017097.mail.protection.outlook.com (10.167.18.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Thu, 22 Feb 2024 21:36:09 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 22 Feb 2024 15:36:08 -0600 From: Babu Moger To: , , CC: , , , , , , Subject: [PATCH 2/4] selftests/resctrl: Pass sysfs controller name of the vendor Date: Thu, 22 Feb 2024 15:35:46 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017097:EE_|IA0PR12MB7625:EE_ X-MS-Office365-Filtering-Correlation-Id: 3bcf7164-deee-4392-a568-08dc33ee4890 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ARcl+T9+XBpQzBKNWJuqDHIokNFVV3rrFIhZpmaV1or+F3BdH8wFIfof+pQbgN14F5CFI/xCondaJQXK1NTya/ebCkHzquMbAxUvowR7bc/7prPAtwLtwndEFn66ETW/nWEZ8xFSRKglFAGJIe+P1zcgSXbUJZCOH7qonlD4PAokwpEwLYUHDnm/npTQg+hrMp0eKfHWjfYEXBzYai5pOZyPEYCzjZAOvssy6UyglqZU/uAQh/RAKb2XOTVR6JzVeY4zfWrSDpm98jEiJhN+gYs5VbbqyIgEhRD6eOLhtWO4oIO3JtbPKBjAjJdNdOKNf46HMNIETpRPc5/rX/l0bynF7mbMKQDsP6Gjc+/+A0vce4z9Q8GddvXkxR4vbRu+l5z+82vtHsEZyAFeFVKsYAuII3ynaUpKTrqChTUkvRFTs0RqkjoPT9qWggbqZpoKBoatL8L2gFtV2wglu5SYBxp8r/u6potdIJFKXgOYtNyxqBiwlQuDisMD+LQv3mmLjrpCOASnzkFWNGw1INBgYq3gj2tffaPlwfuAcc2kMdjonMxlvmfvFAVYWXMNd7wamTWg4y4PqodFd50m28oz1uxtLM7YkQJJsFdH4k0s3LlhEPGD24iAehDA23EDD3Fd//RCESvjdI3G+DYlNT9G2sje1ALwWMHV2gBn8YkzBoU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(36860700004)(46966006)(40470700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 21:36:09.1658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bcf7164-deee-4392-a568-08dc33ee4890 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017097.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7625 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791637066697746913 X-GMAIL-MSGID: 1791637066697746913 Detect the vendor and pass the sysfs name for the vendor for searching the controller information. Signed-off-by: Babu Moger --- tools/testing/selftests/resctrl/resctrl_val.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 52e23a8076d3..792116d3565f 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -224,14 +224,24 @@ static int get_number_of_mem_ctrls(void) { char imc_dir[512], *temp; unsigned int count = 0; + int ret, vendor, size; struct dirent *ep; - int ret; + char *sysfs_name; DIR *dp; + vendor = get_vendor(); + if (vendor == ARCH_INTEL) { + sysfs_name = UNCORE_IMC; + size = sizeof(UNCORE_IMC); + } else { + perror("Unsupported Vendor!\n"); + return -1; + } + dp = opendir(DYN_PMU_PATH); if (dp) { while ((ep = readdir(dp))) { - temp = strstr(ep->d_name, UNCORE_IMC); + temp = strstr(ep->d_name, sysfs_name); if (!temp) continue; @@ -242,7 +252,7 @@ static int get_number_of_mem_ctrls(void) * well and hence the last underscore character in * uncore_imc'_' need not be counted. */ - temp = temp + sizeof(UNCORE_IMC); + temp = temp + size; /* * Some directories under "DYN_PMU_PATH" could have From patchwork Thu Feb 22 21:35:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 205073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp223683dyb; Thu, 22 Feb 2024 13:37:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWyGxgZa9gMOiaAHHDd+DwojOHeeu1adYAQzwnclVHgihbAwEm8n6MfAoD3FWd/DpCfEd4B8Bxj8PP4sF6y6dBtmbxqNw== X-Google-Smtp-Source: AGHT+IGRoIvra8ImJUd0y72+SrutOjUDiE3+fjmu4q6Om/q0JC6tF5sl5lx2sKT6HilZJxwdZaUr X-Received: by 2002:a05:6a21:3403:b0:1a0:dd75:f303 with SMTP id yn3-20020a056a21340300b001a0dd75f303mr123187pzb.13.1708637847078; Thu, 22 Feb 2024 13:37:27 -0800 (PST) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fh3-20020a056a00390300b006e13b97c352si11239752pfb.341.2024.02.22.13.37.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:37:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Sq9dESBs; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-77412-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77412-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0DB43285BD6 for ; Thu, 22 Feb 2024 21:37:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5433B13793D; Thu, 22 Feb 2024 21:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Sq9dESBs" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2046.outbound.protection.outlook.com [40.107.223.46]) (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 11F1E13792B; Thu, 22 Feb 2024 21:36:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637780; cv=fail; b=d7lEwLCxG2KNAu6enNRKoyZ01agZvVWzR192v6WYy3GrE5+rP9pYb2UYB5m2NOJY+kz86M4iHKuF7a2l3VocVQ7cyK9AWlNTp8xNayBCu+dSA/IIG3EosPlUwgTsy6sCwUMkD/FyYnKDSIIyRAje5BA0hm6NdhyPL8RQWkE6r64= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637780; c=relaxed/simple; bh=XaP5u+BFFWYNcOyH73ZHdsL/DZ3iJkMNMTJJECjrXBo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GBHESUnwc98toeNnVl5Em7FO7Nqc/780t4vbb2uzDlMyQ9tg8332kq0gmj1HWSW+9q7+SHP8FUD1RspiityGT+DkT+Woain6OOfbMeFJ58ermkCulZ0dhQkjkbtsXVSh7kXmY9O8E8hPbg0rQVGmU5BNBkFgsarFGO4lpax4iEk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Sq9dESBs; arc=fail smtp.client-ip=40.107.223.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EOi4xsJbiiByKTOi56SimQxtUCYfGGPNZ+Mv9ELzak2YhMWcwM2042/XcYWonqIHSQuTDGaS8eA0EmE27tToyrCRb9kYHO6WNH0BDDya3aaAhceBrl3RGHgz1C8zg/1SDYkwbCnfi1MCYgltRlqYwtUfPlop0XH50xzmk2Fci2wkEXVrrfDMSUYHvezDHDbA1GaooLL/EEvL1uDBId03wMRa4RWCGRTdznl5fgijA7LpBZEVFpRi5+sSqUlhT+ZDaKRB+jrOBF0VNKMFuUomwV4AJ9+LKy1qCzDfMA9jdoA7shoF6AoZXZrxwHvvhtpOIbUApyIRh63cOsiM9Z07gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I6X4zumhHg5MSgiirIr2vbS7jyrCcXhRrPsiSo3iH6I=; b=eF7nxnRU+tqO7Ko/LQFrARJKWkCoXdyt/A1TNmyIv4+vX7T8kbHOXDTL+bAZ9YetpTbQRoofbmrZM9gu1iyjRdwKJbUjkeC167u+sTY9utid1M+nmHiaYAIkq3Cgs8ioRqvydjsnU6VxPNQmYTsPJ7o9Wt5dxbW/R05Kd1kR6udn7tsxU053f87MrvSv43ktfiHRQ4OKYSlNquy9T3DEsuOr+dG7IXGx0wha7SlnBQgcVwoWCkLyXMVDtwrYMdRhATKnNkHOMeseOrmrE3Zo0OxnEYKtu5tJqC/20tLw7Vyhz/mXLUV4HdA31/WdfKiGzPcPcnhXBSg9oTiCOh4CJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I6X4zumhHg5MSgiirIr2vbS7jyrCcXhRrPsiSo3iH6I=; b=Sq9dESBsBlVVQE+PLFy5cy6pkKZ4ZTGqspWHAb1e2ZNnnTTBgj0wLVgGm1iOGRDnLdn/gwlKlCYbgAASzvnSifzGaBxoXZCkVm3e75kGKf6Rpmh1o91zrLrUQj3OZdWnstmgs1+mwuv1XEWyO/RJ+X6ndENjrEmnytpJ3u5W0R4= Received: from DM6PR05CA0057.namprd05.prod.outlook.com (2603:10b6:5:335::26) by SA1PR12MB7367.namprd12.prod.outlook.com (2603:10b6:806:2b5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.15; Thu, 22 Feb 2024 21:36:16 +0000 Received: from DS1PEPF00017096.namprd05.prod.outlook.com (2603:10b6:5:335:cafe::22) by DM6PR05CA0057.outlook.office365.com (2603:10b6:5:335::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31 via Frontend Transport; Thu, 22 Feb 2024 21:36:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017096.mail.protection.outlook.com (10.167.18.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Thu, 22 Feb 2024 21:36:16 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 22 Feb 2024 15:36:15 -0600 From: Babu Moger To: , , CC: , , , , , , Subject: [PATCH 3/4] selftests/resctrl: Add support for MBM and MBA tests on AMD Date: Thu, 22 Feb 2024 15:35:47 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017096:EE_|SA1PR12MB7367:EE_ X-MS-Office365-Filtering-Correlation-Id: eb9396d8-2fca-43c6-33fe-08dc33ee4cbe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TCPZoPlzk4yaAtSvuyutuXK2UzzWidky/DlJEOav5XjNWSdogZ1r/eCpVmqil2G5UdPbrtjq5cqWGkHcv1qy7FBHZKRAlpbleiJUvKhtnwSwFn2z77sU1/6UULSKVahlH4vecb9ID3Tebx9OatqojnryrflZictT33KTGwg3ePxDSaYFSU10t5tE3nhkzfyscicaBDj/VyrXw8lkm9aHRinTXNiiRyCLWU5mB8tZYQ9NUsgUbVGilTm7XPC5nO7LLVujjnSdVwt8FaeIQ4SY6jcD08yg8FaenK/f6wucpBATJP4Hg3QNqVeFsIpvH7NSruyROQq06MubbeupPcvOjXKATzgbnY7e23oS8TE0mTemDrj/sRQEQbtMuaNqFqBvv1+6Qs0mv3HK59qmAo40y2gJ8l/tcsPPeCH9Wr5od56SkPAYDwLZ7hopKLv2rDMPqmS6N/GSlMsHe7f6aFIzuGtrVFFlH82uSBO32+08tEhtjod3Riyn/EC4kFDvchWmYN1foUqpVbFUWMw3SKlzS/trFkP/u0qimWAoL4EX2DSe6ZEmYOvJvvbwwB4YXXohXOUs6EqOla3q3L6+cBy+eB0RzpDtMAAdAKNT5wDlZ89cApjjYm5sarXQL/Svuf+Z5oYWC6bYEKQnELbz9vOUaz72MUCTU55VOekGhZu3bX4= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(36860700004)(40470700004)(46966006);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 21:36:16.1596 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb9396d8-2fca-43c6-33fe-08dc33ee4cbe X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017096.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7367 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791636639465934132 X-GMAIL-MSGID: 1791636639465934132 Add support to read UMC (Unified Memory Controller) perf events to compare the numbers with QoS monitor for AMD. Signed-off-by: Babu Moger --- .../testing/selftests/resctrl/resctrl_tests.c | 6 +- tools/testing/selftests/resctrl/resctrl_val.c | 62 +++++++++++++++++-- 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index 2bbe3045a018..231233b8d354 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -104,8 +104,7 @@ static void run_mbm_test(const char * const *benchmark_cmd, int cpu_no) } if (!validate_resctrl_feature_request("L3_MON", "mbm_total_bytes") || - !validate_resctrl_feature_request("L3_MON", "mbm_local_bytes") || - (get_vendor() != ARCH_INTEL)) { + !validate_resctrl_feature_request("L3_MON", "mbm_local_bytes")) { ksft_test_result_skip("Hardware does not support MBM or MBM is disabled\n"); goto cleanup; } @@ -131,8 +130,7 @@ static void run_mba_test(const char * const *benchmark_cmd, int cpu_no) } if (!validate_resctrl_feature_request("MB", NULL) || - !validate_resctrl_feature_request("L3_MON", "mbm_local_bytes") || - (get_vendor() != ARCH_INTEL)) { + !validate_resctrl_feature_request("L3_MON", "mbm_local_bytes")) { ksft_test_result_skip("Hardware does not support MBA or MBA is disabled\n"); goto cleanup; } diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 792116d3565f..c5a4607aa9d9 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -11,6 +11,7 @@ #include "resctrl.h" #define UNCORE_IMC "uncore_imc" +#define AMD_UMC "amd_umc" #define READ_FILE_NAME "events/cas_count_read" #define WRITE_FILE_NAME "events/cas_count_write" #define DYN_PMU_PATH "/sys/bus/event_source/devices" @@ -146,6 +147,47 @@ static int open_perf_event(int i, int cpu_no, int j) return 0; } +/* Get type and config (read and write) of an UMC counter */ +static int read_from_umc_dir(char *umc_dir, int count) +{ + char umc_counter_type[1024]; + FILE *fp; + + /* Get type of iMC counter */ + sprintf(umc_counter_type, "%s%s", umc_dir, "type"); + fp = fopen(umc_counter_type, "r"); + if (!fp) { + perror("Failed to open imc counter type file"); + + return -1; + } + if (fscanf(fp, "%u", &imc_counters_config[count][READ].type) <= 0) { + perror("Could not get imc type"); + fclose(fp); + return -1; + } + + fclose(fp); + + imc_counters_config[count][WRITE].type = + imc_counters_config[count][READ].type; + + /* + * Setup the event and umasks for UMC events + * Number of CAS commands sent for reads: + * EventCode = 0x0a, umask = 0x1 + * Number of CAS commands sent for writes: + * EventCode = 0x0a, umask = 0x2 + */ + imc_counters_config[count][READ].event = 0xa; + imc_counters_config[count][READ].umask = 0x1; + + imc_counters_config[count][WRITE].event = 0xa; + imc_counters_config[count][WRITE].umask = 0x2; + + return 0; +} + /* Get type and config (read and write) of an iMC counter */ static int read_from_imc_dir(char *imc_dir, int count) { @@ -233,6 +275,9 @@ static int get_number_of_mem_ctrls(void) if (vendor == ARCH_INTEL) { sysfs_name = UNCORE_IMC; size = sizeof(UNCORE_IMC); + } else if (vendor == ARCH_AMD) { + sysfs_name = AMD_UMC; + size = sizeof(AMD_UMC); } else { perror("Unsupported Vendor!\n"); return -1; @@ -246,11 +291,12 @@ static int get_number_of_mem_ctrls(void) continue; /* - * imc counters are named as "uncore_imc_", hence - * increment the pointer to point to . Note that - * sizeof(UNCORE_IMC) would count for null character as - * well and hence the last underscore character in - * uncore_imc'_' need not be counted. + * Intel imc counters are named as "uncore_imc_", + * hence increment the pointer to point to . + * Note that sizeof(UNCORE_IMC) would count for null + * character as well and hence the last underscore + * character in uncore_imc'_' need not be counted. + * For AMD, it will be amd_umc_. */ temp = temp + size; @@ -262,7 +308,11 @@ static int get_number_of_mem_ctrls(void) if (temp[0] >= '0' && temp[0] <= '9') { sprintf(imc_dir, "%s/%s/", DYN_PMU_PATH, ep->d_name); - ret = read_from_imc_dir(imc_dir, count); + if (vendor == ARCH_INTEL) + ret = read_from_imc_dir(imc_dir, count); + else + ret = read_from_umc_dir(imc_dir, count); + if (ret) { closedir(dp); From patchwork Thu Feb 22 21:35:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 205077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp226806dyb; Thu, 22 Feb 2024 13:45:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUyDcwiWHM2/JyYWvqC06jLRFr4tHHGuFIM59QgnauYzLjKjXizNlf4A8OTAfa/yKdOPAlb7K1DYsFdAvFzkNJESysbeA== X-Google-Smtp-Source: AGHT+IGPRxAsSsk8idA8h0mXsv7NE36wE4Z2hJPYSO5kJApuFYZ4AkOTLh+6/XLp4TKVD+2cD4Oe X-Received: by 2002:a05:6359:5105:b0:179:292:223 with SMTP id ob5-20020a056359510500b0017902920223mr3681rwb.28.1708638315287; Thu, 22 Feb 2024 13:45:15 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fd24-20020a056a002e9800b006e0949b2543si11305576pfb.342.2024.02.22.13.45.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:45:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77413-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=yVQNj7xe; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-77413-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77413-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 39EB5B2589A for ; Thu, 22 Feb 2024 21:37:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21DCD13BACE; Thu, 22 Feb 2024 21:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="yVQNj7xe" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2046.outbound.protection.outlook.com [40.107.93.46]) (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 2C3E612D208; Thu, 22 Feb 2024 21:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637787; cv=fail; b=o6Dwkejg6p3bNq3cf5nM78E9OO2o8VjKjaTJJKhejPZLEcgflVMIQr2Cw94sM/u2k908WyCn8LP6Y+7SLgHTKyYE2aJZ7f+sd8ZUdnX+JAIGeWgADJpQiWGCmum+13MRKEb2mchjI/ZW9FgzOpiLLiMEySPA+H/ncy3KzHT/KAg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637787; c=relaxed/simple; bh=NYPuXq0zy982kv5gXa5Go0nibOf5rQKQa5xeUr57kE0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NhNSiiphKkn5q0y2N7BJJ6/zbVTH6ikODFqxDS97ugH66SRuGFV+Q6SoF9GBzcjDcE9vzRKhQ8TnB1NrqCC9ykkggVxHwlc+lT99wS40W/8/1E+fa5vjNjuZVHC4uDfRIb+8nWfw6zfnuDJzPAHqJzJUTcdJAvOHiBYGCobHU1Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=yVQNj7xe; arc=fail smtp.client-ip=40.107.93.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kzbDvaZqrobSXDh8EBb24KQfJZXKuDZANISCoTLsdKSOgRtoc5arGQBNTep/0eRnPCU1JXAIPbRMZIfMt+ml7AGahLxk87w/EHAjQGjQtAYa4fLcNg+pkRA5+44jleZPH7gdx+K7q5zBaBoYasqJrDewfkLdsNKE73bh6/R139jIGOQ0+lAk+hW/x3FRYeDyog3IaCo/tjwWDk7rfQ8M+T0doitFnNcu2e3K/BISr5Ddng7JTKT9Gz+O0PvBfrl0ocED52O9QBmFNhQombX5R2Vmopkdn+jHuoin5uyQ5SSlPMl4g4sB1iJKhGT0sOtSnbwnZ50uByrd0cRANPMA9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wa+bfg0NmdxJH6C7Mcw8HPO3Mo28uhUUfKVVJLzxN0g=; b=ogTnahOl0Lq8VTwWvqx6wJ1yErJ7QCSsCsgJu8hGbzJ9tWbHe7xMDIaHJlDmQsqEtEQ4l2JJ3Ze8FpaDIEg+iz77gP0agvR1V5r6jsBbaGWEF/Y62vEjZUqJeNt5+qJRqb5fOF66hieHeRoqEbeFN2HvkLrc7nA7edugUF1LHTB0llr4Id/c7WGF7Tqli/7YcVhdM4BtvKMgsKBRwdWVdPYvsl9oB/5l5xF13E6fIZfuyyWl9CivBDl4eUY75kQmG9Zr3GXH0+h1JBVtopl+IO9lnQd9+P4KmGtoLTd55aiAcykAIJ+B21xgx1ArsQvmJA3CqoDSshamowqw8yIkiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wa+bfg0NmdxJH6C7Mcw8HPO3Mo28uhUUfKVVJLzxN0g=; b=yVQNj7xeMmyLthRqx1nG/Iv77bzP5ctb8aVaGz3Tx0p0z94GYKTKqQ3M3S8NxqnaT7RlFCsveiKf+0zJmYoWjgcrI3KqEdfZxd8TGMv6PsDIkBcMrcpUBHzocgAJAaZDi9UKK4jHwHM0ZVH9uHxwepg2ofV2U3Vesmwki47m8Vc= Received: from DM6PR13CA0034.namprd13.prod.outlook.com (2603:10b6:5:bc::47) by PH8PR12MB7157.namprd12.prod.outlook.com (2603:10b6:510:22b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.27; Thu, 22 Feb 2024 21:36:23 +0000 Received: from DS1PEPF0001709D.namprd05.prod.outlook.com (2603:10b6:5:bc:cafe::72) by DM6PR13CA0034.outlook.office365.com (2603:10b6:5:bc::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.24 via Frontend Transport; Thu, 22 Feb 2024 21:36:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0001709D.mail.protection.outlook.com (10.167.18.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Thu, 22 Feb 2024 21:36:23 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 22 Feb 2024 15:36:22 -0600 From: Babu Moger To: , , CC: , , , , , , Subject: [PATCH 4/4] selftests/resctrl: Skip the tests if iMC/UMC counters are unavailable Date: Thu, 22 Feb 2024 15:35:48 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709D:EE_|PH8PR12MB7157:EE_ X-MS-Office365-Filtering-Correlation-Id: 690dfc4f-316a-4b41-e782-08dc33ee50f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZGKZTiJrKNB0p7r7NiUqVFGFM6X1NWPn8yuWXA9er3gjSdkyhFe0OUO8GNVVcV9P/6H/4zHP3yMyY7Ax9L3yfKQpEagPGxxXAnFPH4Kew32SxHEPXrifq847hSBYQGn4ckDFUbEgbXs3XvciYkxdRK2iADUSIfkEycAhQ/KYhweDtMGqY9iGISWwSXZTKDuLSelkCZCAKyQzOaTSQyLBV3l8MCrm+R6v1IBv1+dtHb9duh8SP30zLFx4OwCncJ/3ljWSGqZdEbIUTBPsjW1GJ7AnOg3lhWKNOakqdLrglRy/PdCR+9JfsIJdERZ+bXUb1dAXKG2CeLCQ7KxHRhsRlcw8iqJpkQBTj7fqU5LB/Y9VsKPkPZLKkuP/UafZdFShnvkxHtg+XKbC9tF7xXLOk3JntYozPJDPLksD6GBLltpe1L1rk9bzlSj1j0qnFKXzSovgkLEOIXRqGyqyOatumVjAknHfd1LRD+mG9KkSHScH4Xbm1vSnr+2G3tKXDShIbn0SUzykvkEM+bT+fVZLqVPf/3ptGcQQ1/rwtLas2WLKw8aBgXTjVX5G1fT9dHd6b+BIzibfU3R05SunV5OIJ2aCClxw2r7Tr95ip6inAGviEv+4Z/qW4El/Z0vPYBSlzGi47jKtrE4jdXwC1HFcQEwmtAEgBtkaEd4FQZ+0NrM= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(36860700004)(40470700004)(46966006);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 21:36:23.1716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 690dfc4f-316a-4b41-e782-08dc33ee50f0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7157 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791637129938509283 X-GMAIL-MSGID: 1791637129938509283 Older systems do not support UMC (Unified Memory Controller) perf counters. Skip the tests if the system does not support UMC counters. Signed-off-by: Babu Moger --- tools/testing/selftests/resctrl/resctrl.h | 1 + tools/testing/selftests/resctrl/resctrl_tests.c | 10 ++++++++++ tools/testing/selftests/resctrl/resctrl_val.c | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index a33f414f6019..5c2556af0649 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -116,5 +116,6 @@ int show_cache_info(unsigned long sum_llc_val, int no_of_bits, size_t cache_span, unsigned long max_diff, unsigned long max_diff_percent, unsigned long num_of_runs, bool platform, bool cmt); +int get_number_of_mem_ctrls(void); #endif /* RESCTRL_H */ diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index 231233b8d354..5423882529ec 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -98,6 +98,11 @@ static void run_mbm_test(const char * const *benchmark_cmd, int cpu_no) ksft_print_msg("Starting MBM BW change ...\n"); + if (get_number_of_mem_ctrls() < 0) { + ksft_test_result_skip("Unable find iMC/UMC counters!\n"); + return; + } + if (test_prepare()) { ksft_exit_fail_msg("Abnormal failure when preparing for the test\n"); return; @@ -124,6 +129,11 @@ static void run_mba_test(const char * const *benchmark_cmd, int cpu_no) ksft_print_msg("Starting MBA Schemata change ...\n"); + if (get_number_of_mem_ctrls() < 0) { + ksft_test_result_skip("Unable find iMC/UMC counters!\n"); + return; + } + if (test_prepare()) { ksft_exit_fail_msg("Abnormal failure when preparing for the test\n"); return; diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index c5a4607aa9d9..68cee87c26ef 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -262,7 +262,7 @@ static int read_from_imc_dir(char *imc_dir, int count) * * Return: >= 0 on success. < 0 on failure. */ -static int get_number_of_mem_ctrls(void) +int get_number_of_mem_ctrls(void) { char imc_dir[512], *temp; unsigned int count = 0; @@ -323,7 +323,7 @@ static int get_number_of_mem_ctrls(void) } closedir(dp); if (count == 0) { - perror("Unable find iMC counters!\n"); + perror("Unable find iMC/UMC counters!\n"); return -1; }