Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1402805lqb; Thu, 30 May 2024 09:08:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULmXRS8yQC8JgFP/SqCGOkHfuxZI3BhU5uDDkyYgOg8rGU66LyVBmnpRYVaw6sJq4n9IxakSoroxBF8r8fMU9usyzDm+ZO9/tL8rYVFA== X-Google-Smtp-Source: AGHT+IFneIBKdTYYSiUrktUAAMsgOUUpumULLtCNGzcoWcmV3CZMlw05yrZHJOelw0xZDOK+hGj5 X-Received: by 2002:a05:6a00:438c:b0:6ea:950f:7d29 with SMTP id d2e1a72fcca58-70231153fffmr2811700b3a.20.1717085316932; Thu, 30 May 2024 09:08:36 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-702018cfc95si315066b3a.307.2024.05.30.09.08.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 09:08:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195638-linux.lists.archive=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=CAfJFswd; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-195638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195638-linux.lists.archive=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 89765286D63 for ; Thu, 30 May 2024 16:08:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8787210E7; Thu, 30 May 2024 16:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="CAfJFswd" Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2056.outbound.protection.outlook.com [40.107.236.56]) (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 187DD2376A; Thu, 30 May 2024 16:08:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.56 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717085308; cv=fail; b=VNc5zbFTDGtq8OXkYI8Hb+qceKOxkKedleD4ZN9fWPJukMywhQCDMYUaJm+a+NK2HZ1cVAYPW6TLajMiUwKHvP91Pzu8lvtszty0as2u7XGJM/Nv1j6kIlj9b7G1dprxhmicuuvLkthFmm6ImHeXwjlPeHNcTYYYwR7JKR8t+90= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717085308; c=relaxed/simple; bh=PIEgyPmxzkwiZnmZBwc7dmglNaqDJ0mDVSwAEG053X4=; h=Message-ID:Date:From:Subject:To:Cc:References:In-Reply-To: Content-Type:MIME-Version; b=KcnmCanNLYfbe5Kshoh7y11kIvZTFmEUeduEb/Il/mCfI2yDu0rIGh1l6xVvqTbY9U1DX6ALZOmVM/NThI9CjLojCrmOI/Bf1oJwWNmhwKuTJBczXyJ9gLVg/RyXewwjrOwMKW5+7NzU9F/6Bba4awnxNZewaux+3dLJov5Su2Y= 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=CAfJFswd; arc=fail smtp.client-ip=40.107.236.56 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=l6mf4PcfFRBxcpN07UZejHUn7yT+brYJnWbsKJT2QFCl4p5g9BtsdeokxG7P+/BryVryRcBnbjsMQ4nTo7++o/luivhyq71MvAlDvW+Sk6+v7JYyfgQ8MG3ZxMmRFQKwCYsIOBGPPruyWeSkFiBrjuSWf2NdUAqIjg07zcmSsnFuGgOzLcrLmOxxX3XtycK2mibDHDliPaenGjPzQZeGdyltZ+inuAkiwEzYB7zUs83fREtSLVJkOvQhtBOz6KlONVZb5oPSMmorWJMmuifbK2NvG5uBlFG46a5Hxi/Px25P+AtvLh5EeeRy3YKcC8nVSK5+FcmQ2hw1lQ6ZK9vqaA== 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=smZw5grcACJy6u/Li+jPu/eJz4bshR+cFTVF7LaZobo=; b=ORsCxO+4CyYNfcPYPQLd6fEdw31lUfVKa52yj3U9eN/Cx+SliNa5MwPX+OcPc9uaTi+SG31vxZSviA/6ybOE5mqnjBzUlyEGsK6hMdbEX8yj+F7t/rRypRGG2PSgI5Efb4GwRvcfA2wnbKeeiWQCKyRs0D1khLLom2IZseR6QxGMiW85RJG+6oyjJ2CfepwNJszjv5oCnvs35hyYXd5k2cyNRIG6Kt0Q2ynPLvwowiyomcWypsnrnyKZSJ6kVqaqAho/COkjtXAh8szopfSKRCmCRXKYqrgqhemegIxGYhrPS9ww5+XMiCb80YDCztFnQxIcnEyGCJQkiph03Veaqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none 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=smZw5grcACJy6u/Li+jPu/eJz4bshR+cFTVF7LaZobo=; b=CAfJFswd23iAKty+OCe4AmbxvdwVMMuGPe0chb3+jg82LmzLLPcJYf8I7AUn9BxyZ/QDr2P/PAkwCyduBCvYz/ke+5eK6AekRRuaqsqwNv5vQKpUm2yf+OMaCM5rMSWori0aUpSkuncuNlqD6w79TXO8gkTRVs1rIYGYf6s93F0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by LV3PR12MB9119.namprd12.prod.outlook.com (2603:10b6:408:1a2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Thu, 30 May 2024 16:08:23 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::b0ef:2936:fec1:3a87]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::b0ef:2936:fec1:3a87%4]) with mapi id 15.20.7633.021; Thu, 30 May 2024 16:08:23 +0000 Message-ID: <66405792-5a7e-49b0-8cce-48c24419d2e1@amd.com> Date: Thu, 30 May 2024 11:08:20 -0500 User-Agent: Mozilla Thunderbird From: "Moger, Babu" Subject: Re: [PATCH v2 3/4] selftests/resctrl: Add support for MBM and MBA tests on AMD Reply-To: babu.moger@amd.com To: Reinette Chatre , fenghua.yu@intel.com, shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, ilpo.jarvinen@linux.intel.com, maciej.wieczor-retman@intel.com, peternewman@google.com, eranian@google.com References: <0367b45170fbc7411aad12c28802284a298c1c6f.1714073751.git.babu.moger@amd.com> <91eeb2d6-e0bc-43cd-8641-ddede63f3786@intel.com> Content-Language: en-US In-Reply-To: <91eeb2d6-e0bc-43cd-8641-ddede63f3786@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BN1PR13CA0006.namprd13.prod.outlook.com (2603:10b6:408:e2::11) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW3PR12MB4553:EE_|LV3PR12MB9119:EE_ X-MS-Office365-Filtering-Correlation-Id: fcf248e7-801b-46ca-23e1-08dc80c2bb55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|366007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?dkQrS012dHRMeWNyU0xja2Z6UG9hRG9HeUpFV3pYeHhRU1BrT1BaaGdoNUpz?= =?utf-8?B?Wjc0eWg3VlZlNyt3NnB1WW5LSktBTCtoZ2w3SVJ1a3pnaVlWNU1WTVludjBs?= =?utf-8?B?ZGxHT01pMEZTRDVhaERCTXBoOTZET2E3RjVEMGlWaERIZGc3OHBvQlNUVzlV?= =?utf-8?B?U1RhT2R3YVdvdXhHNVpzU0Nhb0oyWVUvVk8zL0tzaHFJaWNRV1J6YlFTcnMr?= =?utf-8?B?UjNENFZraHMyR0Z2cUIyR1ZGZ1JDWFJOVEFGNldIM0NzOVFUSENlRk5rSkh3?= =?utf-8?B?dE41SGtFRzM2T2dVbWY2WkVHTVJZTFh2QUxUMmFWVFRIR2xqVGxNTkNpVk0x?= =?utf-8?B?NVZBSkYwZ1Z5NGRo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utf-8?B?Z0pnV21lU0lNRk14R1RRVHc2QVhqY3h5TmliMFl2WEIxNjdwZmd6MDdZM1lI?= =?utf-8?B?THZMNTVJb3NhcTE3Y3IwVlZtV3M1aG9WVXdFQVI2dUtlWTVnWENJOHRwbVBs?= =?utf-8?B?RzlvTDJGU0wydjMyeE9MWWZ1T3NuS09OcnJVL295MzdzWHIrR1d4bkNPbENk?= =?utf-8?B?S1NlZkJEOWpXQ3pmUGgxcGM5NDM3Y3lLeFE4RzlDOTZ6M093ZmcydTVid21C?= =?utf-8?B?WkZtWXc1b0YvT1hMSit0RDFXSlN3THBVd3NIalhWbWdKQmZqa0QybUdOd256?= =?utf-8?B?MEI2SnRJNFNBb3ZtNU0zcHdxTGlJdXVYenNQcDFZaDFHakJCcmRFRDRueEdj?= =?utf-8?B?cEl4eCthMVVPcmdnbVdLdC9wd0UyS3lJVGovVWtrdEo2WEZLTDBTTDFSZjNN?= =?utf-8?B?SWZ6dTNTR3JnakVuaGJWUnEzL2FGck1oRjc5dHZlNUoxQVltMUJkQ2dRPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?REh1UGhQSUcyT2ZESmhlZjBSNzZpVTdPelFMZ25JRGlhNWZHeUtLcFJxOUY5?= =?utf-8?B?UUM1U0NsMnMyNlRudmdLWUJoMkkvdkhzWnVhK0xodlY1U2pEWGphL3hqTng2?= =?utf-8?B?RUxDK2V4dGlWeHYyRlAySmtHM0tLanU4SlFnVW9qQWtiSng5Wm9STldnbHlF?= =?utf-8?B?dmxOUmhzVmRpVUxRT1V2NXdUcFpvaVUzRXdRMnRidHR5K0UvbkV2dWQ5WU1s?= =?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WtMbzdX?= =?utf-8?B?U212RjFEekpnNTdhS1RlK2tYUkh4V0NlQWgrLzVBU2R0S0V5TWNqZjc0TjB5?= =?utf-8?Q?jI+E=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcf248e7-801b-46ca-23e1-08dc80c2bb55 X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 16:08:23.5883 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: J8sw3TUuzj7QNUhCoaiDIzbb3g/COVC8cQwGyzUiMeWbd7h0Zk4gjcd7KoDFWOPp X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9119 Hi Reinette, On 5/9/24 16:11, Reinette Chatre wrote: > Hi Babu, > > On 4/25/2024 1:17 PM, Babu Moger wrote: >> Add support to read UMC (Unified Memory Controller) perf events to compare >> the numbers with QoS monitor for AMD. >> >> Signed-off-by: Babu Moger >> --- >> tools/testing/selftests/resctrl/resctrl_val.c | 67 ++++++++++++++++--- >> 1 file changed, 59 insertions(+), 8 deletions(-) >> >> diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c >> index e3b09128ec3d..d90d3196d7b5 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[PATH_MAX]; >> + FILE *fp; >> + >> + /* Get type of iMC counter */ > > iMC counter? Yes. Will fix it. > >> + sprintf(umc_counter_type, "%s%s", umc_dir, "type"); >> + fp = fopen(umc_counter_type, "r"); >> + if (!fp) { >> + ksft_perror("Failed to open imc counter type file"); > > Why go through effort of changing to generic names and then follow > by using Intel naming in AMD specific code? My bad. > >> + return -1; >> + } >> + >> + if (fscanf(fp, "%u", &imc_counters_config[count][READ].type) <= 0) { >> + ksft_perror("Could not get imc type"); > > Same here. Sure. > >> + fclose(fp); >> + return -1; >> + } >> + >> + fclose(fp); >> + >> + imc_counters_config[count][WRITE].type = >> + imc_counters_config[count][READ].type; >> + > > Up to here seems to be a copy&paste of read_from_imc_dir(). Could you > instead split read_from_imc_dir() so that AMD and Intel can share the > code to determine type? Sure. Will address this in next revision. > > Reinette > -- Thanks Babu Moger