From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 597D1C433FE for ; Mon, 30 May 2022 11:41:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235931AbiE3LlQ (ORCPT ); Mon, 30 May 2022 07:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235806AbiE3LlG (ORCPT ); Mon, 30 May 2022 07:41:06 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D6E4419A3 for ; Mon, 30 May 2022 04:41:05 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d22so10085646plr.9 for ; Mon, 30 May 2022 04:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jjmrioi65tdvpnatZVOByjLto3yXdnCU74U03aRx/ek=; b=dbovKyStqncZhviVmQ4s01Kz4FWR7dngHlpCcH+X9FLPjv/wnbG94Ns4SYZB8YCW1r dU16yO4rVV/AAV/zVo9MtcFm/zmkItHUiqgbfAecAc6vLKDa7r+YXq0Fs+eF0P3QDvuB lhjIdpJZK9zEL4cQCTrFRJ65n+NdLrx5xN0zFAzVZqZgU8ov04EZh0dYaKO6BJ3+X5hA XUhKYk3QN/g7FKLze2o8VxViadQaYKmQyxbB0eulrQb8U3oBv2k9FrJWJ26JdOrJa0c3 lfkiZaJ8rcnhBcOMue1KIeNIAiWjCMTRSbaDQRknQrPWkYtE+l/KOuIfJeCjC9QdE21Q 9viQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jjmrioi65tdvpnatZVOByjLto3yXdnCU74U03aRx/ek=; b=PnTNoWVMHu938W4GwpVYoh9a/0QZgQgjECeRYSldRFes4qYotDy7oQhZumr1f4k3RW KtWvtxImQEOPG6EYV21ge62eBtDZ1hLaIZoQOxleU/3zHHBnP2RulTvbwHLmyok/EAmz douji26z5XYFOTboS4xwKn+EZNIlSo37sR8i6fYaRQZsFj0yD9E30ERJTN7+8VOsITAF IReaYw0xw1wzk2Xm8+plkhM72qLioLXJKIKRSJuVpHW39hIWgxmGhBJY3EudLz/xk4nF zXzZ0FwISlQDdvgaqQNeRInfIKorBDc6BdAtOIDyEgkk9kABQMWlv9kdNAb6Ad75wml5 qdUQ== X-Gm-Message-State: AOAM532z6hyRfyRl6l981953iZTO4NN9EU/bEg4tvch9Qa8GFEyOq9IF +yKykWZ2xBbOO04V66Y5yoWwUw== X-Google-Smtp-Source: ABdhPJzcu2PXhaLkP/I7hnZpbOEuiIqD4SEi5tXzqvqWMLMUzV3tk7gJxBQRR3kWPrSNQJX+wi1oPQ== X-Received: by 2002:a17:902:ec85:b0:161:cff5:17c8 with SMTP id x5-20020a170902ec8500b00161cff517c8mr56097594plg.62.1653910864468; Mon, 30 May 2022 04:41:04 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:04 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 01/12] perf mem: Add statistics for peer snooping Date: Mon, 30 May 2022 19:40:25 +0800 Message-Id: <20220530114036.3225544-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since the flag PERF_MEM_SNOOPX_PEER is added to support cache snooping from peer cache line, it can come from a peer core, a peer cluster, or a remote NUMA node. This patch adds statistics for the flag PERF_MEM_SNOOPX_PEER. Note, we take PERF_MEM_SNOOPX_PEER as an affiliated info, it needs to cooperate with cache level statistics. Therefore, we account the load operations for both the cache level's metrics (e.g. ld_l2hit, ld_llchit, etc.) and peer related metrics when flag PERF_MEM_SNOOPX_PEER is set. So three new metrics are introduced: 'lcl_peer' is for local cache access, the metric 'rmt_peer' is for remote access (includes remote DRAM and any caches in remote node), and the metric 'tot_peer' is accounting the sum value of 'lcl_peer' and 'rmt_peer'. Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/util/mem-events.c | 28 +++++++++++++++++++++++++--- tools/perf/util/mem-events.h | 3 +++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index 5dca1882c284..764883183519 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c @@ -525,6 +525,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct me= m_info *mi) u64 op =3D data_src->mem_op; u64 lvl =3D data_src->mem_lvl; u64 snoop =3D data_src->mem_snoop; + u64 snoopx =3D data_src->mem_snoopx; u64 lock =3D data_src->mem_lock; u64 blk =3D data_src->mem_blk; /* @@ -544,6 +545,12 @@ do { \ stats->tot_hitm++; \ } while (0) =20 +#define PEER_INC(__f) \ +do { \ + stats->__f++; \ + stats->tot_peer++; \ +} while (0) + #define P(a, b) PERF_MEM_##a##_##b =20 stats->nr_entries++; @@ -567,12 +574,20 @@ do { \ if (lvl & P(LVL, IO)) stats->ld_io++; if (lvl & P(LVL, LFB)) stats->ld_fbhit++; if (lvl & P(LVL, L1 )) stats->ld_l1hit++; - if (lvl & P(LVL, L2 )) stats->ld_l2hit++; + if (lvl & P(LVL, L2)) { + stats->ld_l2hit++; + + if (snoopx & P(SNOOPX, PEER)) + PEER_INC(lcl_peer); + } if (lvl & P(LVL, L3 )) { if (snoop & P(SNOOP, HITM)) HITM_INC(lcl_hitm); else stats->ld_llchit++; + + if (snoopx & P(SNOOPX, PEER)) + PEER_INC(lcl_peer); } =20 if (lvl & P(LVL, LOC_RAM)) { @@ -597,10 +612,14 @@ do { \ if ((lvl & P(LVL, REM_CCE1)) || (lvl & P(LVL, REM_CCE2)) || mrem) { - if (snoop & P(SNOOP, HIT)) + if (snoop & P(SNOOP, HIT)) { stats->rmt_hit++; - else if (snoop & P(SNOOP, HITM)) + } else if (snoop & P(SNOOP, HITM)) { HITM_INC(rmt_hitm); + } else if (snoopx & P(SNOOPX, PEER)) { + stats->rmt_hit++; + PEER_INC(rmt_peer); + } } =20 if ((lvl & P(LVL, MISS))) @@ -664,6 +683,9 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_= stats *add) stats->lcl_hitm +=3D add->lcl_hitm; stats->rmt_hitm +=3D add->rmt_hitm; stats->tot_hitm +=3D add->tot_hitm; + stats->lcl_peer +=3D add->lcl_peer; + stats->rmt_peer +=3D add->rmt_peer; + stats->tot_peer +=3D add->tot_peer; stats->rmt_hit +=3D add->rmt_hit; stats->lcl_dram +=3D add->lcl_dram; stats->rmt_dram +=3D add->rmt_dram; diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h index 8a8b568baeee..12372309d60e 100644 --- a/tools/perf/util/mem-events.h +++ b/tools/perf/util/mem-events.h @@ -78,6 +78,9 @@ struct c2c_stats { u32 lcl_hitm; /* count of loads with local HITM */ u32 rmt_hitm; /* count of loads with remote HITM */ u32 tot_hitm; /* count of loads with local and remote HITM */ + u32 lcl_peer; /* count of loads with local peer cache */ + u32 rmt_peer; /* count of loads with remote peer cache */ + u32 tot_peer; /* count of loads with local and remote peer cac= he */ u32 rmt_hit; /* count of loads with remote hit clean; */ u32 lcl_dram; /* count of loads miss to local DRAM */ u32 rmt_dram; /* count of loads miss to remote DRAM */ --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42E31C433F5 for ; Mon, 30 May 2022 11:41:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235807AbiE3Ll1 (ORCPT ); Mon, 30 May 2022 07:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235884AbiE3LlO (ORCPT ); Mon, 30 May 2022 07:41:14 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F46813E9 for ; Mon, 30 May 2022 04:41:10 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id g67so2337943pfb.2 for ; Mon, 30 May 2022 04:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h8h+dOa5UXWEE0M1AXGeUja2PScbi3m/14Ye0UYGzpI=; b=aOe0sxeZZ3mOj0Cr7eUZd6cMma69nGUO55Otyh2VVIlBOWRgpcdeLZEafs83PKh/VL vtBOZ6xDlWoUF46lwZxNIPPnc+Ekd2iHetayug+sfRdpqIHIzBja5IVBCsPPw0bBNeqJ yc9oh4u5n87wPvgsND0bnmTKbFy6ysJbylSQtmbvJS2jteohoTzKC4NMlZFMMZApv+rX d7iMQTf+6STuriEOFXYUdT303pf6G8e2SZtDd3z1C+9f0cnkr3nRjP2TWtRABc6H8nRC Oz3cv/7NYRKpgIPE8AuRF2gVB0t/+hksPqrotZo33wKMK4m+UKIAiyqmPQvil0eHS8aP 5ANA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h8h+dOa5UXWEE0M1AXGeUja2PScbi3m/14Ye0UYGzpI=; b=Pvf/6FsV3rAOTMRZR8akvAbu3q6aL/E5OZXGJU1tviDIQB7I5y6AAbp2KPMFo1Ld97 zNHl5j+ULPIOjT4U5D5r+V3kc0ZPdepsAsrmGbA9CYXnjKoST2C4A82FUFqsv+6X+5LF LMNRI7seeX1yKm5VbCnRUSTpSXMYGMJCz7FSDmrWfWcoet/AoavZOtd9MCqE0DsUASAr KdAfsKuTIEVpJPg5f/JA5IpyYWnj0HZewPsTqsKr9xGayoJXzYPcwT+F8YN/yQcaZZzi ER3npPRxOApxHWy5fzGvtC1l/xAEaJcP2NSiKDvumiPKj+08uil3jWmR6CjkZQtdzbDV LAjA== X-Gm-Message-State: AOAM530GeYHLwQfQ7VeQgXt5xtsrj9p0cZ3fRH3Y/H69f8MRnc0B3Rs8 Vd7ENBN/K8/425xlEJB46Wzn2g== X-Google-Smtp-Source: ABdhPJyyY2z+LEUijMFV1bpmsqO0SFh/jX4VeU6hiEEwV+q9m0sYnCVjVpbejR2vwdIPBTX457L7wQ== X-Received: by 2002:a05:6a00:2402:b0:4e1:46ca:68bd with SMTP id z2-20020a056a00240200b004e146ca68bdmr56506321pfh.70.1653910869257; Mon, 30 May 2022 04:41:09 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:09 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 02/12] perf c2c: Output statistics for peer snooping Date: Mon, 30 May 2022 19:40:26 +0800 Message-Id: <20220530114036.3225544-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch outputs statistics for peer snooping for whole trace events and global shared cache line. Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index e8280973d7b8..ac389432c15f 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2202,6 +2202,8 @@ static void print_c2c__display_stats(FILE *out) fprintf(out, " Load LLC Misses : %10d\n", llc_misses); fprintf(out, " Load access blocked by data : %10d\n", stats->blk_d= ata); fprintf(out, " Load access blocked by address : %10d\n", stats->blk_a= ddr); + fprintf(out, " Load HIT Local Peer : %10d\n", stats->lcl_p= eer); + fprintf(out, " Load HIT Remote Peer : %10d\n", stats->rmt_p= eer); fprintf(out, " LLC Misses to Local DRAM : %10.1f%%\n", ((double= )stats->lcl_dram/(double)llc_misses) * 100.); fprintf(out, " LLC Misses to Remote DRAM : %10.1f%%\n", ((double= )stats->rmt_dram/(double)llc_misses) * 100.); fprintf(out, " LLC Misses to Remote cache (HIT) : %10.1f%%\n", ((double= )stats->rmt_hit /(double)llc_misses) * 100.); @@ -2230,6 +2232,7 @@ static void print_shared_cacheline_info(FILE *out) fprintf(out, " L1D hits on shared lines : %10d\n", stats->ld_l1= hit); fprintf(out, " L2D hits on shared lines : %10d\n", stats->ld_l2= hit); fprintf(out, " LLC hits on shared lines : %10d\n", stats->ld_ll= chit + stats->lcl_hitm); + fprintf(out, " Load hits on peer cache or nodes : %10d\n", stats->lcl_p= eer + stats->rmt_peer); fprintf(out, " Locked Access on shared lines : %10d\n", stats->locks= ); fprintf(out, " Blocked Access on shared lines : %10d\n", stats->blk_d= ata + stats->blk_addr); fprintf(out, " Store HITs on shared lines : %10d\n", stats->store= ); --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88CC5C433F5 for ; Mon, 30 May 2022 11:41:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235913AbiE3Lld (ORCPT ); Mon, 30 May 2022 07:41:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235914AbiE3LlP (ORCPT ); Mon, 30 May 2022 07:41:15 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7C8A813DD for ; Mon, 30 May 2022 04:41:14 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id a10so1528037pju.3 for ; Mon, 30 May 2022 04:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zq0qvzL6ixxtSc1desUKY/GqDh2eKKGtTiiw0hsNusc=; b=VfNAdhbV0jFONXt1B7SQddxTBFQ+3fSxQK1MzL3gKczosuKMmaGnbuJ9a5XDy+zBYY 8dHnFNZh5ibfTj1W9lWoq6qntJ0g2/f8H+D1rTTpuYNBp38v9ZiuQsyDwOywdt9ADwzn tVN6mPTKpgfTnRgRFc8L0B7DV0iUlhx2SJ5RB0oWYVEy8+dfZ0t/l4Mo5om+PVkszw4X Lp1WAA4vqA170eTWV9Pza7ENN5IU+jfjjSkqKp1gu3E3NO2i4Z+YpiXcF5bRQikvYZ5o LCAHpWny63Kws0mggGZH/mvNpNIeFNuW14ZyvlRrcpRDvTghkomUWXIKmfBt6l/8BtUY 6qaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zq0qvzL6ixxtSc1desUKY/GqDh2eKKGtTiiw0hsNusc=; b=7j8/EkfvcUVyLIBGE0GzENYVyW/Z81MduiWQqEBadGSvEVDbz9abzLP90pH48jVae9 4N3RD9y09DV3rE6Fqag+tJgz6a9JdlkUgeTP1eXNMsVa7OSaVbZBhtZA1T3KY9V/MKue y+kUVLfv+I7/wRdqR5oHpqKzgCrgOYXlfKwqDx2FAXA49UPMwEouYlwu1A0n1GiSsQf7 4B1v2DmukCluZFxWzYfsjH3JUA04yoWZs+QGjtXvGoaTl10PAYRrUDaaGFUCbvUHBsD+ XJwIR7LM86VzWnpWZhLDLD/jdFNIhLJrr7ldzeOAXAyn2NbpSXBgIPG2uy/SjDLqM7u3 J04Q== X-Gm-Message-State: AOAM531p9AP8P62EmCk7IzzGvE9iMLHZDe2/PU4nPjSw5tADqcSZ2/f2 2qKa3nVKS8FEpU0kaMp4nEt5Hg== X-Google-Smtp-Source: ABdhPJx+K0aH11exUZTln+DH+rdVec4FwT6m0DdgBV/J+m62OQm/P2TGApRMgTML6BGJAd61DdYXDw== X-Received: by 2002:a17:903:2282:b0:163:c6c8:65c3 with SMTP id b2-20020a170903228200b00163c6c865c3mr7956024plh.120.1653910874106; Mon, 30 May 2022 04:41:14 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:13 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 03/12] perf c2c: Add dimensions for peer load operations Date: Mon, 30 May 2022 19:40:27 +0800 Message-Id: <20220530114036.3225544-4-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch adds three dimensions for peer load operations of 'lcl_peer', 'rmt_peer' and 'tot_peer'. These three dimensions will be used in the shared data cache line table. Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index ac389432c15f..2d7991d372a6 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -650,6 +650,9 @@ __f ## _cmp(struct perf_hpp_fmt *fmt __maybe_unused, \ =20 STAT_FN(rmt_hitm) STAT_FN(lcl_hitm) +STAT_FN(rmt_peer) +STAT_FN(lcl_peer) +STAT_FN(tot_peer) STAT_FN(store) STAT_FN(st_l1hit) STAT_FN(st_l1miss) @@ -1360,6 +1363,30 @@ static struct c2c_dimension dim_rmt_hitm =3D { .width =3D 7, }; =20 +static struct c2c_dimension dim_tot_peer =3D { + .header =3D HEADER_SPAN("------- Load Peer -------", "Total", 2), + .name =3D "tot_peer", + .cmp =3D tot_peer_cmp, + .entry =3D tot_peer_entry, + .width =3D 7, +}; + +static struct c2c_dimension dim_lcl_peer =3D { + .header =3D HEADER_SPAN_LOW("Local"), + .name =3D "lcl_peer", + .cmp =3D lcl_peer_cmp, + .entry =3D lcl_peer_entry, + .width =3D 7, +}; + +static struct c2c_dimension dim_rmt_peer =3D { + .header =3D HEADER_SPAN_LOW("Remote"), + .name =3D "rmt_peer", + .cmp =3D rmt_peer_cmp, + .entry =3D rmt_peer_entry, + .width =3D 7, +}; + static struct c2c_dimension dim_cl_rmt_hitm =3D { .header =3D HEADER_SPAN("----- HITM -----", "Rmt", 1), .name =3D "cl_rmt_hitm", @@ -1672,6 +1699,9 @@ static struct c2c_dimension *dimensions[] =3D { &dim_tot_hitm, &dim_lcl_hitm, &dim_rmt_hitm, + &dim_tot_peer, + &dim_lcl_peer, + &dim_rmt_peer, &dim_cl_lcl_hitm, &dim_cl_rmt_hitm, &dim_tot_stores, --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86F94C433EF for ; Mon, 30 May 2022 11:41:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235951AbiE3Llk (ORCPT ); Mon, 30 May 2022 07:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235912AbiE3LlW (ORCPT ); Mon, 30 May 2022 07:41:22 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE438813FE for ; Mon, 30 May 2022 04:41:19 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id n13-20020a17090a394d00b001e30a60f82dso1875534pjf.5 for ; Mon, 30 May 2022 04:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0JrXAt/7y4IjdEwppejNHx3DEKqS4BuTyzSkWmghpXw=; b=lLt96XydFqnWfbHbv9KeyAjoe9Lh/rSzdLf8JaaQr385uQpufB8Aod0hEGHc+ylmqR REvh0VU31b+jCWSg+gKpRH84CchGxPI09Z1Yh17O9Nsx5+JtVF/MEZdGEt7WABHPXrp9 QCI6HaioP31rvuR1cCrC055lrhbA7uqCPD3e2kOyXqwfN8wPadYvogOEGIpbhiTCLntA 4iA7v39VzZWptX7DPmdVqQ7787iEnIeGidXIFHBQ8XgGKlRjeMJlHpXD77eYcVkK3Toh HYdu2PtJzmN9HbGsVCK7w/ovfQTSGqjhmbsKO9Gv7c8+3CF2d3exX73r8Baqxb/fskSW beyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0JrXAt/7y4IjdEwppejNHx3DEKqS4BuTyzSkWmghpXw=; b=1xaswIfVuYo4Ov3aJE+VTIxK3hXQ74tOrkJYyv1gqZGdNcTknvBzteZM1Tkp2zXFRW x8SgJjf9Ji+AM+ll1p4n8SraTDO52H5RfIiQQ/4I8kqV0msrRObPKRHnI0dUiaUhS0cS BzrP9AzduqiLksyzzFtrgQfSmNXroZDUAlkObnzqceisZvi/40w6X0LbtkHlcXLV4LgZ z3r8q80tBayRXSqOjd1uwKn1nmfbRUXu2XUw1O7dh9A2sOaexEl0BVrCXGe6Vaon6zsI L7zZBeJRuK3WbSqRdlmwKeyXbR0l3lHZeiqFihu1BQ8CCfMF7oEMQFgDigknjXrk5JDp 4k/A== X-Gm-Message-State: AOAM533hud28KhNzxw+hzd+NuPluLeLwlwleK1tMUGiSFJwAxng4n7Ca Dc5vaxZf23M6OKce7KjV8zhTNw== X-Google-Smtp-Source: ABdhPJxMTp9pZOnkFkLR8QB0BluHGLLkJcug50W9O2qSuPLwOqLq1e5dX7Ym1kbx/IIFOfqLz7vOjw== X-Received: by 2002:a17:902:e80a:b0:163:c2a4:4c9a with SMTP id u10-20020a170902e80a00b00163c2a44c9amr8825992plg.161.1653910879172; Mon, 30 May 2022 04:41:19 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:18 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 04/12] perf c2c: Add dimensions of peer metrics for cache line view Date: Mon, 30 May 2022 19:40:28 +0800 Message-Id: <20220530114036.3225544-5-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch adds dimensions of peer ops, which will be used for Shared cache line distribution pareto. It adds the percentage dimensions for local and remote peer operations, and the dimensions for accounting operation numbers which is used for stdio mode. Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 102 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 2d7991d372a6..85768c526f9d 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -902,6 +902,8 @@ static double percent_ ## __f(struct c2c_hist_entry *c2= c_he) \ =20 PERCENT_FN(rmt_hitm) PERCENT_FN(lcl_hitm) +PERCENT_FN(rmt_peer) +PERCENT_FN(lcl_peer) PERCENT_FN(st_l1hit) PERCENT_FN(st_l1miss) PERCENT_FN(st_na) @@ -968,6 +970,68 @@ percent_lcl_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_= unused, return per_left - per_right; } =20 +static int +percent_lcl_peer_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) +{ + int width =3D c2c_width(fmt, hpp, he->hists); + double per =3D PERCENT(he, lcl_peer); + char buf[10]; + + return scnprintf(hpp->buf, hpp->size, "%*s", width, PERC_STR(buf, per)); +} + +static int +percent_lcl_peer_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) +{ + return percent_color(fmt, hpp, he, percent_lcl_peer); +} + +static int64_t +percent_lcl_peer_cmp(struct perf_hpp_fmt *fmt __maybe_unused, + struct hist_entry *left, struct hist_entry *right) +{ + double per_left; + double per_right; + + per_left =3D PERCENT(left, lcl_peer); + per_right =3D PERCENT(right, lcl_peer); + + return per_left - per_right; +} + +static int +percent_rmt_peer_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) +{ + int width =3D c2c_width(fmt, hpp, he->hists); + double per =3D PERCENT(he, rmt_peer); + char buf[10]; + + return scnprintf(hpp->buf, hpp->size, "%*s", width, PERC_STR(buf, per)); +} + +static int +percent_rmt_peer_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) +{ + return percent_color(fmt, hpp, he, percent_rmt_peer); +} + +static int64_t +percent_rmt_peer_cmp(struct perf_hpp_fmt *fmt __maybe_unused, + struct hist_entry *left, struct hist_entry *right) +{ + double per_left; + double per_right; + + per_left =3D PERCENT(left, rmt_peer); + per_right =3D PERCENT(right, rmt_peer); + + return per_left - per_right; +} + static int percent_stores_l1hit_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) @@ -1403,6 +1467,22 @@ static struct c2c_dimension dim_cl_lcl_hitm =3D { .width =3D 7, }; =20 +static struct c2c_dimension dim_cl_rmt_peer =3D { + .header =3D HEADER_SPAN("----- Peer -----", "Rmt", 1), + .name =3D "cl_rmt_peer", + .cmp =3D rmt_peer_cmp, + .entry =3D rmt_peer_entry, + .width =3D 7, +}; + +static struct c2c_dimension dim_cl_lcl_peer =3D { + .header =3D HEADER_SPAN_LOW("Lcl"), + .name =3D "cl_lcl_peer", + .cmp =3D lcl_peer_cmp, + .entry =3D lcl_peer_entry, + .width =3D 7, +}; + static struct c2c_dimension dim_tot_stores =3D { .header =3D HEADER_BOTH("Total", "Stores"), .name =3D "tot_stores", @@ -1547,6 +1627,24 @@ static struct c2c_dimension dim_percent_lcl_hitm =3D= { .width =3D 7, }; =20 +static struct c2c_dimension dim_percent_rmt_peer =3D { + .header =3D HEADER_SPAN("-- Peer Snoop --", "Rmt", 1), + .name =3D "percent_rmt_peer", + .cmp =3D percent_rmt_peer_cmp, + .entry =3D percent_rmt_peer_entry, + .color =3D percent_rmt_peer_color, + .width =3D 7, +}; + +static struct c2c_dimension dim_percent_lcl_peer =3D { + .header =3D HEADER_SPAN_LOW("Lcl"), + .name =3D "percent_lcl_peer", + .cmp =3D percent_lcl_peer_cmp, + .entry =3D percent_lcl_peer_entry, + .color =3D percent_lcl_peer_color, + .width =3D 7, +}; + static struct c2c_dimension dim_percent_stores_l1hit =3D { .header =3D HEADER_SPAN("------- Store Refs ------", "L1 Hit", 2), .name =3D "percent_stores_l1hit", @@ -1704,6 +1802,8 @@ static struct c2c_dimension *dimensions[] =3D { &dim_rmt_peer, &dim_cl_lcl_hitm, &dim_cl_rmt_hitm, + &dim_cl_lcl_peer, + &dim_cl_rmt_peer, &dim_tot_stores, &dim_stores_l1hit, &dim_stores_l1miss, @@ -1721,6 +1821,8 @@ static struct c2c_dimension *dimensions[] =3D { &dim_percent_hitm, &dim_percent_rmt_hitm, &dim_percent_lcl_hitm, + &dim_percent_rmt_peer, + &dim_percent_lcl_peer, &dim_percent_stores_l1hit, &dim_percent_stores_l1miss, &dim_percent_stores_na, --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3BBCC433F5 for ; Mon, 30 May 2022 11:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235944AbiE3Llz (ORCPT ); Mon, 30 May 2022 07:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235942AbiE3Lli (ORCPT ); Mon, 30 May 2022 07:41:38 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B39E9814AC for ; Mon, 30 May 2022 04:41:24 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id j6so10339156pfe.13 for ; Mon, 30 May 2022 04:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ApE/NeSlPlWnYl/NpyzgZlFA0HuzdRIS04YcKMMzVxo=; b=q2dlpKKSusIn+OaBINyOpEG4xB0NNWGRBPAhvlIFXok15TJjyDYSD0+pXUlDeorstm asGbzowF16bAbaF8SqIUp26oq5yHaGdmWoY2f4BlqlDT+6S9r6oJZRuy14Tc7rowiWLm EISgtUFX/JYPpSaKNydnQamKxi3gzuyZ36TSeyc+/AgN7M5urcilcEYUXCohwFCB3gp0 SEvgqa03U695YwUZ9iIyIRHHq/IEMpjDNKxyN6fUf6Gj7vfHgdki0sTaExsgIVGaLYeH /Iy75Unami+FxaHmiQHDXR5n/HVtyfz8nnUgYfKywUsAoL4TDA79VFrSs8ty81I9v4pa kbFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ApE/NeSlPlWnYl/NpyzgZlFA0HuzdRIS04YcKMMzVxo=; b=3M04riowLB8neOXR1Lb+VmME+q5tTCJl3c0fIXWOusB+tYeHVUfJogh89HZhcaQ5bF CxckmNKZmcufVkIVMSBJPZxG7K82xyBRLxkCLEnQJ4tdVkP2MuUN0Al5G1elp2fGK61N mx63L5B8evv2QqoEXgaoy2XsHYa0AUlc6BWtJY1eg+f8LOrDtaBFHfr0sPqaPaAWfRMM aCZHBkayur44SDcpfHf1eEVRBmst3dBparIfWktrYcb6GefE4ud9EiFeJN4TYT5lX95+ ke4YDZs6WbV15mIEP06e1NQyoI7Bw4c/47uZD/8WqoZJz7JuIjKbZKg2JpSDtZDaP+9m UJ9Q== X-Gm-Message-State: AOAM532FSsxuN1MrP4yRKP+YYjgkmgKlbPpa4gIOKNr6iK5MTBSUUpW8 StU0zYnQCQD2i0DRzA6OwNUcXw== X-Google-Smtp-Source: ABdhPJxaA3Ux3pVeIYn5BevMjwHXFeNRGJkOhoU+e0OnLN0KsM0hMsD5OAU8JGDiPp8dKUBLYDHvYQ== X-Received: by 2002:aa7:86cb:0:b0:518:3e92:f78b with SMTP id h11-20020aa786cb000000b005183e92f78bmr54866598pfo.61.1653910883942; Mon, 30 May 2022 04:41:23 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:23 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 05/12] perf c2c: Add mean dimensions for peer operations Date: Mon, 30 May 2022 19:40:29 +0800 Message-Id: <20220530114036.3225544-6-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch adds two dimensions for the mean value of peer operations. Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 85768c526f9d..01a0656537f6 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -55,6 +55,8 @@ struct c2c_hists { struct compute_stats { struct stats lcl_hitm; struct stats rmt_hitm; + struct stats lcl_peer; + struct stats rmt_peer; struct stats load; }; =20 @@ -154,6 +156,8 @@ static void *c2c_he_zalloc(size_t size) =20 init_stats(&c2c_he->cstats.lcl_hitm); init_stats(&c2c_he->cstats.rmt_hitm); + init_stats(&c2c_he->cstats.lcl_peer); + init_stats(&c2c_he->cstats.rmt_peer); init_stats(&c2c_he->cstats.load); =20 return &c2c_he->he; @@ -253,6 +257,10 @@ static void compute_stats(struct c2c_hist_entry *c2c_h= e, update_stats(&cstats->rmt_hitm, weight); else if (stats->lcl_hitm) update_stats(&cstats->lcl_hitm, weight); + else if (stats->rmt_peer) + update_stats(&cstats->rmt_peer, weight); + else if (stats->lcl_peer) + update_stats(&cstats->lcl_peer, weight); else if (stats->load) update_stats(&cstats->load, weight); } @@ -1280,6 +1288,8 @@ __func(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp= , struct hist_entry *he) \ MEAN_ENTRY(mean_rmt_entry, rmt_hitm); MEAN_ENTRY(mean_lcl_entry, lcl_hitm); MEAN_ENTRY(mean_load_entry, load); +MEAN_ENTRY(mean_rmt_peer_entry, rmt_peer); +MEAN_ENTRY(mean_lcl_peer_entry, lcl_peer); =20 static int cpucnt_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, @@ -1750,6 +1760,22 @@ static struct c2c_dimension dim_mean_load =3D { .width =3D 8, }; =20 +static struct c2c_dimension dim_mean_rmt_peer =3D { + .header =3D HEADER_SPAN("---------- cycles ----------", "rmt peer", 2), + .name =3D "mean_rmt_peer", + .cmp =3D empty_cmp, + .entry =3D mean_rmt_peer_entry, + .width =3D 8, +}; + +static struct c2c_dimension dim_mean_lcl_peer =3D { + .header =3D HEADER_SPAN_LOW("lcl peer"), + .name =3D "mean_lcl_peer", + .cmp =3D empty_cmp, + .entry =3D mean_lcl_peer_entry, + .width =3D 8, +}; + static struct c2c_dimension dim_cpucnt =3D { .header =3D HEADER_BOTH("cpu", "cnt"), .name =3D "cpucnt", @@ -1835,6 +1861,8 @@ static struct c2c_dimension *dimensions[] =3D { &dim_node, &dim_mean_rmt, &dim_mean_lcl, + &dim_mean_rmt_peer, + &dim_mean_lcl_peer, &dim_mean_load, &dim_cpucnt, &dim_srcline, --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFE4FC433FE for ; Mon, 30 May 2022 11:42:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236003AbiE3LmA (ORCPT ); Mon, 30 May 2022 07:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235861AbiE3Llt (ORCPT ); Mon, 30 May 2022 07:41:49 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B11C48199B for ; Mon, 30 May 2022 04:41:29 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id u18so3934379plb.3 for ; Mon, 30 May 2022 04:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wsncogAhRCuozb/yrezW79k4Hulg1xbD7mAra09AC3c=; b=tufe3k8H/FBkIj8fXyBbX4aKOPoIIe8c1GiInT95+5spRH9nYTk7NoLwvkdnX+z65w kdcsT77vp6uLJtC4cUJWmGLFMgrHeRKtFykTZWSJoy1AicljTWY7ugEfwjYfTl/U1Fv4 zfpLxLVcH/KKjH3ZqayFF/shH2gOQGzHlltAnGvDBKRt7gqTr0WtN09shgczbXjb+UIn vBTcbCAxzUftF7MXb96rw0wui6awS2anzrCvMa8AHgxEeVDKZphxi6zvN7wJpdScOjyj od/MEzUBu/LX++asfMvEhacxiOm4Ad156srS2eJDU12oWSksct0CFDzlLbWK4LYH6E/h oD9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wsncogAhRCuozb/yrezW79k4Hulg1xbD7mAra09AC3c=; b=VLx4OzmP9N6okS3bAMFwpE6bqPtWeGJ6+HzAIQuTly/TQGX8fP0AGhkubtJ0Nc/IyD HZ1G/rrUF7lpVa6eRGRm0aA+5MPob/DzCf5hYiHjcxoKF64j4IkMf6qtwBmkhgqxgmf/ HYGdAttMVpbwjIsscnzDnlHh/Ho95tO2v85bRD81r0WlnL9yMYIdR2T9x1/4rorr99Q+ 9Ig97898hyXnfUqmIbfxFL98PZfCAQPg27LzLZ6AXJBTq5Ar/v0ZC2QAD9TbXRmKBeQS KJu/F5I+VIr3CrhBx4Z0lOO8wgDxy/Osj1rbHFluLxjgfj6oXO7lZATc1cJU6Bzh5Zz3 PLnQ== X-Gm-Message-State: AOAM5337vYWXriRVTtoo0HBCpukXLydtKTviNCUtn0D1aoLY5AfhWaJZ WMdvMp5McJ7X47aYIRmMcrEzYw== X-Google-Smtp-Source: ABdhPJxiFB7JuSdYuU8nlkgxclZNB7u2EVI0WqvYOaH3UQ0NlF5XlMPkbTfMEy3hM2gBq5LqGniFMg== X-Received: by 2002:a17:902:bf4c:b0:15c:3d1b:8a47 with SMTP id u12-20020a170902bf4c00b0015c3d1b8a47mr58147898pls.118.1653910888699; Mon, 30 May 2022 04:41:28 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:28 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 06/12] perf c2c: Use explicit names for display macros Date: Mon, 30 May 2022 19:40:30 +0800 Message-Id: <20220530114036.3225544-7-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Perf c2c tool has an assumption that it heavily depends on HITM snoop type to detect cache false sharing, unfortunately, HITM is not supported on some architectures. Essentially, perf c2c tool wants to find some very costly snooping operations for false cache sharing, this means it's not necessarily to stick using HITM tags and we can explore other snooping types (e.g. SNOOPX_PEER). For this reason, this patch renames HITM related display macros with suffix '_HITM', so it can be distinct if later add more display types for on other snooping type. Signed-off-by: Leo Yan Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 01a0656537f6..b50b23ea28ec 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -115,16 +115,16 @@ struct perf_c2c { }; =20 enum { - DISPLAY_LCL, - DISPLAY_RMT, - DISPLAY_TOT, + DISPLAY_LCL_HITM, + DISPLAY_RMT_HITM, + DISPLAY_TOT_HITM, DISPLAY_MAX, }; =20 static const char *display_str[DISPLAY_MAX] =3D { - [DISPLAY_LCL] =3D "Local", - [DISPLAY_RMT] =3D "Remote", - [DISPLAY_TOT] =3D "Total", + [DISPLAY_LCL_HITM] =3D "Local", + [DISPLAY_RMT_HITM] =3D "Remote", + [DISPLAY_TOT_HITM] =3D "Total", }; =20 static const struct option c2c_options[] =3D { @@ -811,15 +811,15 @@ static double percent_hitm(struct c2c_hist_entry *c2c= _he) total =3D &hists->stats; =20 switch (c2c.display) { - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: st =3D stats->rmt_hitm; tot =3D total->rmt_hitm; break; - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: st =3D stats->lcl_hitm; tot =3D total->lcl_hitm; break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: st =3D stats->tot_hitm; tot =3D total->tot_hitm; default: @@ -1217,15 +1217,15 @@ node_entry(struct perf_hpp_fmt *fmt __maybe_unused,= struct perf_hpp *hpp, advance_hpp(hpp, ret); =20 switch (c2c.display) { - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: ret =3D display_metrics(hpp, stats->rmt_hitm, c2c_he->stats.rmt_hitm); break; - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: ret =3D display_metrics(hpp, stats->lcl_hitm, c2c_he->stats.lcl_hitm); break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: ret =3D display_metrics(hpp, stats->tot_hitm, c2c_he->stats.tot_hitm); break; @@ -1606,9 +1606,9 @@ static struct c2c_dimension dim_tot_loads =3D { }; =20 static struct c2c_header percent_hitm_header[] =3D { - [DISPLAY_LCL] =3D HEADER_BOTH("Lcl", "Hitm"), - [DISPLAY_RMT] =3D HEADER_BOTH("Rmt", "Hitm"), - [DISPLAY_TOT] =3D HEADER_BOTH("Tot", "Hitm"), + [DISPLAY_LCL_HITM] =3D HEADER_BOTH("Lcl", "Hitm"), + [DISPLAY_RMT_HITM] =3D HEADER_BOTH("Rmt", "Hitm"), + [DISPLAY_TOT_HITM] =3D HEADER_BOTH("Tot", "Hitm"), }; =20 static struct c2c_dimension dim_percent_hitm =3D { @@ -2101,15 +2101,15 @@ static bool he__display(struct hist_entry *he, stru= ct c2c_stats *stats) c2c_he =3D container_of(he, struct c2c_hist_entry, he); =20 switch (c2c.display) { - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: he->filtered =3D filter_display(c2c_he->stats.lcl_hitm, stats->lcl_hitm); break; - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: he->filtered =3D filter_display(c2c_he->stats.rmt_hitm, stats->rmt_hitm); break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: he->filtered =3D filter_display(c2c_he->stats.tot_hitm, stats->tot_hitm); break; @@ -2132,13 +2132,13 @@ static inline bool is_valid_hist_entry(struct hist_= entry *he) return true; =20 switch (c2c.display) { - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: has_record =3D !!c2c_he->stats.lcl_hitm; break; - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: has_record =3D !!c2c_he->stats.rmt_hitm; break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: has_record =3D !!c2c_he->stats.tot_hitm; break; default: @@ -2835,11 +2835,11 @@ static int setup_display(const char *str) const char *display =3D str ?: "tot"; =20 if (!strcmp(display, "tot")) - c2c.display =3D DISPLAY_TOT; + c2c.display =3D DISPLAY_TOT_HITM; else if (!strcmp(display, "rmt")) - c2c.display =3D DISPLAY_RMT; + c2c.display =3D DISPLAY_RMT_HITM; else if (!strcmp(display, "lcl")) - c2c.display =3D DISPLAY_LCL; + c2c.display =3D DISPLAY_LCL_HITM; else { pr_err("failed: unknown display type: %s\n", str); return -1; @@ -2927,9 +2927,9 @@ static int setup_coalesce(const char *coalesce, bool = no_source) return -1; =20 if (asprintf(&c2c.cl_resort, "offset,%s", - c2c.display =3D=3D DISPLAY_TOT ? + c2c.display =3D=3D DISPLAY_TOT_HITM ? "tot_hitm" : - c2c.display =3D=3D DISPLAY_RMT ? + c2c.display =3D=3D DISPLAY_RMT_HITM ? "rmt_hitm,lcl_hitm" : "lcl_hitm,rmt_hitm") < 0) return -ENOMEM; @@ -3085,11 +3085,11 @@ static int perf_c2c__report(int argc, const char **= argv) "ld_rmthit,rmt_hitm," "dram_lcl,dram_rmt"; =20 - if (c2c.display =3D=3D DISPLAY_TOT) + if (c2c.display =3D=3D DISPLAY_TOT_HITM) sort_str =3D "tot_hitm"; - else if (c2c.display =3D=3D DISPLAY_RMT) + else if (c2c.display =3D=3D DISPLAY_RMT_HITM) sort_str =3D "rmt_hitm"; - else if (c2c.display =3D=3D DISPLAY_LCL) + else if (c2c.display =3D=3D DISPLAY_LCL_HITM) sort_str =3D "lcl_hitm"; =20 c2c_hists__reinit(&c2c.hists, output_str, sort_str); --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32336C433F5 for ; Mon, 30 May 2022 11:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234535AbiE3LmH (ORCPT ); Mon, 30 May 2022 07:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235980AbiE3Llv (ORCPT ); Mon, 30 May 2022 07:41:51 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C20B2B57 for ; Mon, 30 May 2022 04:41:34 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id n8so10114642plh.1 for ; Mon, 30 May 2022 04:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jMrBxZYPbeFUurfukQ/2U4FIRA07iFNb/YD2s1OiXOs=; b=kM6JNT2qmeWTwEt34yIFbrqnzAHYZBlZElPZAixACO+F0lhiA9WJC6YwLSVQGnHa3T KVZJZFtLuIIiGYnWQXYIukbCJgJy1svErJQzmmNi6JhZ6uWGgNCHqNXjUD6Fo/xpq5eF 525wDmx18xKKhHOSr+M/UZkG/dU+FBmTb4UuDvIJF0oLA+Ewaho4XLrKZpH/ArfQTXfa MnLYClQ4lkhYc9BSC7SKpHpNerelkkeXnyhz3Hls2AVB2N/9MH08dA+t02mBgA+1ZJp8 RhFrOWQn2jMM+GCFexw0K7hioRgPW/N7kRkriy+jgzjcuB6KppKLabOeIpQwPE6jVHCe UWng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jMrBxZYPbeFUurfukQ/2U4FIRA07iFNb/YD2s1OiXOs=; b=1cmWk9Wcds4uysThARQLWPhW/cRmZI1ZhOkxO716XjID5+jMWLzVRb/hVNE/70KRZj sV2LCmAI9AQKIwH+FWknSk/mf8IFzn5XRb1SrwT4gJg/0/K16K+54+IYl+mh7fqRzFSa UkhHFxCc1qpsacFXnzdwDdBtjBBFiIO9vHbCRelCwEuS3G+oxnCMZ3QNgFDKE4BMlRAs WzkrHt9oY2AjEcEjSUPaLOLogUUpHbC3cqHOhV7gXetjz3EMed3t0fzX0HF+3BUijYsQ otxNHRR7Sz8gHq1O5TdKfnPtb6Sf+T+H+BZe+dRiORnsgvWZx8ikCvT/oWgsrIqVgB6n Tl8w== X-Gm-Message-State: AOAM5303LPXsz56HoWBHRCHIxgDqXT4i0bc5THn+Qw8DoJ7WobgYgUNb Jy5OL0/sjJmNFhjQRK5yre7HsBA11wTJZZ30cf1cfw== X-Google-Smtp-Source: ABdhPJzx8cnnRhEwl99HEHEFKK2hKroMH9+bl7IidmSYsa0yRIDTDqRelAg6a3LiFYR0GpkWmbFitg== X-Received: by 2002:a17:902:8645:b0:15f:2eb5:3d49 with SMTP id y5-20020a170902864500b0015f2eb53d49mr55910710plt.42.1653910893477; Mon, 30 May 2022 04:41:33 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:33 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 07/12] perf c2c: Rename dimension from 'percent_hitm' to 'percent_costly_snoop' Date: Mon, 30 May 2022 19:40:31 +0800 Message-Id: <20220530114036.3225544-8-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use more general naming for the main sort dimension, this can allow us not to sort only on HITM snoop type, so it can be extended to support other costly snooping operations. So rename the dimension to the prefix 'percent_costly_". Signed-off-by: Leo Yan Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index b50b23ea28ec..d3608d24bea4 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -798,7 +798,7 @@ percent_color(struct perf_hpp_fmt *fmt, struct perf_hpp= *hpp, return hpp_color_scnprintf(hpp, "%*.2f%%", width - 1, per); } =20 -static double percent_hitm(struct c2c_hist_entry *c2c_he) +static double percent_costly_snoop(struct c2c_hist_entry *c2c_he) { struct c2c_hists *hists; struct c2c_stats *stats; @@ -838,8 +838,8 @@ static double percent_hitm(struct c2c_hist_entry *c2c_h= e) }) =20 static int -percent_hitm_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, - struct hist_entry *he) +percent_costly_snoop_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) { struct c2c_hist_entry *c2c_he; int width =3D c2c_width(fmt, hpp, he->hists); @@ -847,20 +847,20 @@ percent_hitm_entry(struct perf_hpp_fmt *fmt, struct p= erf_hpp *hpp, double per; =20 c2c_he =3D container_of(he, struct c2c_hist_entry, he); - per =3D percent_hitm(c2c_he); + per =3D percent_costly_snoop(c2c_he); return scnprintf(hpp->buf, hpp->size, "%*s", width, PERC_STR(buf, per)); } =20 static int -percent_hitm_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, - struct hist_entry *he) +percent_costly_snoop_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) { - return percent_color(fmt, hpp, he, percent_hitm); + return percent_color(fmt, hpp, he, percent_costly_snoop); } =20 static int64_t -percent_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused, - struct hist_entry *left, struct hist_entry *right) +percent_costly_snoop_cmp(struct perf_hpp_fmt *fmt __maybe_unused, + struct hist_entry *left, struct hist_entry *right) { struct c2c_hist_entry *c2c_left; struct c2c_hist_entry *c2c_right; @@ -870,8 +870,8 @@ percent_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unuse= d, c2c_left =3D container_of(left, struct c2c_hist_entry, he); c2c_right =3D container_of(right, struct c2c_hist_entry, he); =20 - per_left =3D percent_hitm(c2c_left); - per_right =3D percent_hitm(c2c_right); + per_left =3D percent_costly_snoop(c2c_left); + per_right =3D percent_costly_snoop(c2c_right); =20 return per_left - per_right; } @@ -1605,17 +1605,17 @@ static struct c2c_dimension dim_tot_loads =3D { .width =3D 7, }; =20 -static struct c2c_header percent_hitm_header[] =3D { +static struct c2c_header percent_costly_snoop_header[] =3D { [DISPLAY_LCL_HITM] =3D HEADER_BOTH("Lcl", "Hitm"), [DISPLAY_RMT_HITM] =3D HEADER_BOTH("Rmt", "Hitm"), [DISPLAY_TOT_HITM] =3D HEADER_BOTH("Tot", "Hitm"), }; =20 -static struct c2c_dimension dim_percent_hitm =3D { - .name =3D "percent_hitm", - .cmp =3D percent_hitm_cmp, - .entry =3D percent_hitm_entry, - .color =3D percent_hitm_color, +static struct c2c_dimension dim_percent_costly_snoop =3D { + .name =3D "percent_costly_snoop", + .cmp =3D percent_costly_snoop_cmp, + .entry =3D percent_costly_snoop_entry, + .color =3D percent_costly_snoop_color, .width =3D 7, }; =20 @@ -1844,7 +1844,7 @@ static struct c2c_dimension *dimensions[] =3D { &dim_ld_rmthit, &dim_tot_recs, &dim_tot_loads, - &dim_percent_hitm, + &dim_percent_costly_snoop, &dim_percent_rmt_hitm, &dim_percent_lcl_hitm, &dim_percent_rmt_peer, @@ -2748,7 +2748,7 @@ static int ui_quirks(void) nodestr =3D "CL"; } =20 - dim_percent_hitm.header =3D percent_hitm_header[c2c.display]; + dim_percent_costly_snoop.header =3D percent_costly_snoop_header[c2c.displ= ay]; =20 /* Fix the zero line for dcacheline column. */ buf =3D fill_line("Cacheline", dim_dcacheline.width + @@ -3074,7 +3074,7 @@ static int perf_c2c__report(int argc, const char **ar= gv) "dcacheline," "dcacheline_node," "dcacheline_count," - "percent_hitm," + "percent_costly_snoop," "tot_hitm,lcl_hitm,rmt_hitm," "tot_recs," "tot_loads," --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16766C433FE for ; Mon, 30 May 2022 11:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231731AbiE3LmD (ORCPT ); Mon, 30 May 2022 07:42:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235982AbiE3Llv (ORCPT ); Mon, 30 May 2022 07:41:51 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C35CCC3F for ; Mon, 30 May 2022 04:41:38 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id a10so1528037pju.3 for ; Mon, 30 May 2022 04:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iz4biW4IDZ4QF/Qhrw0FBXVfKeF/4pqPrsK4LZ1UsOg=; b=okSUF0PGgdTegKALKNn8jtLiWYsEUlcbtTa0US/Oc+8m9/jSGz1aUHw9fjo4qE/TDE SJVv0RXU0EOYhRhTIF/1X6lHKcFgPIjYCXfcz9JJM2FszSrzZ/WXTvzf6xr7WrHgSn1r MaSEBxjLxSncG5bCMXgSyWlnp80kuoqc3m15Z6DIorcRa7GPmIO5SXEfB6jXBKpWuKrI +S76GX0q6aXX/b5a9Xgz3Wbq/eYd7ktscxUk0DwAR3X//xj8dUaigYTXozIMdHb8EQRw bPc5gUeimG1ObEzhYuyOLWnypgUQUazRUQ6fflSTWo7jzkF38FYbw7nljAIaHZm0XVrQ iCSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iz4biW4IDZ4QF/Qhrw0FBXVfKeF/4pqPrsK4LZ1UsOg=; b=raSe5CAeCfjeBYUcYNcSaMBJB+KLLkch+cG3seKS0A/OLsz9isQ5f9RMaFaaYBufUz 9ciXxXZ67r6sii5x0gU7l5zQn76eEqhn32VEAIyTzMYHyKxek/OIH6R2FE8XSw6Ka3Nz RriVp/BFF2xtKW7GuJTak06FucKyvhzAFmd40TxSvxSa/t8/8P/5ebFSu5Yc8NBh3MuM D5D8ObL4f9IW5Vk4UtIQB7Va0fWcZRB3HMBmOS5KPCnzLU1vtXnheCBrcMNtqdKCJ+SU 1lAEy2SjxX4BBYafr31FQbRVJ0MWdOkXomAFovcZLVLsXMaVn/HXBEPyD6t/Upi5U6U+ m4TA== X-Gm-Message-State: AOAM5327dIpXZxpnXZWkEOsY01vHIrb02NU0722e60wmaU5NNHJWz1+R i+OtGYlZj1B6ydaxsvrLcLbbqg== X-Google-Smtp-Source: ABdhPJxaqvLQtMDeUqaJoddPBV920ZEhBaxkPVNe8EoeMNOCtUBEdgTUy7ChmatTR+i027oqfxAOUw== X-Received: by 2002:a17:903:22ca:b0:163:e2b6:e10b with SMTP id y10-20020a17090322ca00b00163e2b6e10bmr4540757plg.28.1653910898269; Mon, 30 May 2022 04:41:38 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:37 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 08/12] perf c2c: Refactor node header Date: Mon, 30 May 2022 19:40:32 +0800 Message-Id: <20220530114036.3225544-9-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The node header array contains 3 items, each item is used for one of the 3 flavors for node accessing info. To extend sorting on other snooping type and not always stick to HITMs, the second header string "Node{cpus %hitms %stores}" should be adjusted (e.g. it's changed as "Node{cpus %peer %stores}"). For this reason, this patch changes the node header array to three flat variables and uses switch-case in function setup_nodes_header(), thus it is easier for altering the header string. Signed-off-by: Leo Yan Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index d3608d24bea4..e76219034588 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1723,12 +1723,6 @@ static struct c2c_dimension dim_dso =3D { .se =3D &sort_dso, }; =20 -static struct c2c_header header_node[3] =3D { - HEADER_LOW("Node"), - HEADER_LOW("Node{cpus %hitms %stores}"), - HEADER_LOW("Node{cpu list}"), -}; - static struct c2c_dimension dim_node =3D { .name =3D "node", .cmp =3D empty_cmp, @@ -2229,9 +2223,27 @@ static int resort_cl_cb(struct hist_entry *he, void = *arg __maybe_unused) return 0; } =20 +static struct c2c_header header_node_0 =3D HEADER_LOW("Node"); +static struct c2c_header header_node_1 =3D HEADER_LOW("Node{cpus %hitms %s= tores}"); +static struct c2c_header header_node_2 =3D HEADER_LOW("Node{cpu list}"); + static void setup_nodes_header(void) { - dim_node.header =3D header_node[c2c.node_info]; + switch (c2c.node_info) { + case 0: + dim_node.header =3D header_node_0; + break; + case 1: + dim_node.header =3D header_node_1; + break; + case 2: + dim_node.header =3D header_node_2; + break; + default: + break; + } + + return; } =20 static int setup_nodes(struct perf_session *session) --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B505C433F5 for ; Mon, 30 May 2022 11:42:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234102AbiE3Lmr (ORCPT ); Mon, 30 May 2022 07:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236021AbiE3Lly (ORCPT ); Mon, 30 May 2022 07:41:54 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B686B10C9 for ; Mon, 30 May 2022 04:41:43 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id p8so10357857pfh.8 for ; Mon, 30 May 2022 04:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=THH8wa7TnqV/qE1Ao1QWNDBQ+CCTll+o2go/NvMpMcM=; b=IOuudsk7MsQjj6yf2WuomJioY7leWfVDpGdP+k9EDowGz+IOYCT98fRZbCOo0fSZa6 OwXav1eeZO/2xqMD2B4kHGqx+hXeqXMS80as+AYnzGl1uSXDLIp9Uuw7F+qG/Oazzlye tRoiubYQ3jullshw8qbKH/L2jwjT/IBTKJfl/smvhRNkMM4QxAt0qNez/vFF68bWGRJo 3ou/gYV+BSDT9NG10i598gv8yOCLvk8Ajsnye/+7Ns2WEnf/EctMFUjDMazcEklgvoAe wMdm6oc1CksDdOE4KCOuvJqWNTs7Tzp9M5sn9xG9pLdRzLWd1mq7xV7l72sxrLxdg+Xw PM3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=THH8wa7TnqV/qE1Ao1QWNDBQ+CCTll+o2go/NvMpMcM=; b=XAdVjH9YgIPHrmblLF9VMDXlEHJUih2UOu7Cq7WPFgmya0vp1AqNQGbf8ZN5HdMLkw 9Yk8UxHkWDFWzb2nBqpYTOkRAy+rz2ZN3+3tSdHrrHfUjOpRhcqIZf7DVng9sQP/20te 9zFmQ+lpalPUiCKX6/0zROId3aa/LQejfDCDdb1OnDerA9plllKVtNjj30Z5rCYwGQzq 7W/p0wa4W4H6MYGi1O5Dxb9cX6IOQHpNXb0amffV6vtKuyzXYp0xDQbgYdJYa0oZx6TJ dyHg7N8q4NXpgtmwmsAAyjpNtjkhAQFChFcLFMot7nYN6hnlNLZb8sirfC7IUfzz5lL9 sWaA== X-Gm-Message-State: AOAM533v0hfPgsBDwFOBVDPQdkr4SgalcxgMCHdaNT4vCk/V07laEZM2 pwwQ8DMaFB51RTvDLeDX7W1xcg== X-Google-Smtp-Source: ABdhPJw9aP6CuPXiYhnsc021cGhUxiDsPVFpXzRlww3p0MkLdWVDKG8KZtY2KeZh69tpohnFpmRqyQ== X-Received: by 2002:a63:6c44:0:b0:3fa:ec6b:33e7 with SMTP id h65-20020a636c44000000b003faec6b33e7mr20976033pgc.435.1653910903028; Mon, 30 May 2022 04:41:43 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:42 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 09/12] perf c2c: Refactor display string Date: Mon, 30 May 2022 19:40:33 +0800 Message-Id: <20220530114036.3225544-10-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The display type is shown by combination the display string array and a suffix string "HITMs", which is not friendly to extend display for other sorting type (e.g. extension for peer operations). This patch moves the suffix string "HITMs" into display string array for HITM types, so it can allow us to not necessarily to output string "HITMs" for new incoming display type. Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index e76219034588..725b23d9104b 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -122,9 +122,9 @@ enum { }; =20 static const char *display_str[DISPLAY_MAX] =3D { - [DISPLAY_LCL_HITM] =3D "Local", - [DISPLAY_RMT_HITM] =3D "Remote", - [DISPLAY_TOT_HITM] =3D "Total", + [DISPLAY_LCL_HITM] =3D "Local HITMs", + [DISPLAY_RMT_HITM] =3D "Remote HITMs", + [DISPLAY_TOT_HITM] =3D "Total HITMs", }; =20 static const struct option c2c_options[] =3D { @@ -2489,7 +2489,7 @@ static void print_c2c_info(FILE *out, struct perf_ses= sion *session) fprintf(out, "%-36s: %s\n", first ? " Events" : "", evsel__name(evsel)); first =3D false; } - fprintf(out, " Cachelines sort on : %s HITMs\n", + fprintf(out, " Cachelines sort on : %s\n", display_str[c2c.display]); fprintf(out, " Cacheline data grouping : %s\n", c2c.cl_sort); } @@ -2646,7 +2646,7 @@ static int perf_c2c_browser__title(struct hist_browse= r *browser, { scnprintf(bf, size, "Shared Data Cache Line Table " - "(%lu entries, sorted on %s HITMs)", + "(%lu entries, sorted on %s)", browser->nr_non_filtered_entries, display_str[c2c.display]); return 0; --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E71CEC433EF for ; Mon, 30 May 2022 11:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236144AbiE3Lmi (ORCPT ); Mon, 30 May 2022 07:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235979AbiE3Ll5 (ORCPT ); Mon, 30 May 2022 07:41:57 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDFB260F3 for ; Mon, 30 May 2022 04:41:48 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id j191so2698827pgd.3 for ; Mon, 30 May 2022 04:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1tErUF60N3/poOQ34K3pLp/W53qnui8KunfogS3GKLQ=; b=qgNlIbYCcuKDjLE0WHctpmNgZCMyBsZYx/ukes09bOvUR/k4uPDgShI4/5f9ylNJO9 TnMPrMInw0WZv24kJ0FgBZQiOI3rGUxN/BPUAcfpq13GTI/lnn4hhNdD4RrhXJ8qjiCq mhICZv/U60K3luutl/JRuK/RZhScjNBN0p36EnM0HH+WhHKPlvFrImfuvxHIPzUK3+rw qcXzcotBhNRSQomX98Uma7D029mtc+IshzwzwxOC8vwc+mFoqZQeemT/R8BKTUt6ilAI jXrzRbeR3CyM+ziSFhE/BXeu9khmyDPS8cy/ez4zs2WqH6/nVmTKsbKkYTOEydzBvC7K NA7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1tErUF60N3/poOQ34K3pLp/W53qnui8KunfogS3GKLQ=; b=Hc7lEf7kH6aPApF7DfWVCHDMB8O2M1WFd9SEg/szcdodLNVwMqodnkZzuZiIzd+I3K A9CEWGz/ZeiRG758z1So+D//M68g52d4JVpsftybZF8m3sISTwRNboNpu3IgaitryzD8 ITxYITkVfHcEZad/+JXHfGjO7irERQN/fp2TmL7LirrnIqcCmO5yJ6VeHKzhAfy19D98 Cmi0kOGHuCS2ki06Uqf0EmGALLetA6zffU/h98xwluKuePR77VLthKSzustGBALxbIuY EzCXNZFKg+qLGR1PZEqkYCF1Wxoh8kp10lwUUI5pxJR2Ee0/dhYIk7OnWcuP8szje0jP RdlQ== X-Gm-Message-State: AOAM530sTu49paxmfIUG/urT6GFMqKM62ZvKtyeOX8fi+htPeBlrDC2D 3r8/fyZ7f1tvynqOJ11VnEFWXQ== X-Google-Smtp-Source: ABdhPJzOnfLfyILvbqypZZLz6//RlDghjT1YQfrPdcQV0hjFEQrfbVTWyOrBtTM3OetBzsImA+Kv+g== X-Received: by 2002:a65:6c12:0:b0:3db:a518:ff1b with SMTP id y18-20020a656c12000000b003dba518ff1bmr47131027pgu.315.1653910907842; Mon, 30 May 2022 04:41:47 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:47 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 10/12] perf c2c: Sort on peer snooping for load operations Date: Mon, 30 May 2022 19:40:34 +0800 Message-Id: <20220530114036.3225544-11-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch adds a new option 'peer' so can sort on the cache hit for peer snooping. For displaying with option 'peer', the "Shared Data Cache Line Table" and "Shared Cache Line Distribution Pareto" both sort with the metrics "tot_peer". As result, we can get the 'peer' display: # perf c2c report -d peer --coalesce tid,pid,iaddr,dso -N --stdio =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Shared Data Cache Line Table =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # # ----------- Cacheline ---------- Peer ------- Load Peer ---= ---- Total Total Total --------- Stores -------- ----- Core Load= Hit ----- - LLC Load Hit -- - RMT Load Hit -- --- Load Dram ---- # Index Address Node PA cnt Snoop Total Local Re= mote records Loads Stores L1Hit L1Miss N/A FB L= 1 L2 LclHit LclHitm RmtHit RmtHitm Lcl Rmt # ..... .................. .... ...... ....... ....... ....... ...= .... ....... ....... ....... ....... ....... ....... ....... ......= . ....... ........ ....... ........ ....... ........ ........ # 0 0xaaaac17d6000 N/A 0 100.00% 99 99 = 0 18851 18851 0 0 0 0 0 1875= 2 0 99 0 0 0 0 0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Shared Cache Line Distribution Pareto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # # -- Peer Snoop -- ------- Store Refs ------ --------- Data addr= ess --------- ---------- c= ycles ---------- Total cpu Shar= ed # Num Rmt Lcl L1 Hit L1 Miss N/A Offset = Node PA cnt Pid Tid Code address rmt peer lc= l peer load records cnt Symbol Obje= ct Source:Line Node{cpus %peers %stores} # ..... ....... ....... ....... ....... ....... .................. = .... ...... ....... ................. .................. ........ ..= ...... ........ ....... ........ ...................... ..............= .. ............... .... # ---------------------------------------------------------------------- 0 0 99 0 0 0 0xaaaac17d6000 ---------------------------------------------------------------------- 0.00% 3.03% 0.00% 0.00% 0.00% 0x20 = N/A 0 3603 3603:memstress 0xaaaac17c25ac 0 = 376 41 9314 2 [.] 0x00000000000025ac memstress = memstress[25ac] 0{ 2 100.0% n/a} 0.00% 3.03% 0.00% 0.00% 0.00% 0x20 = N/A 0 3603 3606:memstress 0xaaaac17c25ac 0 = 375 44 9155 1 [.] 0x00000000000025ac memstress = memstress[25ac] 0{ 1 100.0% n/a} 0.00% 48.48% 0.00% 0.00% 0.00% 0x29 = N/A 0 3603 3606:memstress 0xaaaac17c3e88 0 = 180 170 65 1 [.] 0x0000000000003e88 memstress = memstress[3e88] 0{ 1 100.0% n/a} 0.00% 45.45% 0.00% 0.00% 0.00% 0x29 = N/A 0 3603 3603:memstress 0xaaaac17c3e88 0 = 180 175 70 2 [.] 0x0000000000003e88 memstress = memstress[3e88] 0{ 2 100.0% n/a} Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 135 ++++++++++++++++++++++++++++----------- 1 file changed, 99 insertions(+), 36 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 725b23d9104b..1076bf8684d3 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -118,6 +118,7 @@ enum { DISPLAY_LCL_HITM, DISPLAY_RMT_HITM, DISPLAY_TOT_HITM, + DISPLAY_SNP_PEER, DISPLAY_MAX, }; =20 @@ -125,6 +126,7 @@ static const char *display_str[DISPLAY_MAX] =3D { [DISPLAY_LCL_HITM] =3D "Local HITMs", [DISPLAY_RMT_HITM] =3D "Remote HITMs", [DISPLAY_TOT_HITM] =3D "Total HITMs", + [DISPLAY_SNP_PEER] =3D "Peer Snoop", }; =20 static const struct option c2c_options[] =3D { @@ -822,6 +824,11 @@ static double percent_costly_snoop(struct c2c_hist_ent= ry *c2c_he) case DISPLAY_TOT_HITM: st =3D stats->tot_hitm; tot =3D total->tot_hitm; + break; + case DISPLAY_SNP_PEER: + st =3D stats->tot_peer; + tot =3D total->tot_peer; + break; default: break; } @@ -1229,6 +1236,10 @@ node_entry(struct perf_hpp_fmt *fmt __maybe_unused, = struct perf_hpp *hpp, ret =3D display_metrics(hpp, stats->tot_hitm, c2c_he->stats.tot_hitm); break; + case DISPLAY_SNP_PEER: + ret =3D display_metrics(hpp, stats->tot_peer, + c2c_he->stats.tot_peer); + break; default: break; } @@ -1609,6 +1620,7 @@ static struct c2c_header percent_costly_snoop_header[= ] =3D { [DISPLAY_LCL_HITM] =3D HEADER_BOTH("Lcl", "Hitm"), [DISPLAY_RMT_HITM] =3D HEADER_BOTH("Rmt", "Hitm"), [DISPLAY_TOT_HITM] =3D HEADER_BOTH("Tot", "Hitm"), + [DISPLAY_SNP_PEER] =3D HEADER_BOTH("Peer", "Snoop"), }; =20 static struct c2c_dimension dim_percent_costly_snoop =3D { @@ -2107,6 +2119,10 @@ static bool he__display(struct hist_entry *he, struc= t c2c_stats *stats) he->filtered =3D filter_display(c2c_he->stats.tot_hitm, stats->tot_hitm); break; + case DISPLAY_SNP_PEER: + he->filtered =3D filter_display(c2c_he->stats.tot_peer, + stats->tot_peer); + break; default: break; } @@ -2135,6 +2151,8 @@ static inline bool is_valid_hist_entry(struct hist_en= try *he) case DISPLAY_TOT_HITM: has_record =3D !!c2c_he->stats.tot_hitm; break; + case DISPLAY_SNP_PEER: + has_record =3D !!c2c_he->stats.tot_peer; default: break; } @@ -2224,7 +2242,10 @@ static int resort_cl_cb(struct hist_entry *he, void = *arg __maybe_unused) } =20 static struct c2c_header header_node_0 =3D HEADER_LOW("Node"); -static struct c2c_header header_node_1 =3D HEADER_LOW("Node{cpus %hitms %s= tores}"); +static struct c2c_header header_node_1_hitms_stores =3D + HEADER_LOW("Node{cpus %hitms %stores}"); +static struct c2c_header header_node_1_peers_stores =3D + HEADER_LOW("Node{cpus %peers %stores}"); static struct c2c_header header_node_2 =3D HEADER_LOW("Node{cpu list}"); =20 static void setup_nodes_header(void) @@ -2234,7 +2255,10 @@ static void setup_nodes_header(void) dim_node.header =3D header_node_0; break; case 1: - dim_node.header =3D header_node_1; + if (c2c.display =3D=3D DISPLAY_SNP_PEER) + dim_node.header =3D header_node_1_peers_stores; + else + dim_node.header =3D header_node_1_hitms_stores; break; case 2: dim_node.header =3D header_node_2; @@ -2308,13 +2332,14 @@ static int setup_nodes(struct perf_session *session) } =20 #define HAS_HITMS(__h) ((__h)->stats.lcl_hitm || (__h)->stats.rmt_hitm) +#define HAS_PEER(__h) ((__h)->stats.lcl_peer || (__h)->stats.rmt_peer) =20 static int resort_shared_cl_cb(struct hist_entry *he, void *arg __maybe_un= used) { struct c2c_hist_entry *c2c_he; c2c_he =3D container_of(he, struct c2c_hist_entry, he); =20 - if (HAS_HITMS(c2c_he)) { + if (HAS_HITMS(c2c_he) || HAS_PEER(c2c_he)) { c2c.shared_clines++; c2c_add_stats(&c2c.shared_clines_stats, &c2c_he->stats); } @@ -2447,13 +2472,22 @@ static void print_pareto(FILE *out) int ret; const char *cl_output; =20 - cl_output =3D "cl_num," - "cl_rmt_hitm," - "cl_lcl_hitm," - "cl_stores_l1hit," - "cl_stores_l1miss," - "cl_stores_na," - "dcacheline"; + if (c2c.display !=3D DISPLAY_SNP_PEER) + cl_output =3D "cl_num," + "cl_rmt_hitm," + "cl_lcl_hitm," + "cl_stores_l1hit," + "cl_stores_l1miss," + "cl_stores_na," + "dcacheline"; + else + cl_output =3D "cl_num," + "cl_rmt_peer," + "cl_lcl_peer," + "cl_stores_l1hit," + "cl_stores_l1miss," + "cl_stores_na," + "dcacheline"; =20 perf_hpp_list__init(&hpp_list); ret =3D hpp_list__parse(&hpp_list, cl_output, NULL); @@ -2852,6 +2886,8 @@ static int setup_display(const char *str) c2c.display =3D DISPLAY_RMT_HITM; else if (!strcmp(display, "lcl")) c2c.display =3D DISPLAY_LCL_HITM; + else if (!strcmp(display, "peer")) + c2c.display =3D DISPLAY_SNP_PEER; else { pr_err("failed: unknown display type: %s\n", str); return -1; @@ -2898,10 +2934,12 @@ static int build_cl_output(char *cl_sort, bool no_s= ource) } =20 if (asprintf(&c2c.cl_output, - "%s%s%s%s%s%s%s%s%s%s", + "%s%s%s%s%s%s%s%s%s%s%s%s", c2c.use_stdio ? "cl_num_empty," : "", - "percent_rmt_hitm," - "percent_lcl_hitm," + c2c.display =3D=3D DISPLAY_SNP_PEER ? "percent_rmt_peer," + "percent_lcl_peer," : + "percent_rmt_hitm," + "percent_lcl_hitm,", "percent_stores_l1hit," "percent_stores_l1miss," "percent_stores_na," @@ -2909,8 +2947,10 @@ static int build_cl_output(char *cl_sort, bool no_so= urce) add_pid ? "pid," : "", add_tid ? "tid," : "", add_iaddr ? "iaddr," : "", - "mean_rmt," - "mean_lcl," + c2c.display =3D=3D DISPLAY_SNP_PEER ? "mean_rmt_peer," + "mean_lcl_peer," : + "mean_rmt," + "mean_lcl,", "mean_load," "tot_recs," "cpucnt,", @@ -2931,6 +2971,7 @@ static int build_cl_output(char *cl_sort, bool no_sou= rce) static int setup_coalesce(const char *coalesce, bool no_source) { const char *c =3D coalesce ?: coalesce_default; + const char *sort_str =3D NULL; =20 if (asprintf(&c2c.cl_sort, "offset,%s", c) < 0) return -ENOMEM; @@ -2938,12 +2979,16 @@ static int setup_coalesce(const char *coalesce, boo= l no_source) if (build_cl_output(c2c.cl_sort, no_source)) return -1; =20 - if (asprintf(&c2c.cl_resort, "offset,%s", - c2c.display =3D=3D DISPLAY_TOT_HITM ? - "tot_hitm" : - c2c.display =3D=3D DISPLAY_RMT_HITM ? - "rmt_hitm,lcl_hitm" : - "lcl_hitm,rmt_hitm") < 0) + if (c2c.display =3D=3D DISPLAY_TOT_HITM) + sort_str =3D "tot_hitm"; + else if (c2c.display =3D=3D DISPLAY_RMT_HITM) + sort_str =3D "rmt_hitm,lcl_hitm"; + else if (c2c.display =3D=3D DISPLAY_LCL_HITM) + sort_str =3D "lcl_hitm,rmt_hitm"; + else if (c2c.display =3D=3D DISPLAY_SNP_PEER) + sort_str =3D "tot_peer"; + + if (asprintf(&c2c.cl_resort, "offset,%s", sort_str) < 0) return -ENOMEM; =20 pr_debug("coalesce sort fields: %s\n", c2c.cl_sort); @@ -2991,7 +3036,7 @@ static int perf_c2c__report(int argc, const char **ar= gv) "print_type,threshold[,print_limit],order,sort_key[,branch],value", callchain_help, &parse_callchain_opt, callchain_default_opt), - OPT_STRING('d', "display", &display, "Switch HITM output type", "lcl,rmt"= ), + OPT_STRING('d', "display", &display, "Switch HITM output type", "tot,lcl,= rmt,peer"), OPT_STRING('c', "coalesce", &coalesce, "coalesce fields", "coalesce fields: pid,tid,iaddr,dso"), OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"), @@ -3082,20 +3127,36 @@ static int perf_c2c__report(int argc, const char **= argv) goto out_mem2node; } =20 - output_str =3D "cl_idx," - "dcacheline," - "dcacheline_node," - "dcacheline_count," - "percent_costly_snoop," - "tot_hitm,lcl_hitm,rmt_hitm," - "tot_recs," - "tot_loads," - "tot_stores," - "stores_l1hit,stores_l1miss,stores_na," - "ld_fbhit,ld_l1hit,ld_l2hit," - "ld_lclhit,lcl_hitm," - "ld_rmthit,rmt_hitm," - "dram_lcl,dram_rmt"; + if (c2c.display !=3D DISPLAY_SNP_PEER) + output_str =3D "cl_idx," + "dcacheline," + "dcacheline_node," + "dcacheline_count," + "percent_costly_snoop," + "tot_hitm,lcl_hitm,rmt_hitm," + "tot_recs," + "tot_loads," + "tot_stores," + "stores_l1hit,stores_l1miss,stores_na," + "ld_fbhit,ld_l1hit,ld_l2hit," + "ld_lclhit,lcl_hitm," + "ld_rmthit,rmt_hitm," + "dram_lcl,dram_rmt"; + else + output_str =3D "cl_idx," + "dcacheline," + "dcacheline_node," + "dcacheline_count," + "percent_costly_snoop," + "tot_peer,lcl_peer,rmt_peer," + "tot_recs," + "tot_loads," + "tot_stores," + "stores_l1hit,stores_l1miss,stores_na," + "ld_fbhit,ld_l1hit,ld_l2hit," + "ld_lclhit,lcl_hitm," + "ld_rmthit,rmt_hitm," + "dram_lcl,dram_rmt"; =20 if (c2c.display =3D=3D DISPLAY_TOT_HITM) sort_str =3D "tot_hitm"; @@ -3103,6 +3164,8 @@ static int perf_c2c__report(int argc, const char **ar= gv) sort_str =3D "rmt_hitm"; else if (c2c.display =3D=3D DISPLAY_LCL_HITM) sort_str =3D "lcl_hitm"; + else if (c2c.display =3D=3D DISPLAY_SNP_PEER) + sort_str =3D "tot_peer"; =20 c2c_hists__reinit(&c2c.hists, output_str, sort_str); =20 --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FDF1C433EF for ; Mon, 30 May 2022 11:42:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235976AbiE3LmV (ORCPT ); Mon, 30 May 2022 07:42:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236030AbiE3LmA (ORCPT ); Mon, 30 May 2022 07:42:00 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64BD86341 for ; Mon, 30 May 2022 04:41:53 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 129so5655751pgc.2 for ; Mon, 30 May 2022 04:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lAvFNka/m3Pr7HXS/bNaYQopT2wZ3BtRM1nGnYwWgUI=; b=J35JDHdYfL3z47b3U5zMVTOC/j930PY8ubRHzosSBNYhYnetLWQGy+FrMMc42JfKQu xsVGdUt8Kmdi6+FM8KoCUxbaC2nTtU5nKNr5hl6ERK3/PFFj/BM3E5bJBpnamfodL+jW K84Q0wZrkxDo4iZUlFVBBUu5KQMkw1c0q4TyeQEvVABgb7gk/X/zELEzfKPTUzBnK4ai eV7fFCFQhvZd5qAmQti5dQm5vgrGqLzp3bei6g29pRH+dKF7WN316A9bczx4YLvWmFnq ro5syfmQVPx43kcYs4HWr2fP+duGwu71YV0wrFhSBe4Hagtz/bY3p+5tGxfWHXvWvkYg oy0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lAvFNka/m3Pr7HXS/bNaYQopT2wZ3BtRM1nGnYwWgUI=; b=F/GR6PwjmT6eUaKsb0JTDUiG87wQniyBpVm+mD8gG4saA1GpWURY+581n9GvqJN9mQ bceEJ1+jC4ytwzxhHD+hCrpSZUBVcOWfGbffsTFVlBPOBXoSIjDXl68AiH6RDSDArSvP i0U4v6rOqYHhXm2iCYGKZWRwGYvuu3M4iRQREbR/OqKyi0wRwL9flH3q66ueiFVNDKjM AgupjWEylTDW/FgrRVkWCnqv/YhSKDIEqiMXw6kd/H6CywqiFRZuCnxK+1Xha7NrNFBQ +2lAHXCu9jrpa3SLFN4vLbDVwGUOJsgRCudWa85MOKAwx3CudGtf5l0J4oN6DPhDBOZ7 LvqQ== X-Gm-Message-State: AOAM533xJ5hFjN35x8/r17iq+2l8jSLesEXeSKvFxjlWRddjk0KH3G4E rkFiEFx8qSNuXvCSVLTgSKdxXNT9G7lTNpFxrFU= X-Google-Smtp-Source: ABdhPJyICzqM2HpkXHFV0U936Hh64o0w7SC8tQexIpAlh7exp3xGA3kC8nJtJBTHfClC7Y/SrryZkA== X-Received: by 2002:a63:85c3:0:b0:3f9:dd67:8ddd with SMTP id u186-20020a6385c3000000b003f9dd678dddmr39306452pgd.258.1653910912632; Mon, 30 May 2022 04:41:52 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:52 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 11/12] perf c2c: Use 'peer' as default display for Arm64 Date: Mon, 30 May 2022 19:40:35 +0800 Message-Id: <20220530114036.3225544-12-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since Arm64 arch doesn't support HITMs flags, this patch changes to use 'peer' as default display if user doesn't specify any type; for other arches, it still uses 'tot' as default display type if user doesn't specify it. This patch changes to call perf_session__new() in an earlier place, so session environment can be initialized ahead and arch info can be used for setting display type. Suggested-by: Ali Saidi Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 1076bf8684d3..ccfd23103b96 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2878,7 +2878,7 @@ static int setup_callchain(struct evlist *evlist) =20 static int setup_display(const char *str) { - const char *display =3D str ?: "tot"; + const char *display =3D str; =20 if (!strcmp(display, "tot")) c2c.display =3D DISPLAY_TOT_HITM; @@ -3066,27 +3066,39 @@ static int perf_c2c__report(int argc, const char **= argv) data.path =3D input_name; data.force =3D symbol_conf.force; =20 + session =3D perf_session__new(&data, &c2c.tool); + if (IS_ERR(session)) { + err =3D PTR_ERR(session); + pr_debug("Error creating perf session\n"); + goto out; + } + + /* + * Use the 'tot' as default display type if user doesn't specify it; + * since Arm64 platform doesn't support HITMs flag, use 'peer' as the + * default display type. + */ + if (!display) { + if (!strcmp(perf_env__arch(&session->header.env), "arm64")) + display =3D "peer"; + else + display =3D "tot"; + } + err =3D setup_display(display); if (err) - goto out; + goto out_session; =20 err =3D setup_coalesce(coalesce, no_source); if (err) { pr_debug("Failed to initialize hists\n"); - goto out; + goto out_session; } =20 err =3D c2c_hists__init(&c2c.hists, "dcacheline", 2); if (err) { pr_debug("Failed to initialize hists\n"); - goto out; - } - - session =3D perf_session__new(&data, &c2c.tool); - if (IS_ERR(session)) { - err =3D PTR_ERR(session); - pr_debug("Error creating perf session\n"); - goto out; + goto out_session; } =20 session->itrace_synth_opts =3D &itrace_synth_opts; @@ -3094,7 +3106,7 @@ static int perf_c2c__report(int argc, const char **ar= gv) err =3D setup_nodes(session); if (err) { pr_err("Failed setup nodes\n"); - goto out; + goto out_session; } =20 err =3D mem2node__init(&c2c.mem2node, &session->header.env); --=20 2.25.1 From nobody Thu Apr 30 09:31:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C986C433FE for ; Mon, 30 May 2022 11:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231566AbiE3Lmz (ORCPT ); Mon, 30 May 2022 07:42:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235766AbiE3LmF (ORCPT ); Mon, 30 May 2022 07:42:05 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 602B512752 for ; Mon, 30 May 2022 04:41:58 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id y1so10363029pfr.6 for ; Mon, 30 May 2022 04:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LdxnTcXDrJ5Hs4bCX9T3OZHsm8XEJDCruVBdQ6pwKoc=; b=ooUrNtahWsQ/dC/e3fO6YAyaQSMxODE6/OQ6nYHoSjmHvFGqgpLkHe3/hRwNWXuB0v Yg5WP+nhNqzLXUuu7QQBrejrPUMWVylWInURkgIzUzfe7OS+oYXBYVz5VMFl3bQRa09Z Cso5qREOTM0fDZ9Pav5SAyLlbaTBtrFV0u4NwACN0bPaKfWvm3ajw5mq1UXYHTMO7Tte dXTwvMtSQNVScWSwlWuJ1uG0vQNbGO2IGKIRZKV9ZgDJ1dT5hnrJhna6WkPXH2Ks3J76 jINH1Qpxuq3fCz4LXptKKbtFHt7weHfti8p0cuuZm5yCTS+Oz96QrvwemkQ5IINOPJjQ Vl3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LdxnTcXDrJ5Hs4bCX9T3OZHsm8XEJDCruVBdQ6pwKoc=; b=1k8XTOh0KpfneP+n/LWVByX/RxTKUjKnMv6z0XeA18pIaipW5moepLlVQiJIwAspFf nzxA95REhSB0YRuOl3fGdt2/YpI0aUaO8NJy1gZJnTaHskF3X/hsdoileelAx0xxZRUR nesELM5DfPU8cviy1kmQkxJnpow0NO9JnYu632qwnHqq2s/hbiJyZ+ZFJaNyfVvdTcpP fZHYl0XzWbynB4pOQhsb+5zHZtMvx2CVTLY2l1EsYL5aXPxWKHDxzMEmEcIq2pj2lz5+ V2PLv7jf2yZ2uInsDs0AHG2VO1BloucqhfMS8fvtlO16m/EpdQsWWrnp407zSHml3ptm k0aA== X-Gm-Message-State: AOAM532cUJMuWvrozz1S8i4mVXtlJhcf71aSnDlwBPvBnvqEE+qE2gES kVZjLNWpZWrMgFpqepsF09m9/g== X-Google-Smtp-Source: ABdhPJzXUeKZvxuLnb/e7hEqtwEeM9YU+K0OtIUC58d4PVWRRcbiWsnWXYTefnUXwlC4viMdlGugFA== X-Received: by 2002:a62:1b06:0:b0:518:1649:bb6d with SMTP id b6-20020a621b06000000b005181649bb6dmr57040995pfb.25.1653910917454; Mon, 30 May 2022 04:41:57 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:57 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 12/12] perf c2c: Update documentation for new display option 'peer' Date: Mon, 30 May 2022 19:40:36 +0800 Message-Id: <20220530114036.3225544-13-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since the new display option 'peer' is introduced, this patch is to update the documentation to reflect it. Signed-off-by: Leo Yan Reviewed-by: Ali Saidi Tested-by: Ali Saidi --- tools/perf/Documentation/perf-c2c.txt | 30 ++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentati= on/perf-c2c.txt index 6f69173731aa..e1549798c6f3 100644 --- a/tools/perf/Documentation/perf-c2c.txt +++ b/tools/perf/Documentation/perf-c2c.txt @@ -109,7 +109,8 @@ REPORT OPTIONS =20 -d:: --display:: - Switch to HITM type (rmt, lcl) to display and sort on. Total HITMs as def= ault. + Switch to HITM type (rmt, lcl) or peer snooping type (peer) to display + and sort on. Total HITMs (tot) as default. =20 --stitch-lbr:: Show callgraph with stitched LBRs, which may have more complete @@ -174,12 +175,18 @@ For each cacheline in the 1) list we display followin= g data: Cacheline - cacheline address (hex number) =20 - Rmt/Lcl Hitm + Rmt/Lcl Hitm (Display with HITM types) - cacheline percentage of all Remote/Local HITM accesses =20 - LLC Load Hitm - Total, LclHitm, RmtHitm + Peer Snoop (Display with peer type) + - cacheline percentage of all peer accesses + + LLC Load Hitm - Total, LclHitm, RmtHitm (For display with HITM types) - count of Total/Local/Remote load HITMs =20 + Load Peer - Total, Local, Remote (For display with peer type) + - count of Total/Local/Remote load from peer cache or DRAM + Total records - sum of all cachelines accesses =20 @@ -201,16 +208,21 @@ For each cacheline in the 1) list we display followin= g data: - count of LLC load accesses, includes LLC hits and LLC HITMs =20 RMT Load Hit - RmtHit, RmtHitm - - count of remote load accesses, includes remote hits and remote HITMs + - count of remote load accesses, includes remote hits and remote HITMs; + on Arm neoverse cores, RmtHit is used to account remote accesses, + includes remote DRAM or any upward cache level in remote node =20 Load Dram - Lcl, Rmt - count of local and remote DRAM accesses =20 For each offset in the 2) list we display following data: =20 - HITM - Rmt, Lcl + HITM - Rmt, Lcl (Display with HITM types) - % of Remote/Local HITM accesses for given offset within cacheline =20 + Peer Snoop - Rmt, Lcl (Display with peer type) + - % of Remote/Local peer accesses for given offset within cacheline + Store Refs - L1 Hit, L1 Miss, N/A - % of store accesses that hit L1, missed L1 and N/A (no available) memo= ry level for given offset within cacheline @@ -227,9 +239,12 @@ For each offset in the 2) list we display following da= ta: Code address - code address responsible for the accesses =20 - cycles - rmt hitm, lcl hitm, load + cycles - rmt hitm, lcl hitm, load (Display with HITM types) - sum of cycles for given accesses - Remote/Local HITM and generic load =20 + cycles - rmt peer, lcl peer, load (Display with peer type) + - sum of cycles for given accesses - Remote/Local peer load and generi= c load + cpu cnt - number of cpus that participated on the access =20 @@ -251,7 +266,8 @@ The 'Node' field displays nodes that accesses given cac= heline offset. Its output comes in 3 flavors: - node IDs separated by ',' - node IDs with stats for each ID, in following format: - Node{cpus %hitms %stores} + Node{cpus %hitms %stores} (Display with HITM types) + Node{cpus %peers %stores} (Display with peer type) - node IDs with list of affected CPUs in following format: Node{cpu list} =20 --=20 2.25.1