Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
dba8ab93 b7ac4f9f

+11 -2
+10 -2
tools/perf/util/mem-events.c
··· 280 280 u64 lock = data_src->mem_lock; 281 281 int err = 0; 282 282 283 + #define HITM_INC(__f) \ 284 + do { \ 285 + stats->__f++; \ 286 + stats->tot_hitm++; \ 287 + } while (0) 288 + 283 289 #define P(a, b) PERF_MEM_##a##_##b 284 290 285 291 stats->nr_entries++; ··· 309 303 if (lvl & P(LVL, L2 )) stats->ld_l2hit++; 310 304 if (lvl & P(LVL, L3 )) { 311 305 if (snoop & P(SNOOP, HITM)) 312 - stats->lcl_hitm++; 306 + HITM_INC(lcl_hitm); 313 307 else 314 308 stats->ld_llchit++; 315 309 } ··· 337 331 if (snoop & P(SNOOP, HIT)) 338 332 stats->rmt_hit++; 339 333 else if (snoop & P(SNOOP, HITM)) 340 - stats->rmt_hitm++; 334 + HITM_INC(rmt_hitm); 341 335 } 342 336 343 337 if ((lvl & P(LVL, MISS))) ··· 370 364 } 371 365 372 366 #undef P 367 + #undef HITM_INC 373 368 return err; 374 369 } 375 370 ··· 397 390 stats->ld_llchit += add->ld_llchit; 398 391 stats->lcl_hitm += add->lcl_hitm; 399 392 stats->rmt_hitm += add->rmt_hitm; 393 + stats->tot_hitm += add->tot_hitm; 400 394 stats->rmt_hit += add->rmt_hit; 401 395 stats->lcl_dram += add->lcl_dram; 402 396 stats->rmt_dram += add->rmt_dram;
+1
tools/perf/util/mem-events.h
··· 59 59 u32 ld_llchit; /* count of loads that hit LLC */ 60 60 u32 lcl_hitm; /* count of loads with local HITM */ 61 61 u32 rmt_hitm; /* count of loads with remote HITM */ 62 + u32 tot_hitm; /* count of loads with local and remote HITM */ 62 63 u32 rmt_hit; /* count of loads with remote hit clean; */ 63 64 u32 lcl_dram; /* count of loads miss to local DRAM */ 64 65 u32 rmt_dram; /* count of loads miss to remote DRAM */