From nobody Sun May 10 17:53:29 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 7D494C433FE for ; Wed, 27 Apr 2022 15:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240499AbiD0Pzx (ORCPT ); Wed, 27 Apr 2022 11:55:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240476AbiD0Pxu (ORCPT ); Wed, 27 Apr 2022 11:53:50 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DE0755203 for ; Wed, 27 Apr 2022 08:50:33 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id m14-20020a17090a34ce00b001d5fe250e23so2085685pjf.3 for ; Wed, 27 Apr 2022 08:50:33 -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=1ds190eK1hF3mnV/9rzLoVn8f2hvZpOofdeWPJk4Nig=; b=DJ8WK8/MfkEWAxkzOYR0O+uGljGuI6lUvURUjar+hVr531fZ20WDuUUZoCCZUnDv3k UulRnJtX6ZIljWuh2oGp8i20qQCW82/ZwrA65HUyfWT5Pg16UOBvSI2adM7DUc23OCu/ NVPvLaQakLyrfiBYxOy8p37SYYw3pjbdZn4gFXFKopiADnn4nScI4MIaXBT0j5V2534K Bw31wIR0CDeGO1R/3jiwtLer56JFk1cbKjbEPVrn3xTVMDmg7+2ROzcz5BNBTmHrmw9b ZOkRADL30ZX0l2qglgA+lvjDTBwCNCsNQsAZkz+sW1NJBWkvnwmr3QAISeSkQvsvYEny j1Pw== 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=1ds190eK1hF3mnV/9rzLoVn8f2hvZpOofdeWPJk4Nig=; b=REVB1w02t6oN/P8jPnqDuMqc4t4nAh73z/m9CQn3k0JFSZ9XVKivx3sOzyQS57NmXl QmQybAhcQeSejv3d9l3+R+EWR2T7H8F7Jkg+Vu+1Th3mENVY3Y0MFucOL3Z8G2nw7RVp c77kKbbWgtTHls8GYdpfPNCzmaKyomkRTPar89rN4hgs98J+ows8hhINBEiKz+nr0Log sAYMB/+EzeGwrB8DFPnygz6JnNfBN8M7QQNl4evtEZILF/6MceYwkW38ailz057ueDNv ts//Delotk9N5R1c5Puiv12CdVvCMUruPCsRs7tFchNgP2eI5TcvVgjFMfiFezODCpBt /hJA== X-Gm-Message-State: AOAM533djM5BQOSEsaeFE7YhQwmkG2BktWJ2uILxC3l2wdpII8D1WyB7 1QFO2H10qBA5Tfz0prEYmV1cwy2uLrqM7tXX X-Google-Smtp-Source: ABdhPJxs9q+KRD6xkQQHFqJA5vSQD4CDnrT/aXmHWfAnqz6ngaQaPxqetFe3TYdkynsX8FdMQojCRQ== X-Received: by 2002:a17:903:24f:b0:15c:e3b8:a640 with SMTP id j15-20020a170903024f00b0015ce3b8a640mr23410022plh.5.1651074632710; Wed, 27 Apr 2022 08:50:32 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:50:32 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 01/11] perf mem: Add any cache level statistics for store operation Date: Wed, 27 Apr 2022 23:50:03 +0800 Message-Id: <20220427155013.1833222-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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" Sometimes we don't know memory store operations happen on exactly which cache level, so set the memory level flag PERF_MEM_LVLNUM_ANY_CACHE for this case. An usage case is that Arm SPE trace data sets this flag for all the store operations due to we have no sufficient info for cache level. This patch is to add a new item "st_anylvl" in structure c2c_stats so that support any cache level statistics for store operations. Signed-off-by: Leo Yan Tested-by: Ali Saidi --- tools/perf/util/mem-events.c | 4 ++++ tools/perf/util/mem-events.h | 1 + 2 files changed, 5 insertions(+) diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index db5225caaabe..bfbac365e1e4 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c @@ -527,6 +527,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct me= m_info *mi) u64 snoop =3D data_src->mem_snoop; u64 lock =3D data_src->mem_lock; u64 blk =3D data_src->mem_blk; + u64 lvl_num =3D data_src->mem_lvl_num; /* * Skylake might report unknown remote level via this * bit, consider it when evaluating remote HITMs. @@ -621,6 +622,8 @@ do { \ } if (lvl & P(LVL, MISS)) if (lvl & P(LVL, L1)) stats->st_l1miss++; + if (lvl_num =3D=3D P(LVLNUM, ANY_CACHE)) + stats->st_anylvl++; } else { /* unparsable data_src? */ stats->noparse++; @@ -647,6 +650,7 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_= stats *add) stats->st_noadrs +=3D add->st_noadrs; stats->st_l1hit +=3D add->st_l1hit; stats->st_l1miss +=3D add->st_l1miss; + stats->st_anylvl +=3D add->st_anylvl; stats->load +=3D add->load; stats->ld_excl +=3D add->ld_excl; stats->ld_shared +=3D add->ld_shared; diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h index 916242f8020a..e0e8057c52e8 100644 --- a/tools/perf/util/mem-events.h +++ b/tools/perf/util/mem-events.h @@ -63,6 +63,7 @@ struct c2c_stats { u32 st_noadrs; /* cacheable store with no address */ u32 st_l1hit; /* count of stores that hit L1D */ u32 st_l1miss; /* count of stores that miss L1D */ + u32 st_anylvl; /* count of stores with any cache level */ u32 load; /* count of all loads in trace */ u32 ld_excl; /* exclusive loads, rmt/lcl DRAM - snp none/miss= */ u32 ld_shared; /* shared loads, rmt/lcl DRAM - snp hit */ --=20 2.25.1 From nobody Sun May 10 17:53:29 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 3B6E2C433EF for ; Wed, 27 Apr 2022 15:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240566AbiD0Pz5 (ORCPT ); Wed, 27 Apr 2022 11:55:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240574AbiD0Pxy (ORCPT ); Wed, 27 Apr 2022 11:53:54 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E45E253E15 for ; Wed, 27 Apr 2022 08:50:40 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id z16so1933807pfh.3 for ; Wed, 27 Apr 2022 08:50:40 -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=aieDGF3ATgEnI82WJMWvxFqEdxYytl3KzImFfmAMmUQ=; b=jCr/M60V+FBlhcebtRtHMiB72UHOPoNvItJ6BMLencUYSJiLyNbcdbxCuude/Ciqz3 fBfnBcAUFsvReSwYws2ioC50mcvED3k3Fii1BeCdIaTopdAp+jtQuATMu4XqY5qwNvtF bOXmmimMSnJa7C1v9JmSKzeiun1atq7WjmErsh4x2RglBe1gxEfwEkYPESfGERb7YsTa 3tVnk1vPIv8ce/EaITGV4ajqS9beHhNJGZqhtpMzYfpGBlDvKXhcJP3qWoj5Z1Wv0x+b A1tq/YeIROIS80eVkOeA6vaCCwpt2OjgLvWJfgD1Xnzp2tyL/XUF5qpar10TlS8y+Bpx VjLw== 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=aieDGF3ATgEnI82WJMWvxFqEdxYytl3KzImFfmAMmUQ=; b=C0FCx+1+qvv/o0QMget6kEeUTERBMSWi5mYh11XG1VS5zdI4bGgNcS/o+wlXW4GQsI K/AKQddo+8HUNsAA9PtFSYx0WPko60Dxti66LPTHoYDzpZJ2zd6PhHaGCo3jrsZgHyzE u9X5kMHxlL6I9dKLASb8JO9DCv8Gsq4y4hvcJJRSBvztBZCcyR/huUlsijyC3U9pm+tQ HNqJ8gqJFrnQti6eA6qgx7g2+VryN44yj1K/fLSNWVUxs7zKSBpQ918Mm4YjcPqn5Z/w ILmaypWUl3wWrWkiePJSz7A04jc7de6DaoEKlOBSySiLiKGs86mIcd3yj2s3M79fzI/E atHQ== X-Gm-Message-State: AOAM5308kUelJmzi+znvwnh5VKScDhRpU2/0ddFpPzDKjRBAZch1Is6+ zC/d2ht+e0TOV0OOUT6T8UA9jQ== X-Google-Smtp-Source: ABdhPJzVOF9wzr6ywu2PPLAQ5K6M66fSocQQABsWC21Fj3LpmoozyyAXJWu0H1yYoMpwozAp6gwZGA== X-Received: by 2002:a63:e355:0:b0:39d:7956:6d3c with SMTP id o21-20020a63e355000000b0039d79566d3cmr24649589pgj.385.1651074640263; Wed, 27 Apr 2022 08:50:40 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:50:39 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 02/11] perf c2c: Add dimensions for 'anylvl' metrics of store operation Date: Wed, 27 Apr 2022 23:50:04 +0800 Message-Id: <20220427155013.1833222-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 now we have the statistics 'st_anylvl' for store operations, add dimensions for the 'anylvl' metrics and also associated percentage calculation for the single cache line view. Signed-off-by: Leo Yan Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 80 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index fbbed434014f..9ef439610a2b 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -653,6 +653,7 @@ STAT_FN(lcl_hitm) STAT_FN(store) STAT_FN(st_l1hit) STAT_FN(st_l1miss) +STAT_FN(st_anylvl) STAT_FN(ld_fbhit) STAT_FN(ld_l1hit) STAT_FN(ld_l2hit) @@ -677,7 +678,8 @@ static uint64_t total_records(struct c2c_stats *stats) =20 total =3D ldcnt + stats->st_l1hit + - stats->st_l1miss; + stats->st_l1miss + + stats->st_anylvl; =20 return total; } @@ -899,6 +901,7 @@ PERCENT_FN(rmt_hitm) PERCENT_FN(lcl_hitm) PERCENT_FN(st_l1hit) PERCENT_FN(st_l1miss) +PERCENT_FN(st_anylvl) =20 static int percent_rmt_hitm_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, @@ -1024,6 +1027,37 @@ percent_stores_l1miss_cmp(struct perf_hpp_fmt *fmt _= _maybe_unused, return per_left - per_right; } =20 +static int +percent_stores_anylvl_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, st_anylvl); + char buf[10]; + + return scnprintf(hpp->buf, hpp->size, "%*s", width, PERC_STR(buf, per)); +} + +static int +percent_stores_anylvl_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) +{ + return percent_color(fmt, hpp, he, percent_st_anylvl); +} + +static int64_t +percent_stores_anylvl_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, st_anylvl); + per_right =3D PERCENT(right, st_anylvl); + + return per_left - per_right; +} + STAT_FN(lcl_dram) STAT_FN(rmt_dram) =20 @@ -1351,7 +1385,7 @@ static struct c2c_dimension dim_tot_stores =3D { }; =20 static struct c2c_dimension dim_stores_l1hit =3D { - .header =3D HEADER_SPAN("---- Stores ----", "L1Hit", 1), + .header =3D HEADER_SPAN("--------- Stores --------", "L1Hit", 2), .name =3D "stores_l1hit", .cmp =3D st_l1hit_cmp, .entry =3D st_l1hit_entry, @@ -1366,8 +1400,16 @@ static struct c2c_dimension dim_stores_l1miss =3D { .width =3D 7, }; =20 +static struct c2c_dimension dim_stores_anylvl =3D { + .header =3D HEADER_SPAN_LOW("Anylvl"), + .name =3D "stores_anylvl", + .cmp =3D st_anylvl_cmp, + .entry =3D st_anylvl_entry, + .width =3D 7, +}; + static struct c2c_dimension dim_cl_stores_l1hit =3D { - .header =3D HEADER_SPAN("-- Store Refs --", "L1 Hit", 1), + .header =3D HEADER_SPAN("------- Store Refs ------", "L1 Hit", 2), .name =3D "cl_stores_l1hit", .cmp =3D st_l1hit_cmp, .entry =3D st_l1hit_entry, @@ -1382,6 +1424,14 @@ static struct c2c_dimension dim_cl_stores_l1miss =3D= { .width =3D 7, }; =20 +static struct c2c_dimension dim_cl_stores_anylvl =3D { + .header =3D HEADER_SPAN_LOW("Any Lvl"), + .name =3D "cl_stores_anylvl", + .cmp =3D st_anylvl_cmp, + .entry =3D st_anylvl_entry, + .width =3D 7, +}; + static struct c2c_dimension dim_ld_fbhit =3D { .header =3D HEADER_SPAN("----- Core Load Hit -----", "FB", 2), .name =3D "ld_fbhit", @@ -1471,7 +1521,7 @@ static struct c2c_dimension dim_percent_lcl_hitm =3D { }; =20 static struct c2c_dimension dim_percent_stores_l1hit =3D { - .header =3D HEADER_SPAN("-- Store Refs --", "L1 Hit", 1), + .header =3D HEADER_SPAN("------- Store Refs ------", "L1 Hit", 2), .name =3D "percent_stores_l1hit", .cmp =3D percent_stores_l1hit_cmp, .entry =3D percent_stores_l1hit_entry, @@ -1488,6 +1538,15 @@ static struct c2c_dimension dim_percent_stores_l1mis= s =3D { .width =3D 7, }; =20 +static struct c2c_dimension dim_percent_stores_anylvl =3D { + .header =3D HEADER_SPAN_LOW("Any Lvl"), + .name =3D "percent_stores_anylvl", + .cmp =3D percent_stores_anylvl_cmp, + .entry =3D percent_stores_anylvl_entry, + .color =3D percent_stores_anylvl_color, + .width =3D 7, +}; + static struct c2c_dimension dim_dram_lcl =3D { .header =3D HEADER_SPAN("--- Load Dram ----", "Lcl", 1), .name =3D "dram_lcl", @@ -1618,8 +1677,10 @@ static struct c2c_dimension *dimensions[] =3D { &dim_tot_stores, &dim_stores_l1hit, &dim_stores_l1miss, + &dim_stores_anylvl, &dim_cl_stores_l1hit, &dim_cl_stores_l1miss, + &dim_cl_stores_anylvl, &dim_ld_fbhit, &dim_ld_l1hit, &dim_ld_l2hit, @@ -1632,6 +1693,7 @@ static struct c2c_dimension *dimensions[] =3D { &dim_percent_lcl_hitm, &dim_percent_stores_l1hit, &dim_percent_stores_l1miss, + &dim_percent_stores_anylvl, &dim_dram_lcl, &dim_dram_rmt, &dim_pid, @@ -2149,6 +2211,7 @@ static void print_c2c__display_stats(FILE *out) fprintf(out, " Store - no mapping : %10d\n", stats->st_no= adrs); fprintf(out, " Store L1D Hit : %10d\n", stats->st_l1= hit); fprintf(out, " Store L1D Miss : %10d\n", stats->st_l1= miss); + fprintf(out, " Store Any cache Level : %10d\n", stats->st_an= ylvl); fprintf(out, " No Page Map Rejects : %10d\n", stats->nomap= ); fprintf(out, " Unable to parse data source : %10d\n", stats->nopar= se); } @@ -2171,6 +2234,7 @@ static void print_shared_cacheline_info(FILE *out) 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= ); fprintf(out, " Store L1D hits on shared lines : %10d\n", stats->st_l1= hit); + fprintf(out, " Store Any cache Level : %10d\n", stats->st_an= ylvl); fprintf(out, " Total Merged records : %10d\n", hitm_cnt + s= tats->store); } =20 @@ -2193,10 +2257,10 @@ static void print_cacheline(struct c2c_hists *c2c_h= ists, fprintf(out, "\n"); } =20 - fprintf(out, " ---------------------------------------------------------= ----\n"); + fprintf(out, " ---------------------------------------------------------= -------------\n"); __hist_entry__snprintf(he_cl, &hpp, hpp_list); fprintf(out, "%s\n", bf); - fprintf(out, " ---------------------------------------------------------= ----\n"); + fprintf(out, " ---------------------------------------------------------= -------------\n"); =20 hists__fprintf(&c2c_hists->hists, false, 0, 0, 0, out, false); } @@ -2213,6 +2277,7 @@ static void print_pareto(FILE *out) "cl_lcl_hitm," "cl_stores_l1hit," "cl_stores_l1miss," + "cl_stores_anylvl," "dcacheline"; =20 perf_hpp_list__init(&hpp_list); @@ -2664,6 +2729,7 @@ static int build_cl_output(char *cl_sort, bool no_sou= rce) "percent_lcl_hitm," "percent_stores_l1hit," "percent_stores_l1miss," + "percent_stores_anylvl," "offset,offset_node,dcacheline_count,", add_pid ? "pid," : "", add_tid ? "tid," : "", @@ -2850,7 +2916,7 @@ static int perf_c2c__report(int argc, const char **ar= gv) "tot_recs," "tot_loads," "tot_stores," - "stores_l1hit,stores_l1miss," + "stores_l1hit,stores_l1miss,stores_anylvl," "ld_fbhit,ld_l1hit,ld_l2hit," "ld_lclhit,lcl_hitm," "ld_rmthit,rmt_hitm," --=20 2.25.1 From nobody Sun May 10 17:53:29 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 E54B8C4321E for ; Wed, 27 Apr 2022 15:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240418AbiD0PyG (ORCPT ); Wed, 27 Apr 2022 11:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240705AbiD0Px7 (ORCPT ); Wed, 27 Apr 2022 11:53:59 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FD7A5418D for ; Wed, 27 Apr 2022 08:50:46 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id u9so1286205plf.6 for ; Wed, 27 Apr 2022 08:50:46 -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=mfKXbZgTIWEbTeJVhX3se1YhLuBecr8QQNQtzkisZ/M=; b=FynZD/Nxe3Kd36w7ZFjddUbEH+HlByXx87gtJ4W57LZLaRmUOK1HRcfbyB6Ql8llP3 Lnjwql8fWqr9XFPpLWm66YB+ZbPyCJH87wO59ONmwO3sQ3q/NHljKCCBH2rEGeqf1+TS pos6vXQ78YWj6iqWkEfIaM7qSt37Y7ukFGvPiW3ELILfmRZSy+bCMJyxnZOwiIS67gZY qKQqJTD8UAXCD7mQHEwN2qigtUxK49DEXsMosJbcFv7CT9iPjVHTXOiuCJ7seygl50FK /vbqM8DHshD2+mhEuXaIJT4uvpgiuqgWoQKX0p3uJR+ES+VPb/UMINH8W3sI8v6Od8QK UPog== 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=mfKXbZgTIWEbTeJVhX3se1YhLuBecr8QQNQtzkisZ/M=; b=QSTjZNgcktaeouQIoEvv7+SqhUwzukIoc3NCENgJ5fFHQ9BpEBm3pGjwOysUHdDXkG qEzy6orHglqowmZiZrTh0mpo8ZUakzCU8Yh0xQ2FZ3W8FUdicp9HOpj1zhlGBoV/7iTa thk5jZol5lhyaG8eVppO8rdr9KfanXPjbR3Y8UEMpYCGIazON6y7SZjEDl/dDuKGlVU3 SupwFjDr8Vztv+R9oa4jkN3ohzCMuMoAsmafF8BS1X+rkFGFoHOkjMI5jsvf2q0QXanP 1JlMKnPEIyTE3eO/AsrRLD5eQPwLRqinV/WUZHuMGDCsyCZL0NwEe+kk3/5qOe9m4bIc WXQw== X-Gm-Message-State: AOAM5335wthqaJcEm3NvntMkPYu0uRRezH5r86852/2FIBg7XWcGFOBk TRGzDNsYRKr2P03DHTFDO0FSUg== X-Google-Smtp-Source: ABdhPJzyg4F/AeRn63E0UEHpjQyBVkOG2K2klpoV5R1ukWxPZZMkych35g8pp0R8H2elq8bJi8QzTA== X-Received: by 2002:a17:90b:1c8e:b0:1bf:364c:dd7a with SMTP id oo14-20020a17090b1c8e00b001bf364cdd7amr33215082pjb.103.1651074646401; Wed, 27 Apr 2022 08:50:46 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:50:46 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 03/11] perf c2c: Update documentation for store metric 'Any Lvl' Date: Wed, 27 Apr 2022 23:50:05 +0800 Message-Id: <20220427155013.1833222-4-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 'Any Lvl' metric is added for store operations, update documentation to reflect changes in the report table. Signed-off-by: Leo Yan Tested-by: Ali Saidi --- tools/perf/Documentation/perf-c2c.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentati= on/perf-c2c.txt index 3b6a2c84ea02..b39e3f3df272 100644 --- a/tools/perf/Documentation/perf-c2c.txt +++ b/tools/perf/Documentation/perf-c2c.txt @@ -189,9 +189,10 @@ For each cacheline in the 1) list we display following= data: Total stores - sum of all store accesses =20 - Store Reference - L1Hit, L1Miss + Store Reference - L1Hit, L1Miss, AnyLvl L1Hit - store accesses that hit L1 L1Miss - store accesses that missed L1 + AnyLvl - store accesses which is possible to hit any cache level =20 Core Load Hit - FB, L1, L2 - count of load hits in FB (Fill Buffer), L1 and L2 cache @@ -210,8 +211,9 @@ For each offset in the 2) list we display following dat= a: HITM - Rmt, Lcl - % of Remote/Local HITM accesses for given offset within cacheline =20 - Store Refs - L1 Hit, L1 Miss - - % of store accesses that hit/missed L1 for given offset within cacheli= ne + Store Refs - L1 Hit, L1 Miss, Any Lvl + - % of store accesses that hit L1, missed L1 and any cache level for giv= en + offset within cacheline =20 Data address - Offset - offset address --=20 2.25.1 From nobody Sun May 10 17:53:29 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 38B78C433FE for ; Wed, 27 Apr 2022 15:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240649AbiD0PyU (ORCPT ); Wed, 27 Apr 2022 11:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240447AbiD0PyG (ORCPT ); Wed, 27 Apr 2022 11:54:06 -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 AC3DA55200 for ; Wed, 27 Apr 2022 08:50:53 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id b12so1910534plg.4 for ; Wed, 27 Apr 2022 08:50: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=n9mbHgP4oIrBWKuBGSVuQJ/xfzioNAnEfGDPfU6omQE=; b=xh5Sq2ByBdI49RmxJdtiP3Dj/LfrXSKDe1Mx1s+TvGy3fdHmeCb+HVLVL4DYOhWqc4 lQz9kni44Kfonad1tD4ZZVydqTOnhq9NijS4hD1ZGcC51OKntcIkpOsQej/5zN1LvGno i+AFqLyM1bjfCLWiHpHDqEJvUTYEFA3sudeKCFzP6BtuyEXlok8cuC0bEAinhWja4SI8 PkqPuDfyK8IGfaWwI0l4cbENS7sBdDu/ioj5lBn/BIirfpO4UJUCR3S1rIeaEFiQtR6q eaTLxy203vweB5gtzR+kZlyPDmpw/Qvf3Q6rrgwjWhO0vXH1bgFGUKCZaMTsPaXE+sz4 Iz9g== 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=n9mbHgP4oIrBWKuBGSVuQJ/xfzioNAnEfGDPfU6omQE=; b=04ViOzNJAzXaizA59MZIYfNyoH7grGYBcOyOFGTlKC1oBT1LFbNCRXw+LDIIpqeaq8 WZdetDRuOAamtcRmIs/mMge+dhE+ugozFyM4nMhs7r5Qgp7yjH6yikso4W60Hwk7orbR HeN6yjO8jF12sBcpHTXBWoYeYaZjriHHGdnDJJwespzfnr1sR1k9IBeyinWiNb30VlCi ZAa8WUrWfHZJgzDYtzP8MzljqjnHeXHnlCMQOcy6mVjLmsGpCLAziMgXRDGeTm2zhSVy dmMOL08uKpvzS5GZP6OMlXQ2z9DbEwV4dt4WjNjKlZFsd3SJoP37hcgrXHNHXhZNgNy2 TdGg== X-Gm-Message-State: AOAM532SDwIWCLOEMlBj59whZFGNkuIfgcpa5Mvab4mxgo/GHAnOwyUG G67jbzKv2aQlL9rvYVhUF3BP4A== X-Google-Smtp-Source: ABdhPJxdZHLEK54DZhgcXwH5DrvFcLQ50XRUP/0XQ/Ogc+I/NhNqHONX0nS0LgGknwdiedirSifvkw== X-Received: by 2002:a17:90b:4ac4:b0:1da:26e3:b3a2 with SMTP id mh4-20020a17090b4ac400b001da26e3b3a2mr6224072pjb.49.1651074653010; Wed, 27 Apr 2022 08:50:53 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:50:52 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 04/11] perf mem: Add statistics for peer snooping Date: Wed, 27 Apr 2022 23:50:06 +0800 Message-Id: <20220427155013.1833222-5-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 we have added the flag PERF_MEM_SNOOPX_PEER to support cache snooping from peer core or cluster, this patch is to add statistics for this new flag. Signed-off-by: Leo Yan Tested-by: Ali Saidi --- tools/perf/util/mem-events.c | 11 ++++++++++- tools/perf/util/mem-events.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index bfbac365e1e4..2086f067359b 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; u64 lvl_num =3D data_src->mem_lvl_num; @@ -568,10 +569,17 @@ 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)) { + if (snoopx & P(SNOOPX, PEER)) + stats->ld_peer++; + else + stats->ld_l2hit++; + } if (lvl & P(LVL, L3 )) { if (snoop & P(SNOOP, HITM)) HITM_INC(lcl_hitm); + else if (snoopx & P(SNOOPX, PEER)) + stats->ld_peer++; else stats->ld_llchit++; } @@ -662,6 +670,7 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_= stats *add) stats->ld_l1hit +=3D add->ld_l1hit; stats->ld_l2hit +=3D add->ld_l2hit; stats->ld_llchit +=3D add->ld_llchit; + stats->ld_peer +=3D add->ld_peer; stats->lcl_hitm +=3D add->lcl_hitm; stats->rmt_hitm +=3D add->rmt_hitm; stats->tot_hitm +=3D add->tot_hitm; diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h index e0e8057c52e8..7b6c74e74354 100644 --- a/tools/perf/util/mem-events.h +++ b/tools/perf/util/mem-events.h @@ -75,6 +75,7 @@ struct c2c_stats { u32 ld_l1hit; /* count of loads that hit L1D */ u32 ld_l2hit; /* count of loads that hit L2D */ u32 ld_llchit; /* count of loads that hit LLC */ + u32 ld_peer; /* count of loads that hit peer core or cluster = cache */ 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 */ --=20 2.25.1 From nobody Sun May 10 17:53:29 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 71116C433EF for ; Wed, 27 Apr 2022 15:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240717AbiD0Pyd (ORCPT ); Wed, 27 Apr 2022 11:54:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240598AbiD0PyT (ORCPT ); Wed, 27 Apr 2022 11:54:19 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 195CB5418D for ; Wed, 27 Apr 2022 08:50:59 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id h12so1882540plf.12 for ; Wed, 27 Apr 2022 08:50:59 -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=Mp/cIkoM/PJoe1xE+vZz8Akslqiqmw4V33yfSOipkIM=; b=eOnyEym2vzT8TUWpZQ00UktI+qXOeIvYi456W/zTl1L1I2ia9jTNFDrGLJvKWiCg9Q X7Z5aq3/YA7atu+Es7loUVQiUU9MpMJZPRb1N6ajhx1RctTG/h9wr/xaBv7r0i/3UFeZ cyfeXSYqmeJh7zchsrpYnYUTz2+IgNsqqMv7EweUVO9rCxgAZYRfC5ALojzO42G5s23q llXlwLdg66VG+o78neCEousDiqUErLpi2CTiSJHP9V6QCy4VtnUeREZDAp8VqZ4kBZTs JZY70cwtVZqVPwPooPk0cUEaFJThlKxbee4DgYOtCq3guTp3wTQU9HrLCzdUmxw93lkM zJWA== 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=Mp/cIkoM/PJoe1xE+vZz8Akslqiqmw4V33yfSOipkIM=; b=kHeny1qn3aszI3k37xnTsKkYDk+u5azOobGOp18NjQvHgRMHhU9o/Y11abwO1lY3V2 3wXSd3dyB65Gp/AVCx824VyCzBqNg/4vwf7ycyDMG/q4JYbzRGqDiKh6i7HTM6vsFA7Z KMBNJmQUF85cEVojYFBH7K/qMeAJcl1CDcSB/Vvj8UkBlrYo9cSM3C4IV0xx+eFKgv4G 4PiVa8LCtB1ycga+iPZ2ZdVhIh3NazIbHFZFTzHF53818RwcZTUItEFdxaKYXtTGpAP8 rYzOmGqh5bOzEkzXUHFio9PIQrqcpn2TjpHJWRO2Jc03W4N5P5HeF5wd9QW5qR/C4v66 +LSA== X-Gm-Message-State: AOAM530b81/XzncElxy2JmwIbyaOmd7SZEziVseEkjjAA/i1k2wHWt3o WEZhVoq4O4lTz78nTikSoDZKrA== X-Google-Smtp-Source: ABdhPJwnZW2vM5xZ8pHW/8UiJdhMd7V/9VZpyGv2ZvJzNuhG6y1r1LDgFqBHxjp81NpGVYA/fDhCzA== X-Received: by 2002:a17:902:b107:b0:15d:391c:5a72 with SMTP id q7-20020a170902b10700b0015d391c5a72mr8663088plr.46.1651074659116; Wed, 27 Apr 2022 08:50:59 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:50:58 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 05/11] perf c2c: Add dimensions for peer load operations Date: Wed, 27 Apr 2022 23:50:07 +0800 Message-Id: <20220427155013.1833222-6-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 is to add dimensions for peer load operations, include a dimension for the total statistics for metric 'ld_peer', and also add dimensions for the single cache line view. Same as HTIM metrics, this patch also adds the dimension for mean value for peer load operations. Signed-off-by: Leo Yan Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 93 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 88 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 9ef439610a2b..cef6513012e2 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -55,6 +55,7 @@ struct c2c_hists { struct compute_stats { struct stats lcl_hitm; struct stats rmt_hitm; + struct stats ld_peer; struct stats load; }; =20 @@ -154,6 +155,7 @@ 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.ld_peer); init_stats(&c2c_he->cstats.load); =20 return &c2c_he->he; @@ -253,6 +255,8 @@ static void compute_stats(struct c2c_hist_entry *c2c_he, update_stats(&cstats->rmt_hitm, weight); else if (stats->lcl_hitm) update_stats(&cstats->lcl_hitm, weight); + else if (stats->ld_peer) + update_stats(&cstats->ld_peer, weight); else if (stats->load) update_stats(&cstats->load, weight); } @@ -658,6 +662,7 @@ STAT_FN(ld_fbhit) STAT_FN(ld_l1hit) STAT_FN(ld_l2hit) STAT_FN(ld_llchit) +STAT_FN(ld_peer) STAT_FN(rmt_hit) =20 static uint64_t total_records(struct c2c_stats *stats) @@ -674,7 +679,8 @@ static uint64_t total_records(struct c2c_stats *stats) stats->ld_l1hit + stats->ld_l2hit + stats->ld_llchit + - stats->lcl_hitm; + stats->lcl_hitm + + stats->ld_peer; =20 total =3D ldcnt + stats->st_l1hit + @@ -730,7 +736,8 @@ static uint64_t total_loads(struct c2c_stats *stats) stats->ld_l1hit + stats->ld_l2hit + stats->ld_llchit + - stats->lcl_hitm; + stats->lcl_hitm + + stats->ld_peer; =20 return ldcnt; } @@ -899,6 +906,7 @@ static double percent_ ## __f(struct c2c_hist_entry *c2= c_he) \ =20 PERCENT_FN(rmt_hitm) PERCENT_FN(lcl_hitm) +PERCENT_FN(ld_peer) PERCENT_FN(st_l1hit) PERCENT_FN(st_l1miss) PERCENT_FN(st_anylvl) @@ -965,6 +973,37 @@ percent_lcl_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_= unused, return per_left - per_right; } =20 +static int +percent_ld_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, ld_peer); + char buf[10]; + + return scnprintf(hpp->buf, hpp->size, "%*s", width, PERC_STR(buf, per)); +} + +static int +percent_ld_peer_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) +{ + return percent_color(fmt, hpp, he, percent_ld_peer); +} + +static int64_t +percent_ld_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, ld_peer); + per_right =3D PERCENT(right, ld_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) @@ -1213,6 +1252,7 @@ __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_peer_entry, ld_peer); =20 static int cpucnt_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, @@ -1360,6 +1400,14 @@ static struct c2c_dimension dim_rmt_hitm =3D { .width =3D 7, }; =20 +static struct c2c_dimension dim_ld_peer =3D { + .header =3D HEADER_BOTH("Snoop", "Peer"), + .name =3D "ld_peer", + .cmp =3D ld_peer_cmp, + .entry =3D ld_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", @@ -1376,6 +1424,14 @@ static struct c2c_dimension dim_cl_lcl_hitm =3D { .width =3D 7, }; =20 +static struct c2c_dimension dim_cl_ld_peer =3D { + .header =3D HEADER_BOTH("Snoop", "Peer"), + .name =3D "cl_ld_peer", + .cmp =3D ld_peer_cmp, + .entry =3D ld_peer_entry, + .width =3D 7, +}; + static struct c2c_dimension dim_tot_stores =3D { .header =3D HEADER_BOTH("Total", "Stores"), .name =3D "tot_stores", @@ -1520,6 +1576,15 @@ static struct c2c_dimension dim_percent_lcl_hitm =3D= { .width =3D 7, }; =20 +static struct c2c_dimension dim_percent_ld_peer =3D { + .header =3D HEADER_BOTH("Snoop", "Peer"), + .name =3D "percent_ld_peer", + .cmp =3D percent_ld_peer_cmp, + .entry =3D percent_ld_peer_entry, + .color =3D percent_ld_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", @@ -1602,7 +1667,7 @@ static struct c2c_dimension dim_node =3D { }; =20 static struct c2c_dimension dim_mean_rmt =3D { - .header =3D HEADER_SPAN("---------- cycles ----------", "rmt hitm", 2), + .header =3D HEADER_SPAN("--------------- cycles ---------------", "rmt h= itm", 3), .name =3D "mean_rmt", .cmp =3D empty_cmp, .entry =3D mean_rmt_entry, @@ -1625,6 +1690,14 @@ static struct c2c_dimension dim_mean_load =3D { .width =3D 8, }; =20 +static struct c2c_dimension dim_mean_peer =3D { + .header =3D HEADER_SPAN_LOW("peer"), + .name =3D "mean_peer", + .cmp =3D empty_cmp, + .entry =3D mean_peer_entry, + .width =3D 8, +}; + static struct c2c_dimension dim_cpucnt =3D { .header =3D HEADER_BOTH("cpu", "cnt"), .name =3D "cpucnt", @@ -1672,8 +1745,10 @@ static struct c2c_dimension *dimensions[] =3D { &dim_tot_hitm, &dim_lcl_hitm, &dim_rmt_hitm, + &dim_ld_peer, &dim_cl_lcl_hitm, &dim_cl_rmt_hitm, + &dim_cl_ld_peer, &dim_tot_stores, &dim_stores_l1hit, &dim_stores_l1miss, @@ -1691,6 +1766,7 @@ static struct c2c_dimension *dimensions[] =3D { &dim_percent_hitm, &dim_percent_rmt_hitm, &dim_percent_lcl_hitm, + &dim_percent_ld_peer, &dim_percent_stores_l1hit, &dim_percent_stores_l1miss, &dim_percent_stores_anylvl, @@ -1704,6 +1780,7 @@ static struct c2c_dimension *dimensions[] =3D { &dim_mean_rmt, &dim_mean_lcl, &dim_mean_load, + &dim_mean_peer, &dim_cpucnt, &dim_srcline, &dim_dcacheline_idx, @@ -2192,6 +2269,7 @@ static void print_c2c__display_stats(FILE *out) fprintf(out, " Load L1D hit : %10d\n", stats->ld_l1= hit); fprintf(out, " Load L2D hit : %10d\n", stats->ld_l2= hit); fprintf(out, " Load LLC hit : %10d\n", stats->ld_ll= chit + stats->lcl_hitm); + fprintf(out, " Load HIT Peer : %10d\n", stats->ld_pe= er); fprintf(out, " Load Local HITM : %10d\n", stats->lcl_h= itm); fprintf(out, " Load Remote HITM : %10d\n", stats->rmt_h= itm); fprintf(out, " Load Remote HIT : %10d\n", stats->rmt_h= it); @@ -2229,6 +2307,7 @@ static void print_shared_cacheline_info(FILE *out) fprintf(out, " Fill Buffer Hits on shared lines : %10d\n", stats->ld_fb= hit); 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, " Load HITs on peer cache lines : %10d\n", stats->ld_pe= er); fprintf(out, " LLC hits on shared lines : %10d\n", stats->ld_ll= chit + stats->lcl_hitm); 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); @@ -2257,10 +2336,10 @@ static void print_cacheline(struct c2c_hists *c2c_h= ists, fprintf(out, "\n"); } =20 - fprintf(out, " ---------------------------------------------------------= -------------\n"); + fprintf(out, " ---------------------------------------------------------= ----------------------\n"); __hist_entry__snprintf(he_cl, &hpp, hpp_list); fprintf(out, "%s\n", bf); - fprintf(out, " ---------------------------------------------------------= -------------\n"); + fprintf(out, " ---------------------------------------------------------= ----------------------\n"); =20 hists__fprintf(&c2c_hists->hists, false, 0, 0, 0, out, false); } @@ -2275,6 +2354,7 @@ static void print_pareto(FILE *out) cl_output =3D "cl_num," "cl_rmt_hitm," "cl_lcl_hitm," + "cl_ld_peer," "cl_stores_l1hit," "cl_stores_l1miss," "cl_stores_anylvl," @@ -2727,6 +2807,7 @@ static int build_cl_output(char *cl_sort, bool no_sou= rce) c2c.use_stdio ? "cl_num_empty," : "", "percent_rmt_hitm," "percent_lcl_hitm," + "percent_ld_peer," "percent_stores_l1hit," "percent_stores_l1miss," "percent_stores_anylvl," @@ -2737,6 +2818,7 @@ static int build_cl_output(char *cl_sort, bool no_sou= rce) "mean_rmt," "mean_lcl," "mean_load," + "mean_peer," "tot_recs," "cpucnt,", add_sym ? "symbol," : "", @@ -2913,6 +2995,7 @@ static int perf_c2c__report(int argc, const char **ar= gv) "dcacheline_count," "percent_hitm," "tot_hitm,lcl_hitm,rmt_hitm," + "ld_peer," "tot_recs," "tot_loads," "tot_stores," --=20 2.25.1 From nobody Sun May 10 17:53:29 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 789E7C433FE for ; Wed, 27 Apr 2022 15:51:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240675AbiD0Py1 (ORCPT ); Wed, 27 Apr 2022 11:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240516AbiD0PyY (ORCPT ); Wed, 27 Apr 2022 11:54:24 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07623554A3 for ; Wed, 27 Apr 2022 08:51:06 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id gj17-20020a17090b109100b001d8b390f77bso5362238pjb.1 for ; Wed, 27 Apr 2022 08:51:06 -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=kGgnAx4Mmsc3hvOXFTE9LvmnzJdy1NstuQsMaBF2v6k=; b=jZfqziaMwqBPhEUX1dILp3PQ35E2S1QSqstePpWCc7dvBWpMrlLWfOny2P7bmpSsJn jkosoLF3BRYW5oz/sKefFJflfOiYeoBN/XA9nXmFT68amrM6xcrukpV24pLUPIkh9reE CqjyPGuhSa5c6KmmrKwT3b9sxnotpc/Kx/QUDbTqxR/uLh1GgetrOS+NaVDTJIhb84JP /3YV3jKhkVcb0DZNViZ2tRNHFi3YiR+Y8Kzv+kbUioqSajAYJINM7OPc9b4kOW4DATZY whkcubeaW+QSN98F/++IydC2/+kBjNYLqU2Bp31t40vY5IKb18j5aoR8HPwjr7dBveHD MpdA== 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=kGgnAx4Mmsc3hvOXFTE9LvmnzJdy1NstuQsMaBF2v6k=; b=FemLk2upvGG1nR+pVOXrZLGSoJDw2FgKX/n2IAUUpFSq7vnWuAl2ea5/+QFF1cEET0 YpsdyS3OZfZUvXdF5GwtXWz4Wm6LmI4fo1/h2lA7yvCyezt6IdPmbVa1aBOlkrl2vSKK Tq/GlfghPgM5GH51FGdu6IsrBXAuVtt+OXV1bvmhoSkgL+wwAykJI/OO9w7aM7azxqpW SZ9UvzEQEMcmXgkwLWANCXpEX/sECcCiAwNC3SYKEfZEw92lIw6Kl20lE2W2nghUhVRj ra6oA6H8b8/07+Kg+z/rGTVKUWs4dIQccl1wJRbcknS4ofITgoqOnD0mxboGwLcyWEUU TUKQ== X-Gm-Message-State: AOAM532dWyho9Z4aQChSqiHH6YJrL/prl2KclpvQVKtuNI6SA8Y+wTez 0eUNYsa28g10kYGNPAy1ZFcTmQ== X-Google-Smtp-Source: ABdhPJwdjCgONXFUE3FwPDhQL9ISzYMBoY57LwZ6Sz+XlLzu7O9ILkvuqgEpf8KlbS8gSXNC8l+l5A== X-Received: by 2002:a17:902:8501:b0:15c:ea4b:1398 with SMTP id bj1-20020a170902850100b0015cea4b1398mr22238822plb.109.1651074665565; Wed, 27 Apr 2022 08:51:05 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:51:05 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 06/11] perf c2c: Use explicit names for display macros Date: Wed, 27 Apr 2022 23:50:08 +0800 Message-Id: <20220427155013.1833222-7-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 --- 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 cef6513012e2..e4697cdbdfc2 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -114,16 +114,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 { @@ -807,15 +807,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: @@ -1181,15 +1181,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; @@ -1545,9 +1545,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 { @@ -2018,15 +2018,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; @@ -2049,13 +2049,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: @@ -2752,11 +2752,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; @@ -2846,9 +2846,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; @@ -3005,11 +3005,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 Sun May 10 17:53:29 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 8C6F0C433EF for ; Wed, 27 Apr 2022 15:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240542AbiD0Py3 (ORCPT ); Wed, 27 Apr 2022 11:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240536AbiD0Py0 (ORCPT ); Wed, 27 Apr 2022 11:54:26 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C875623D for ; Wed, 27 Apr 2022 08:51:12 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id g3so1781499pgg.3 for ; Wed, 27 Apr 2022 08:51:12 -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=p9i9E5A5TaNVDS+yFfJlo2eeNOGCG2bAN8opbE2Z014=; b=HddNpZlb/DCcNv3ysQq1o5FSoH7U2eDketgrcIjkkkoTJLTpu8n+OdbEboGuDeCydO rFVpv/xKY0nvqf3DkNJnuaWlJ4qteNbhoDYZVh04uFp7QbC/eOQci8VCC+kFyNgMjYGP XnvJ6SR6GatXrasBfcgzsOct0irV+BjMqcwjqBDU8YmOFtHbskl49aPM1HxHv4J/6rKX wJMx/KNSimGsNhZ3jd+xCkawmifYY+zbjjLvqHcuuQPruAWML6Wo7pRcTrWtkR1/i2d9 f14624i9kiEkITJGHxz3fLkqGLBUadmvJH+kyIpFWWhfpRaoPK+evJlp3nc+IoqBDEK+ x2Ug== 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=p9i9E5A5TaNVDS+yFfJlo2eeNOGCG2bAN8opbE2Z014=; b=JAllju0YnVUwyWNNHuL8A7YnSQ7GkzWTzItYet88B5v0+yOoC2XBrUq8QITteuT3Na PMLGm5iVEJJ6TatbJ9wM/7m/9PiPua4wdgwx16uxINFbQJSozrItQ0rfQDDynweuGcB0 AUq4wNH5J/TSCYAyWXAV7DAfDy1NF++MUWT+qvA3i7hYEZpLOaasQlsZyIMnBrBd0uZs jRdCpBXPsF8GTkTbJMSCjtAHPGW92U9+r+MTqje8xzKpM24t5D2B0WPP6V/iF7sNR0MA EwO8VkFBYPx0s/PG4oc8O51iLAJJcrnp9DAngLl/n7YmvSoJ/fWzNwrur1CE8YKRlgux B/7g== X-Gm-Message-State: AOAM530KdQEnH3E6yeko691/RCiO5eQR+AdrZrYUrd5Cx8jUQQF5xkn2 YypJf+Sot0GnqAf3WGx0A9IPww== X-Google-Smtp-Source: ABdhPJw/K08vgp2+NMDaA3AahO1OEHqqOy2NWAD3i/+fvFtrjerYyemKkENYgugZy9SficUpavWdkA== X-Received: by 2002:a63:f743:0:b0:3a6:6786:30b1 with SMTP id f3-20020a63f743000000b003a6678630b1mr23858400pgk.243.1651074671936; Wed, 27 Apr 2022 08:51:11 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:51:11 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 07/11] perf c2c: Rename dimension from 'percent_hitm' to 'percent_costly_snoop' Date: Wed, 27 Apr 2022 23:50:09 +0800 Message-Id: <20220427155013.1833222-8-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 --- 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 e4697cdbdfc2..b90696ebfbc9 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -794,7 +794,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; @@ -834,8 +834,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); @@ -843,20 +843,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; @@ -866,8 +866,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; } @@ -1544,17 +1544,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 @@ -1763,7 +1763,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_ld_peer, @@ -2665,7 +2665,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 + @@ -2993,7 +2993,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," "ld_peer," "tot_recs," --=20 2.25.1 From nobody Sun May 10 17:53:29 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 81AEDC4332F for ; Wed, 27 Apr 2022 15:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240702AbiD0Pyq (ORCPT ); Wed, 27 Apr 2022 11:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240786AbiD0Pym (ORCPT ); Wed, 27 Apr 2022 11:54:42 -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 9024A56200 for ; Wed, 27 Apr 2022 08:51:19 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id j6so1898485pfe.13 for ; Wed, 27 Apr 2022 08:51: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=dzfHiLB7CMSdbaalokwtZ2LWRfH0lNk/KKqxPTmoSuo=; b=h2hw3BAWYLo7gwsVCC3X5xKVrVECZ5NtG0dbvqGGzeGsdOD/9P4Gvrg48lm9oyEmXg CEWLgj+2SjFYmTy+H6RF0jwp4ssvdS/OA+aKeQV04IVAse5olhopXzKAth2xnT1LHllq a3fCsJrnbJkOc3srjd4djLwGlAomYHH2lz37KT19FJbbloqmaRImethqKa3Gcc/AaOm8 lZ6ILkEjIWkLCLXIwezktoQhwpg6l5NGOHH15y8bOOmnlDmu8Nv7ukWf2v9eqayK5SYj v7RBh0fZA9lbjC1nNNdGwyYiQGAMmfU35c5AS6e6bwvjFTCRQ1JiMPr72X5UFLHkGgLw km7g== 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=dzfHiLB7CMSdbaalokwtZ2LWRfH0lNk/KKqxPTmoSuo=; b=bWJ8QA7sBG5DB/Ijalb3Wy9Hn4Myl/ShXFcIyd9KBSrfqyhe/vYOGR0NHbkfwxIPYR AcMjDzgC6q4m2cKyWD0bZ7BFrsQtScTUujE57hoU6bipBz57kJVbC/jz7+jTvXP4szEI WVfTseQmrn/X7HPs0+DIfwjv0qOBBcVFmsVhZ2BXM/2fV5zy1bw9PzVlN0KZWnzr90SI c7a2zVg0SVrqOY3Vfk9Yd0hrhjMoi1t05SkLpkhULf6bR4Hch5hJLPUTIMA4xmQSiBO+ Zu3/6Axm5nPqptx29bONlqc3NPi0JG4wFAh02HTbO9KnNrdnOmqO+VhVx5fgvfPGS0wN iG4w== X-Gm-Message-State: AOAM532CC73xwbPfuLMRm6smQpQcoaLVJYsUlbqqCtNuHAt/F5l99ghX 7TJeuycOovgBB6IRJhAFmiBx6g== X-Google-Smtp-Source: ABdhPJwd0eP81/BAql0hYsxa5z5vyl3c+tnqi++MAivKD4G8MKe8VdUQPVnigq/v0blD2Kq/Maug+A== X-Received: by 2002:a63:e80a:0:b0:3c1:6c84:de53 with SMTP id s10-20020a63e80a000000b003c16c84de53mr460981pgh.224.1651074678368; Wed, 27 Apr 2022 08:51:18 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:51:18 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 08/11] perf c2c: Refactor node header Date: Wed, 27 Apr 2022 23:50:10 +0800 Message-Id: <20220427155013.1833222-9-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 --- 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 b90696ebfbc9..52542cfec80c 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1653,12 +1653,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, @@ -2146,9 +2140,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 Sun May 10 17:53:29 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 6E86EC433F5 for ; Wed, 27 Apr 2022 15:51:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240751AbiD0Pyx (ORCPT ); Wed, 27 Apr 2022 11:54:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240775AbiD0Pyo (ORCPT ); Wed, 27 Apr 2022 11:54:44 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E45C256434 for ; Wed, 27 Apr 2022 08:51:25 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id n18so1909034plg.5 for ; Wed, 27 Apr 2022 08:51:25 -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=PwioRwpBXHJPFuCDDjhxdp7i9AB4bRsQce4et2ttLIs=; b=NndiYdmSZgbsfSM5kR/FZhvdSw9OS0L5tZilRi7X/UmdS6H8I8P7eXSD4GNNcl6eM6 bCizSvanriTt9Efp4BzIAsTl4T8N7T2VHYYIJhHWfN1yateUm6z0DsyZmpewULX+f3hR uiFOaOglErC/vkqNYDmV31VGeHZVcjSTBnpsautpqd1iKOEve0btuSACYZbkCxPClPx1 WM29+4eFze/0+i7I2GzJpoZgbkiyR3bYN6YEeXRAoFfbEPL30uIDgknMXoOl3Ry6SmGA 4VhLGvl4w0H+J/E5cx7fXWSf8ZfzN8D8bM00d1lwAKXYDN1nOkHPQMBFs2fhqsoHbFwa rAdw== 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=PwioRwpBXHJPFuCDDjhxdp7i9AB4bRsQce4et2ttLIs=; b=InZz0wc+m2EE4V9BcAD20+7PIX+bqz0h3In/ILOH3YEQLRiJgyv5pvY9/103AR0ytf 0LzaF17LbiwH36QpuEMu64UertPUbwREMpXn1Y2axGpYy26WW2uD5pkRH0AbR0nNspg5 SqqLEQA8+qg42DYkgAdspSuO/BqylsspJI01l4qn6GsAMAtwWjR1RYiNClEwNrdqJeXG ryh27MhOGgTSLFwiU2+QyWaXrWmppPr10Qd7x32xbtM3GA3uhk7G16zsuJ5Z6hcJSMi0 FOJh3VxndWA+goZcGPAAdDnTKZgqGW+MJI9wxbutjZsuKG2NtvlxW8Hbx2t4N03LILaw 2erg== X-Gm-Message-State: AOAM533KbhsddY10O1ya2F2ZfWVLTIIrlFy60J+f8bKitJP93FuHot10 Yx6aq4jqB+QoaNxUhjOIGJ1R3Q== X-Google-Smtp-Source: ABdhPJwSyKazcItPxStRzVJz8HbMU42jtY6UxSe1m0xAGpWqLrAajsdd7pfs1A4vLPamZbAJmUsASw== X-Received: by 2002:a17:90b:1b50:b0:1d9:bc90:f7eb with SMTP id nv16-20020a17090b1b5000b001d9bc90f7ebmr8908833pjb.76.1651074684954; Wed, 27 Apr 2022 08:51:24 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:51:24 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 09/11] perf c2c: Sort on peer snooping for load operations Date: Wed, 27 Apr 2022 23:50:11 +0800 Message-Id: <20220427155013.1833222-10-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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" Except the existed three display options 'tot', 'rmt', 'lcl', 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 "ld_peer". As result, we can get the 'peer' display as below: # 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 ---------- Snoop ------- Load Hitm ---= ---- Snoop Total Total Total --------- Stores -------- ----- = Core Load Hit ----- - LLC Load Hit -- - RMT Load Hit -- --- Load Dram --= -- # Index Address Node PA cnt Peer Total LclHitm Rmt= Hitm Peer records Loads Stores L1Hit L1Miss Anylvl F= B L1 L2 LclHit LclHitm RmtHit RmtHitm Lcl R= mt # ..... .................. .... ...... ....... ....... ....... ...= .... ....... ....... ....... ....... ....... ....... ....... ......= . ....... ....... ........ ....... ........ ....... ........ ......= .. # 0 0xaaaac17d6000 N/A 0 100.00% 0 0 = 0 99 18851 18851 0 0 0 0 = 0 18752 0 0 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 # # ----- HITM ----- Snoop ------- Store Refs ------ --------- = Data address --------- ---= ------------ cycles --------------- Total cpu = Shared # Num RmtHitm LclHitm Peer L1 Hit L1 Miss Any Lvl = Offset Node PA cnt Pid Tid Code address rmt= hitm lcl hitm load peer records cnt Sym= bol Object Source:Line Node{cpus %peers %stores} # ..... ....... ....... ....... ....... ....... ....... ..........= ........ .... ...... ....... ................. .................. ...= ..... ........ ........ ........ ....... ........ ...................= ... ................ ............... .... # -----------------------------------------------------------------------= -------- 0 0 0 99 0 0 0 0xaaaa= c17d6000 -----------------------------------------------------------------------= -------- 0.00% 0.00% 3.03% 0.00% 0.00% 0.00% = 0x20 N/A 0 3603 3603:memstress 0xaaaac17c25ac = 0 0 41 376 9314 2 [.] 0x0000000000002= 5ac memstress memstress[25ac] 0{ 2 100.0% n/a} 0.00% 0.00% 3.03% 0.00% 0.00% 0.00% = 0x20 N/A 0 3603 3606:memstress 0xaaaac17c25ac = 0 0 44 375 9155 1 [.] 0x0000000000002= 5ac memstress memstress[25ac] 0{ 1 100.0% n/a} 0.00% 0.00% 48.48% 0.00% 0.00% 0.00% = 0x29 N/A 0 3603 3606:memstress 0xaaaac17c3e88 = 0 0 170 180 65 1 [.] 0x0000000000003= e88 memstress memstress[3e88] 0{ 1 100.0% n/a} 0.00% 0.00% 45.45% 0.00% 0.00% 0.00% = 0x29 N/A 0 3603 3603:memstress 0xaaaac17c3e88 = 0 0 175 180 70 2 [.] 0x0000000000003= e88 memstress memstress[3e88] 0{ 2 100.0% n/a} [...] Signed-off-by: Leo Yan Tested-by: Ali Saidi --- tools/perf/builtin-c2c.c | 63 +++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 52542cfec80c..bd4516e486c0 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -117,13 +117,15 @@ enum { DISPLAY_LCL_HITM, DISPLAY_RMT_HITM, DISPLAY_TOT_HITM, + DISPLAY_SNP_PEER, DISPLAY_MAX, }; =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", + [DISPLAY_SNP_PEER] =3D "Snoop Peers", }; =20 static const struct option c2c_options[] =3D { @@ -818,6 +820,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->ld_peer; + tot =3D total->ld_peer; + break; default: break; } @@ -1193,6 +1200,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->ld_peer, + c2c_he->stats.ld_peer); + break; default: break; } @@ -1548,6 +1559,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("Snoop", "Peer"), }; =20 static struct c2c_dimension dim_percent_costly_snoop =3D { @@ -2024,6 +2036,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.ld_peer, + stats->ld_peer); + break; default: break; } @@ -2052,6 +2068,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.ld_peer; default: break; } @@ -2141,7 +2159,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) @@ -2151,7 +2172,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; @@ -2225,13 +2249,15 @@ 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.ld_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 ((c2c.display !=3D DISPLAY_SNP_PEER && HAS_HITMS(c2c_he)) || + (c2c.display =3D=3D DISPLAY_SNP_PEER && HAS_PEER(c2c_he))) { c2c.shared_clines++; c2c_add_stats(&c2c.shared_clines_stats, &c2c_he->stats); } @@ -2406,7 +2432,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); } @@ -2563,7 +2589,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; @@ -2769,6 +2795,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; @@ -2850,6 +2878,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; @@ -2857,12 +2886,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 "ld_peer"; + + if (asprintf(&c2c.cl_resort, "offset,%s", sort_str) < 0) return -ENOMEM; =20 pr_debug("coalesce sort fields: %s\n", c2c.cl_sort); @@ -3023,6 +3056,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 "ld_peer"; =20 c2c_hists__reinit(&c2c.hists, output_str, sort_str); =20 --=20 2.25.1 From nobody Sun May 10 17:53:29 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 03CF8C4332F for ; Wed, 27 Apr 2022 15:51:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240343AbiD0Py4 (ORCPT ); Wed, 27 Apr 2022 11:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240740AbiD0Pys (ORCPT ); Wed, 27 Apr 2022 11:54:48 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B499755218 for ; Wed, 27 Apr 2022 08:51:31 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id j8-20020a17090a060800b001cd4fb60dccso2098577pjj.2 for ; Wed, 27 Apr 2022 08:51:31 -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=88bbCk2ERYh6ocqftQtDENMk2Clg/XqHfHpE0jpLddU=; b=s83lkLksIUw8ngM7Tyq59eA4QD43e/DNUuirs4yzjdEUPGyJd9J1EPuqIZYpEm/E2a /35yDMvpNeOSfLpENywPsTdCITlb5EYJlaER73sUmG/2V63kr9N6OA1w7atZdNpgEIOG nPcP7Ui8oeioiaoqkPQuE1qBwXwluoQLP1WxPXG6vbkTMSErVqFHBYbRO+vK4KTWq7Ob SKnuMAJX+SsD2vj+uMk/ew2OTxkGItXFlzbXBOIu2RqrrJ8r9iECZHgDyMYsdLsBF49b f0ohV4mcDTiOIIrnlFkOHV+015HCNvPJXPIjrKOgrooM8hn9B0USG41fDXP2m0KpFvyq hsdw== 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=88bbCk2ERYh6ocqftQtDENMk2Clg/XqHfHpE0jpLddU=; b=B32cL6OcBXAbf/c9AsFdMJp+XZODkqopBskYuhNwStNWrzIah2BHCl1zFX9G7zReYB 6/xfEnIUIW/WRLILKZUEPBFc6jughw2Ds0lFPM2Ty6wDoLUW17ps2PAoXzb2ZVM6tfg0 TgT5JD5Q2AD8GqzXvKIehqYCLf5nKrWWbTiAseqn802Irx06Q45xRy2piGaZzDu/IIJc B0o2/vEZRLWabww/bJ32DHNoNpVewoL3dUK4HXRLhDDxPLdgsfsEaWmydI4JeqCYijAv HcD7HJlnAb7tg7cYzZsIXYziLojCeNxXfZkJ3DIOz4tGtZhyGS77DxlYAfgMsybG01Rw ugeg== X-Gm-Message-State: AOAM531dOx8Fqro0RJFTaxbfnjRy/fJO8F/jJUBH3FTEzLt/wWFcqDpG tibGb7WKgy01swpy8yc8jfgl8g== X-Google-Smtp-Source: ABdhPJwYE1C1HRFhiAteWQw5NTe3sYOsMFFZ2w/7k6RfFUYNlXJpoH4zgI18iSg0W8q4Yw/eEx1ewA== X-Received: by 2002:a17:90b:3145:b0:1d9:ab18:910e with SMTP id ip5-20020a17090b314500b001d9ab18910emr10949105pjb.57.1651074690736; Wed, 27 Apr 2022 08:51:30 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:51:30 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 10/11] perf c2c: Update documentation for new display option 'peer' Date: Wed, 27 Apr 2022 23:50:12 +0800 Message-Id: <20220427155013.1833222-11-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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 Tested-by: Ali Saidi --- tools/perf/Documentation/perf-c2c.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentati= on/perf-c2c.txt index b39e3f3df272..aa560ce1a192 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 (For display with HITM types) - cacheline percentage of all Remote/Local HITM accesses =20 + Snoop Peer (For display with peer type) + - cacheline percentage of peer access + LLC Load Hitm - Total, LclHitm, RmtHitm - count of Total/Local/Remote load HITMs =20 + Snoop Peer + - count of peer access + Total records - sum of all cachelines accesses =20 @@ -211,6 +218,9 @@ For each offset in the 2) list we display following dat= a: HITM - Rmt, Lcl - % of Remote/Local HITM accesses for given offset within cacheline =20 + Snoop Peer + - % of peer accesses for given offset within cacheline + Store Refs - L1 Hit, L1 Miss, Any Lvl - % of store accesses that hit L1, missed L1 and any cache level for giv= en offset within cacheline @@ -227,8 +237,9 @@ For each offset in the 2) list we display following dat= a: Code address - code address responsible for the accesses =20 - cycles - rmt hitm, lcl hitm, load - - sum of cycles for given accesses - Remote/Local HITM and generic load + cycles - rmt hitm, lcl hitm, load, peer + - sum of cycles for given accesses - Remote/Local HITM, generic load a= nd + peer access =20 cpu cnt - number of cpus that participated on the access @@ -251,7 +262,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} (For display with HITM types) + Node{cpus %peers %stores} (For display with "peer" type) - node IDs with list of affected CPUs in following format: Node{cpu list} =20 --=20 2.25.1 From nobody Sun May 10 17:53:29 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 44287C433F5 for ; Wed, 27 Apr 2022 15:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240816AbiD0PzM (ORCPT ); Wed, 27 Apr 2022 11:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240844AbiD0PzC (ORCPT ); Wed, 27 Apr 2022 11:55:02 -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 69FD95520A for ; Wed, 27 Apr 2022 08:51:37 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id h12so1884526plf.12 for ; Wed, 27 Apr 2022 08:51:37 -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=/vcydkgfwulbRdhsxwG26aGxHp6JHi+EQHDHh6atTeA=; b=fN74pyEweV80SDfA8wca3NLHZxPoe0yH0glecZ2Atg//g8BQ5ztUXkT6gJ3oIcqUzK Qp86QY1rL6mAUyRGPB9FvMG3g2RbR5TG41WnweAiRqqCCEFleSki/9dKSBvZ/1J0bpS+ n3nHNuxKHKu49Py8xK7sxs7fjhz7wQbkfBnUXjmC3P3y88N5YvPSrJIMIIXYzE1vpRqK aUzmdlhfepQkk32i+Fsd8MhPQAtLxxVFn/oBOWcAB/O3lOy8ewaBHFBpaS1gk7BLzGk1 SR12K5AdIo2Qo4bK/CPmRxJedKhDOb6ptd6zTtRendbV2X62P766VlLa0PydKWqZgW72 IaVw== 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=/vcydkgfwulbRdhsxwG26aGxHp6JHi+EQHDHh6atTeA=; b=C5fsWIlmphXw6CiTTt+jYSp1L7x17MZSeiRbLZIRmSgu3TDxg8BUT3EEeo82MEh/dK kaa7+Y9BHqh4x9mhGH4saUJCrdBtDlMvHSpofOwXGF1hPCPznnfrJRC+j9uG/mwUsodd i2DJJvDzlMVr29C9AfWnW326KePn2GTB67EOouXKqZF78r/1rx6QH3iznORctBwFcp9J 95X/UGz03Af6u406ujtlAcRM5pPKjF8d/dBJeiGIi1FU6DsaS/o1I8JkFzh0cM7ABGff hcHtA7sb52WKwk4fU5hOFsHZ8pfOZk2sBe0nVu/kGq3ENks7c7dFyXf78cBwYAQ0z/cA BnNg== X-Gm-Message-State: AOAM532ESTrtIFNr/75BVFcl2DgT2zMf1BnIl8HHdC+Oq6FFnmrPHb5X i0XM6Bghu1Xi/1YRId8He+oYQw== X-Google-Smtp-Source: ABdhPJxwW+VNwWrLgfTZFjDrwhfhezzHfN0FF+xjbEz0bjR7HP4PF9HzXsYU+tRWXR0wPggdekjaDA== X-Received: by 2002:a17:90a:488c:b0:1c7:b62e:8e8c with SMTP id b12-20020a17090a488c00b001c7b62e8e8cmr44056171pjh.157.1651074696628; Wed, 27 Apr 2022 08:51:36 -0700 (PDT) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id v65-20020a626144000000b0050a839e490bsm19164127pfb.185.2022.04.27.08.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 08:51:36 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Alyssa Ross , Like Xu , Kajol Jain , Li Huafei , Ali Saidi , German Gomez , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 11/11] perf c2c: Use 'peer' as default display for Arm64 Date: Wed, 27 Apr 2022 23:50:13 +0800 Message-Id: <20220427155013.1833222-12-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427155013.1833222-1-leo.yan@linaro.org> References: <20220427155013.1833222-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, so use 'peer' as default if user doesn't specify display type; for other arches, it still uses 'tot' as default display type if user doesn't specify it. Suggested-by: Ali Saidi Signed-off-by: Leo Yan --- tools/perf/builtin-c2c.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index bd4516e486c0..c944631fc505 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2787,7 +2787,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; @@ -2973,9 +2973,6 @@ static int perf_c2c__report(int argc, const char **ar= gv) data.path =3D input_name; data.force =3D symbol_conf.force; =20 - err =3D setup_display(display); - if (err) - goto out; =20 err =3D setup_coalesce(coalesce, no_source); if (err) { @@ -2996,6 +2993,22 @@ static int perf_c2c__report(int argc, const char **a= rgv) goto out; } =20 + /* + * 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_session; + session->itrace_synth_opts =3D &itrace_synth_opts; =20 err =3D setup_nodes(session); --=20 2.25.1