aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-11-21 16:33:29 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-11-23 08:44:05 -0500
commitdba8ab93792a3a864ff741efe435b2ecbdfb66b1 (patch)
tree58eaabcb4ef4a00444f9680766db4bca8f4ca545 /tools
parentb7ac4f9f3b2532b4e3dcd3d402c405c46a8ec811 (diff)
perf c2c report: Add struct c2c_stats::tot_hitm field
Count total number of HITMs in a special field. This will ease up addition of total HITM sorting into c2c report in the following patch. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Joe Mario <jmario@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1479764011-10732-5-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/mem-events.c12
-rw-r--r--tools/perf/util/mem-events.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index e50773286ef6..1d4ab53c60ca 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -280,6 +280,12 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
280 u64 lock = data_src->mem_lock; 280 u64 lock = data_src->mem_lock;
281 int err = 0; 281 int err = 0;
282 282
283#define HITM_INC(__f) \
284do { \
285 stats->__f++; \
286 stats->tot_hitm++; \
287} while (0)
288
283#define P(a, b) PERF_MEM_##a##_##b 289#define P(a, b) PERF_MEM_##a##_##b
284 290
285 stats->nr_entries++; 291 stats->nr_entries++;
@@ -303,7 +309,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
303 if (lvl & P(LVL, L2 )) stats->ld_l2hit++; 309 if (lvl & P(LVL, L2 )) stats->ld_l2hit++;
304 if (lvl & P(LVL, L3 )) { 310 if (lvl & P(LVL, L3 )) {
305 if (snoop & P(SNOOP, HITM)) 311 if (snoop & P(SNOOP, HITM))
306 stats->lcl_hitm++; 312 HITM_INC(lcl_hitm);
307 else 313 else
308 stats->ld_llchit++; 314 stats->ld_llchit++;
309 } 315 }
@@ -331,7 +337,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
331 if (snoop & P(SNOOP, HIT)) 337 if (snoop & P(SNOOP, HIT))
332 stats->rmt_hit++; 338 stats->rmt_hit++;
333 else if (snoop & P(SNOOP, HITM)) 339 else if (snoop & P(SNOOP, HITM))
334 stats->rmt_hitm++; 340 HITM_INC(rmt_hitm);
335 } 341 }
336 342
337 if ((lvl & P(LVL, MISS))) 343 if ((lvl & P(LVL, MISS)))
@@ -364,6 +370,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
364 } 370 }
365 371
366#undef P 372#undef P
373#undef HITM_INC
367 return err; 374 return err;
368} 375}
369 376
@@ -390,6 +397,7 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add)
390 stats->ld_llchit += add->ld_llchit; 397 stats->ld_llchit += add->ld_llchit;
391 stats->lcl_hitm += add->lcl_hitm; 398 stats->lcl_hitm += add->lcl_hitm;
392 stats->rmt_hitm += add->rmt_hitm; 399 stats->rmt_hitm += add->rmt_hitm;
400 stats->tot_hitm += add->tot_hitm;
393 stats->rmt_hit += add->rmt_hit; 401 stats->rmt_hit += add->rmt_hit;
394 stats->lcl_dram += add->lcl_dram; 402 stats->lcl_dram += add->lcl_dram;
395 stats->rmt_dram += add->rmt_dram; 403 stats->rmt_dram += add->rmt_dram;
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
index faf80403b519..40f72ee4f42a 100644
--- a/tools/perf/util/mem-events.h
+++ b/tools/perf/util/mem-events.h
@@ -59,6 +59,7 @@ struct c2c_stats {
59 u32 ld_llchit; /* count of loads that hit LLC */ 59 u32 ld_llchit; /* count of loads that hit LLC */
60 u32 lcl_hitm; /* count of loads with local HITM */ 60 u32 lcl_hitm; /* count of loads with local HITM */
61 u32 rmt_hitm; /* count of loads with remote HITM */ 61 u32 rmt_hitm; /* count of loads with remote HITM */
62 u32 tot_hitm; /* count of loads with local and remote HITM */
62 u32 rmt_hit; /* count of loads with remote hit clean; */ 63 u32 rmt_hit; /* count of loads with remote hit clean; */
63 u32 lcl_dram; /* count of loads miss to local DRAM */ 64 u32 lcl_dram; /* count of loads miss to local DRAM */
64 u32 rmt_dram; /* count of loads miss to remote DRAM */ 65 u32 rmt_dram; /* count of loads miss to remote DRAM */