Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp170681rbe; Wed, 28 Feb 2024 16:24:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUPaPJcDQBnb7qKT1yTV+FA3naOyQO9n3NdXd1uWuFYBrdbY3KQJOslSxttKIzi/zOh7d+o6/WSpCF5aV5CxMBJoko5KEAU9WSzSrI+LA== X-Google-Smtp-Source: AGHT+IG0olRI6GT3v3Eb2dGv97oVIEMMq1KtnxEADxm0tdhJFGWDLdSrrWnoCD8Wb8C1PnVD93Si X-Received: by 2002:a05:6402:c5:b0:566:77a1:158f with SMTP id i5-20020a05640200c500b0056677a1158fmr221656edu.41.1709166271003; Wed, 28 Feb 2024 16:24:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709166270; cv=pass; d=google.com; s=arc-20160816; b=jFUkMHMOxLcQvheGge9Nd5m09EAXyUfz9NJnq/1N370vOdkhUSWGBBUHvNtRsRjSzM WtVfEpi6AbOi6yoNVs2SoBSYmXax0kzXG3y5DHxoHzNrn6gAMJE3E8e+JZiQMdw+B9GE PsgxEtTsKNU0BiDQKP9zWgiN9UpNY45zcXQVOLukFLIzPodQe+f7UCQwbtba0BUYFCRh 4N6br6emRO4stToJrGqCr6amC1RlxeuGxyj+tXoxUG5mlE9fyL3TVrZclaxx9DXla8q4 1/WJ10zUaD4XPKp/0FNGM+jXBg+ShGTB/IYEXtixkK3DegsVzKEyy5UVqQJezYDPkdWI Ph9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=GARAKFSHROUeCUO/36ulyyjpscEMXnihleFvvHQNW7U=; fh=1yQc3Q0HQvflcmrIxX6C7f5BmlJqzXoAs/CZ1hj3xaE=; b=meUDno5ADD0faV/wABEX675CSgjqUEVpkpqgHR8FjYW37FmfwA8GaW1vP5Jm/dTmna TxXR2jY4Eeh3omIYCB71RnDx9gKCn96aNw1ki5p6Zhb2J6XGRQI3pihUUtBLacQzmec2 nqc/aHrv0fktgmyzEaiwpiFrHmXuiEmdngfl2ZiNHzDAepYDlFtnk8+BZbQle5M4sCZG rrwZIT43c4PNJUOAJFiTUT0fKawgWpzmR+Z6Dmv+pRHZTgyLIzsmN3x4HOMQsAg98PCG 9iwFfgIQq1nqcRgowqHclmOrQeanJWYcdSWbjvyvplIHKKvkG/xzvlLKzW5LOIb9wCt8 +Llg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Tnh4PLt2; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id de24-20020a056402309800b00566414eff8esi52382edb.251.2024.02.28.16.24.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 16:24:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Tnh4PLt2; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85913-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 BFC611F22E43 for ; Thu, 29 Feb 2024 00:24:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58B0660DC2; Thu, 29 Feb 2024 00:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Tnh4PLt2" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 141D7605A5 for ; Thu, 29 Feb 2024 00:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709165953; cv=none; b=ZoHp3aBWWX5Ubbcj/ZPLrF/dRaMszZDVirmNLnP+mchAao7mmIL77w6tRzLNdMpISAjsJu+v4b2ylnYupU35bSS8mTHvLRhAMSIXtizzJriepWKXRjia+Gq+Lezdu0E6tSLglynjmLldb3/xxQozmJ26RRcgxSIoOIE68FXz+/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709165953; c=relaxed/simple; bh=McUJMeln2Z6sLdD8gh2mpJJERcOGFKDfTLUUixwws6c=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=rUs9IrJ1NjOAVrDQo0Y01jNrJYp6mgDYp11teIJrmmvstHKQsLluckRF9ndY2JbOx1V0GYBtHgBF8ioJ6w4Z3fwfbynYJ8PX0w6Byz0Mxgznd4zQkMp1kh1hycc4daEtF04wTSaPMCuC1KpJJb7zKdPhZ8nwXRtwrhe5vT38KoU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Tnh4PLt2; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dcf22e5b70bso630894276.1 for ; Wed, 28 Feb 2024 16:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709165951; x=1709770751; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=GARAKFSHROUeCUO/36ulyyjpscEMXnihleFvvHQNW7U=; b=Tnh4PLt2imeNpvK40JbRWZqzMn+X6PKolkVTyPqjJDdebpx+4e8mhHSAA2dMA+1+7i xkyzhHKK0lBRonO0/ULJsFnjdY08e/ZIqQTxqDUneUsljhtV/MrkoUe14qbN7LctzoGR Gzk0P4+TaI2gyCwKjCFAv4RQbvn/0r0Ri2kHvB8Aa87pwp4S2neHxtLDm8z0nBH0EoXp 10Iww2+sufYcnq38Q9c6btRNbFRI3mlFzZF/9GdPcGfH1sjnIP4LT7wJr4QqkMjPR+Sx 3+lz5tyPlUOk5UtgCjLLSwhRIxnJcXSbDWFd9TQLRaV7u40P53rUY9l97Dk2pO+R86HA tKNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709165951; x=1709770751; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GARAKFSHROUeCUO/36ulyyjpscEMXnihleFvvHQNW7U=; b=U55y3QK8F2zx9ldAVgrQ6+3Jki0VLi32knOhGVBNbmu8Ka6NVOdRxSEKwVcEh2yzY8 m8cq3/ggwXTm2HFQ2+ofdWxPWWxSyqqFV6fwKnyDm0U5knqMYIubsIF6kedOqH2cgpM9 NKcVUjgcHDOWGorUsPKHQkpXqD8M1Hns1OB4iqKCjoocACMbvTnxtahQS+6r9wBmMcRL UJMqe3LkqDjpr0wbTAUDoFynBApdp9lS5BOIT1z4GyAFaTj/QMS8CcwH2LUSHECS2mqP l81ug6Fnlie6LrVVEBw62J8XhQbqKFqAMbTKRgqDQWgcL0N+TzmA1n+cfWKzeZ8D7ZjP ceMQ== X-Forwarded-Encrypted: i=1; AJvYcCXdm4GjppxGUyy+3l9/VYpJtFVvUh1ppF8d7F8SKhtmsFg8IwWMkydsNxnwH1KeChorPtIclQQFo6wdca2IRywL8yPZCTFoPNEzljBK X-Gm-Message-State: AOJu0YzM8xCeDfFvpYF/kjO8zMruXc25ar4Kpkpz86vDuiknz+5XrrT3 mve/7IIQfpIoHGAD7JzOhv0mDhrm6c/5Enyc0POc12aF+yvKhEY4LyX7+ciQgx60phkgwTTSYVr TfLT4PQ== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:77dc:144c:334e:e2dd]) (user=irogers job=sendgmr) by 2002:a05:6902:1244:b0:dc6:e20f:80cb with SMTP id t4-20020a056902124400b00dc6e20f80cbmr44036ybu.3.1709165950813; Wed, 28 Feb 2024 16:19:10 -0800 (PST) Date: Wed, 28 Feb 2024 16:18:05 -0800 In-Reply-To: <20240229001806.4158429-1-irogers@google.com> Message-Id: <20240229001806.4158429-21-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240229001806.4158429-1-irogers@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Subject: [PATCH v1 20/20] perf jevents: Add upi_bw metric for Intel From: Ian Rogers To: Perry Taylor , Samantha Alt , Caleb Biggers , Weilin Wang , Edward Baker , Andi Kleen , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , John Garry , Kan Liang , Jing Zhang , Thomas Richter , James Clark , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Stephane Eranian Content-Type: text/plain; charset="UTF-8" Break down UPI read and write bandwidth using uncore_upi counters. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/intel_metrics.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/perf/pmu-events/intel_metrics.py b/tools/perf/pmu-events/intel_metrics.py index cdeb58e17c5e..219541a30450 100755 --- a/tools/perf/pmu-events/intel_metrics.py +++ b/tools/perf/pmu-events/intel_metrics.py @@ -1006,6 +1006,27 @@ def UncoreMemBw() -> Optional[MetricGroup]: ], description = "Memory Bandwidth") +def UncoreUpiBw() -> Optional[MetricGroup]: + try: + upi_rds = Event("UNC_UPI_RxL_FLITS.ALL_DATA") + upi_wrs = Event("UNC_UPI_TxL_FLITS.ALL_DATA") + except: + return None + + upi_total = upi_rds + upi_wrs + + # From "Uncore Performance Monitoring": When measuring the amount of + # bandwidth consumed by transmission of the data (i.e. NOT including + # the header), it should be .ALL_DATA / 9 * 64B. + scale = (64 / 9) / 1_000_000 + return MetricGroup("upi_bw", [ + Metric("upi_bw_read", "UPI read bandwidth", + d_ratio(upi_rds, interval_sec), f"{scale}MB/s"), + Metric("upi_bw_write", "DDR memory write bandwidth", + d_ratio(upi_wrs, interval_sec), f"{scale}MB/s"), + ], description = "UPI Bandwidth") + + all_metrics = MetricGroup("", [ Cycles(), Idle(), @@ -1026,6 +1047,7 @@ all_metrics = MetricGroup("", [ UncoreDir(), UncoreMem(), UncoreMemBw(), + UncoreUpiBw(), ]) if args.metricgroups: -- 2.44.0.278.ge034bb2e1d-goog