Skip to content

Commit 91d933c

Browse files
Leo Yanacmel
authored andcommitted
perf c2c: Add metrics "RMT Load Hit"
The metrics "LLC Ld Miss" and "Load Dram" overlap with each other for accouting items: "LLC Ld Miss" = "lcl_dram" + "rmt_dram" + "rmt_hit" + "rmt_hitm" "Load Dram" = "lcl_dram" + "rmt_dram" Furthermore, the metrics "LLC Ld Miss" is not directive to show statistics due to it contains summary value and cannot give out breakdown details. For this reason, add a new metrics "RMT Load Hit" which is used to present the remote cache hit; it contains two items: "RMT Load Hit" = remote hit ("rmt_hit") + remote hitm ("rmt_hitm") As result, the metrics "LLC Ld Miss" is perfectly divided into two metrics "RMT Load Hit" and "Load Dram". It's not necessary to keep metrics "LLC Ld Miss", so remove it. Before: # ----------- Cacheline ---------- Tot ------- Load Hitm ------- Total Total Total ---- Stores ---- ----- Core Load Hit ----- - LLC Load Hit -- LLC --- Load Dram ---- # Index Address Node PA cnt Hitm Total LclHitm RmtHitm records Loads Stores L1Hit L1Miss FB L1 L2 LclHit LclHitm Ld Miss Lcl Rmt # ..... .................. .... ...... ....... ....... ....... ....... ....... ....... ....... ....... ....... ....... ....... ....... ........ ....... ....... ........ ........ # 0 0x55f07d580100 0 1499 85.89% 481 481 0 7243 3879 3364 2599 765 548 2615 66 169 481 0 0 0 1 0x55f07d580080 0 1 13.93% 78 78 0 664 664 0 0 0 187 361 27 11 78 0 0 0 2 0x55f07d5800c0 0 1 0.18% 1 1 0 405 405 0 0 0 131 0 10 263 1 0 0 0 After: # ----------- Cacheline ---------- Tot ------- Load Hitm ------- Total Total Total ---- Stores ---- ----- Core Load Hit ----- - LLC Load Hit -- - RMT Load Hit -- --- Load Dram ---- # Index Address Node PA cnt Hitm Total LclHitm RmtHitm records Loads Stores L1Hit L1Miss FB L1 L2 LclHit LclHitm RmtHit RmtHitm Lcl Rmt # ..... .................. .... ...... ....... ....... ....... ....... ....... ....... ....... ....... ....... ....... ....... ....... ........ ....... ........ ....... ........ ........ # 0 0x55f07d580100 0 1499 85.89% 481 481 0 7243 3879 3364 2599 765 548 2615 66 169 481 0 0 0 0 1 0x55f07d580080 0 1 13.93% 78 78 0 664 664 0 0 0 187 361 27 11 78 0 0 0 0 2 0x55f07d5800c0 0 1 0.18% 1 1 0 405 405 0 0 0 131 0 10 263 1 0 0 0 0 Signed-off-by: Leo Yan <leo.yan@linaro.org> Tested-by: Joe Mario <jmario@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: https://lore.kernel.org/r/20201014050921.5591-9-leo.yan@linaro.org
1 parent 77c1586 commit 91d933c

1 file changed

Lines changed: 2 additions & 50 deletions

File tree

tools/perf/builtin-c2c.c

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -652,45 +652,6 @@ STAT_FN(ld_l2hit)
652652
STAT_FN(ld_llchit)
653653
STAT_FN(rmt_hit)
654654

655-
static uint64_t llc_miss(struct c2c_stats *stats)
656-
{
657-
uint64_t llcmiss;
658-
659-
llcmiss = stats->lcl_dram +
660-
stats->rmt_dram +
661-
stats->rmt_hitm +
662-
stats->rmt_hit;
663-
664-
return llcmiss;
665-
}
666-
667-
static int
668-
ld_llcmiss_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
669-
struct hist_entry *he)
670-
{
671-
struct c2c_hist_entry *c2c_he;
672-
int width = c2c_width(fmt, hpp, he->hists);
673-
674-
c2c_he = container_of(he, struct c2c_hist_entry, he);
675-
676-
return scnprintf(hpp->buf, hpp->size, "%*lu", width,
677-
llc_miss(&c2c_he->stats));
678-
}
679-
680-
static int64_t
681-
ld_llcmiss_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
682-
struct hist_entry *left, struct hist_entry *right)
683-
{
684-
struct c2c_hist_entry *c2c_left;
685-
struct c2c_hist_entry *c2c_right;
686-
687-
c2c_left = container_of(left, struct c2c_hist_entry, he);
688-
c2c_right = container_of(right, struct c2c_hist_entry, he);
689-
690-
return (uint64_t) llc_miss(&c2c_left->stats) -
691-
(uint64_t) llc_miss(&c2c_right->stats);
692-
}
693-
694655
static uint64_t total_records(struct c2c_stats *stats)
695656
{
696657
uint64_t lclmiss, ldcnt, total;
@@ -1440,21 +1401,13 @@ static struct c2c_dimension dim_ld_llchit = {
14401401
};
14411402

14421403
static struct c2c_dimension dim_ld_rmthit = {
1443-
.header = HEADER_SPAN_LOW("Rmt"),
1404+
.header = HEADER_SPAN("- RMT Load Hit --", "RmtHit", 1),
14441405
.name = "ld_rmthit",
14451406
.cmp = rmt_hit_cmp,
14461407
.entry = rmt_hit_entry,
14471408
.width = 8,
14481409
};
14491410

1450-
static struct c2c_dimension dim_ld_llcmiss = {
1451-
.header = HEADER_BOTH("LLC", "Ld Miss"),
1452-
.name = "ld_llcmiss",
1453-
.cmp = ld_llcmiss_cmp,
1454-
.entry = ld_llcmiss_entry,
1455-
.width = 7,
1456-
};
1457-
14581411
static struct c2c_dimension dim_tot_recs = {
14591412
.header = HEADER_BOTH("Total", "records"),
14601413
.name = "tot_recs",
@@ -1658,7 +1611,6 @@ static struct c2c_dimension *dimensions[] = {
16581611
&dim_ld_l2hit,
16591612
&dim_ld_llchit,
16601613
&dim_ld_rmthit,
1661-
&dim_ld_llcmiss,
16621614
&dim_tot_recs,
16631615
&dim_tot_loads,
16641616
&dim_percent_hitm,
@@ -2854,7 +2806,7 @@ static int perf_c2c__report(int argc, const char **argv)
28542806
"stores_l1hit,stores_l1miss,"
28552807
"ld_fbhit,ld_l1hit,ld_l2hit,"
28562808
"ld_lclhit,lcl_hitm,"
2857-
"ld_llcmiss,"
2809+
"ld_rmthit,rmt_hitm,"
28582810
"dram_lcl,dram_rmt",
28592811
c2c.display == DISPLAY_TOT ? "tot_hitm" :
28602812
c2c.display == DISPLAY_LCL ? "lcl_hitm" : "rmt_hitm"

0 commit comments

Comments
 (0)