Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp170433rbe; Wed, 28 Feb 2024 16:23:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW/GRj0HhfKSVqvtTSqCs2+OCfC3STrundHWirV9Zcx2/DuZprs0+0/yCa8kIgAOpak0zU7Dc99sAv6dHYJ4tPmvcnkH3H+m/QPcH/wpA== X-Google-Smtp-Source: AGHT+IGgfcKT0MmQU5n5l1yEvXO5VhEPopW0tmei3DJMiTLb5Yp5A8A37+i+lNphFfgVe6jT/r+p X-Received: by 2002:a05:6512:530:b0:512:ff21:294f with SMTP id o16-20020a056512053000b00512ff21294fmr353480lfc.8.1709166227512; Wed, 28 Feb 2024 16:23:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709166227; cv=pass; d=google.com; s=arc-20160816; b=nbj0lj6wVndY53UPulH5tObFCoKNSiQ/Ln+hDUPvGZQ7oL8cZLV8Gkk1fa0bbo77ov nJITwdAiIfLtPemvVzlNcbvvmFKFVj9yQoBMKPfWcDybxhsfKAqo87yTu4XHfvZ5EFPO V57to8SHSaaBABSK83Uyuk5py2l1wBpfMLz7GePDgA2blPU3dNlrZzH4GvswOpkV9DQx CnmavJbCNrRAKWEg1uT8yvRrloJ5AhYFYcTyheUXcZRS60zRO74ugKoXK2R0xmIyzfla EGjZLsbhMBk5sMJtu+u8f9Lsh9Be5SUV2+Xf8Ilnv6B/R3LXviK77ZB52xYBM1wVsxZy iOGw== 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=uBmMTFqHwHtPnnqhBPb22111ik/LzYAYuMu6eaqCRZo=; fh=PPsbwkFq7A/cdumX9/uWpBqPZXNkzb3NDNT+suYZ1Es=; b=DgXnKHS6cmnlCYLD0e1U3cukH1apVnWFqgtuq99E8HI4iCO3iDjoKh9ylmjW7XcZvL mnKeQ81yFEsDIBJyY0G4WR7ND38uFxG2xZxJ1fpPvJnzkbPRmmar0OIegknLBlt7795t 7VXZ9kslyT1VqnLfZv0YERJeI8WiJ6K8Fmit/p3/BvWn+PFYFgQK/Uk/nCiCa9oF3TA2 Sn2lkFZRzwOBUf0mgFMqCYX2GTS7hQxU1LxZofOA4wb3PSHN+GUYGutaj1mI/4lMZMIc qkQ9SklLbIXyWrizX4BvfqdpVnEBv3AhToKJ8NJd5ZkAwDL8vz4+jgKckQHoVAmTp/FG tmbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OB3v5o4y; 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-85910-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85910-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 cb17-20020a0564020b7100b005644479ae60si55111edb.473.2024.02.28.16.23.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 16:23:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85910-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=OB3v5o4y; 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-85910-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85910-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 16E4F1F220F8 for ; Thu, 29 Feb 2024 00:23:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 503005FBA4; Thu, 29 Feb 2024 00:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OB3v5o4y" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.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 D1EE75F482 for ; Thu, 29 Feb 2024 00:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709165946; cv=none; b=etHtAGi4LMttnOrRHKuHS81tpvI3toY6jHuXIZUS5FeuFJ5hC3dYKsqzkwWuW+vetH3ScU/LmzGjjF3XsBl0Wo/S2EeqLXSGHvCaUrvzoIwNRSfJ7JkzQoahOLOTyXGZIAW3ljOQsdWZeVjg619NQwuyKirrW5F2Hcp9rYB3lyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709165946; c=relaxed/simple; bh=xlzja/1NTHsdXbKI9l/ne67VG4rMNc4Dj/LOyY65h08=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=DPcgMhLTiBYg1iNEm0QtwaByzAskCI/ahhMUGN8CRgq7J0/olvw2MFoReLtww+yBP39nLU2QCSXjg+JdXGT7Gj8gVOQVnW5gSeAAgGnwOaNO+j7H5RG7xHmnnCrsaHtLJ0uauvQsmN3UyWjZj8V+HdiWaddVFj4qReFPq4JuUSE= 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=OB3v5o4y; arc=none smtp.client-ip=209.85.128.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-yw1-f201.google.com with SMTP id 00721157ae682-6047fed0132so5952127b3.1 for ; Wed, 28 Feb 2024 16:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709165944; x=1709770744; 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=uBmMTFqHwHtPnnqhBPb22111ik/LzYAYuMu6eaqCRZo=; b=OB3v5o4ycIEF9dUEtS6bl03w8Fd6HEcJX4aemqEEA5Gfu4miFOPsn9g8E76Pjbrk7J viGr0gf6mrtt/3kpKjxtm2GSFrZcxPlp1ODukd1s8IzLahNajZfYKzTMCpAyWpnk4O01 /B2sF1e0kDQEMhEGjArzAzNE6EoMZddtFRMxgaOBFAdntDdPqnA1XYcW7u8jw1cWb+ee wrYqvFczuMppXnEScALhCF/dfyXzBR0LVuDmd4X3SeXPQaVNhd9LtCrF7wT/u4HfF2Jo 9Ssjluq52IsZGrO1UM9fuIIg7nhPoF21jN8VWlBedL+21PIEKb0lfQd7cp5FlYwkvG0m PsdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709165944; x=1709770744; 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=uBmMTFqHwHtPnnqhBPb22111ik/LzYAYuMu6eaqCRZo=; b=K3FSKeS/PhDsgaz9ht7V+NiqvidZnwEyqdKieeRgVsNJrYLBzVvYJXDA5/XUttmo0A zkZ+EGsSOHOJ1KwIn9lmcEWWq9Rq03CK20K0A97nN3HEltD4euCRQ6esDJM7CIDadnyT rhMMPlakKHWclX/XHGf+hh2NtQ1Gdmn9bY9K7P872Q9a2PbKPeTxs+jpjaqNVpmbjraB 6uqym6sSxaVs7UCYxxR/APK1buJZTyr79y1Vogo41UYxgRbJLFkPwqXexRNH6/bTivdE RN6KOFlH5Q2sNzzp8GVhPGRQN7WZUl8CsM3yBusopGSv30hp4sxwiptVuTxMmMl4MUIU QWsA== X-Forwarded-Encrypted: i=1; AJvYcCX6ZkA2Cu1XbqnDl5KFg+tdSKhg32sHAt9t6aTUj+u0lMPO9Hg0VzuiMpwCRc8ylIMWUnTCcXeI9pRYqPtZiCF5avI4pfp5KonpJbOC X-Gm-Message-State: AOJu0YwdMTujcqL0VekFk8fZyIMXjHwl6Z8s8y/dVhSh4EKw0KT+6NGZ +c+iVIAFz2ua1vtDHR9P7hACunPdkz940YiTQtZ9Po5JJX2yhqxth4uCkaw/CUa2bavDa9jeHmN 4IpQjlA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:77dc:144c:334e:e2dd]) (user=irogers job=sendgmr) by 2002:a81:9b4c:0:b0:609:51a3:b409 with SMTP id s73-20020a819b4c000000b0060951a3b409mr147135ywg.0.1709165943906; Wed, 28 Feb 2024 16:19:03 -0800 (PST) Date: Wed, 28 Feb 2024 16:18:02 -0800 In-Reply-To: <20240229001806.4158429-1-irogers@google.com> Message-Id: <20240229001806.4158429-18-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 17/20] perf jevents: Add dir breakdown metrics 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" Breakdown directory hit, misses and requests. The implementation uses the M2M and CHA PMUs present in server models broadwellde, broadwellx cascadelakex, emeraldrapids, icelakex, sapphirerapids and skylakex. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/intel_metrics.py | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tools/perf/pmu-events/intel_metrics.py b/tools/perf/pmu-events/intel_metrics.py index 82fd23cf5500..07aafdf77f79 100755 --- a/tools/perf/pmu-events/intel_metrics.py +++ b/tools/perf/pmu-events/intel_metrics.py @@ -800,6 +800,41 @@ def IntelLdSt() -> Optional[MetricGroup]: ], description = "Breakdown of load/store instructions") +def UncoreDir() -> Optional[MetricGroup]: + try: + m2m_upd = Event("UNC_M2M_DIRECTORY_UPDATE.ANY") + m2m_hits = Event("UNC_M2M_DIRECTORY_HIT.DIRTY_I") + # Turn the umask into a ANY rather than DIRTY_I filter. + m2m_hits.name += "/umask=0xFF,name=UNC_M2M_DIRECTORY_HIT.ANY/" + m2m_miss = Event("UNC_M2M_DIRECTORY_MISS.DIRTY_I") + # Turn the umask into a ANY rather than DIRTY_I filter. + m2m_miss.name += "/umask=0xFF,name=UNC_M2M_DIRECTORY_MISS.ANY/" + cha_upd = Event("UNC_CHA_DIR_UPDATE.HA") + # Turn the umask into a ANY rather than HA filter. + cha_upd.name += "/umask=3,name=UNC_CHA_DIR_UPDATE.ANY/" + except: + return None + + m2m_total = m2m_hits + m2m_miss + upd = m2m_upd + cha_upd # in cache lines + upd_r = upd / interval_sec + look_r = m2m_total / interval_sec + + scale = 64 / 1_000_000 # Cache lines to MB + return MetricGroup("dir", [ + Metric("dir_lookup_rate", "", + d_ratio(m2m_total, interval_sec), "requests/s"), + Metric("dir_lookup_hits", "", + d_ratio(m2m_hits, m2m_total), "100%"), + Metric("dir_lookup_misses", "", + d_ratio(m2m_miss, m2m_total), "100%"), + Metric("dir_update_requests", "", + d_ratio(m2m_upd + cha_upd, interval_sec), "requests/s"), + Metric("dir_update_bw", "", + d_ratio(m2m_upd + cha_upd, interval_sec), f"{scale}MB/s"), + ]) + + def UncoreMem() -> Optional[MetricGroup]: try: loc_rds = Event("UNC_CHA_REQUESTS.READS_LOCAL", "UNC_H_REQUESTS.READS_LOCAL") @@ -902,6 +937,7 @@ all_metrics = MetricGroup("", [ IntelMlp(), IntelPorts(), IntelSwpf(), + UncoreDir(), UncoreMem(), UncoreMemBw(), ]) -- 2.44.0.278.ge034bb2e1d-goog