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

perf c2c: Support data block and addr block

'perf c2c' is also a memory profiling tool. Apply the two new data
source fields to 'perf c2c' as well.

Extend 'perf c2c' to display the number of loads which blocked by data or
address conflict.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/1612296553-21962-5-git-send-email-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Kan Liang and committed by
Arnaldo Carvalho de Melo
d9d5d767 a054c298

+11
+3
tools/perf/builtin-c2c.c
··· 2134 2134 fprintf(out, " Load MESI State Exclusive : %10d\n", stats->ld_excl); 2135 2135 fprintf(out, " Load MESI State Shared : %10d\n", stats->ld_shared); 2136 2136 fprintf(out, " Load LLC Misses : %10d\n", llc_misses); 2137 + fprintf(out, " Load access blocked by data : %10d\n", stats->blk_data); 2138 + fprintf(out, " Load access blocked by address : %10d\n", stats->blk_addr); 2137 2139 fprintf(out, " LLC Misses to Local DRAM : %10.1f%%\n", ((double)stats->lcl_dram/(double)llc_misses) * 100.); 2138 2140 fprintf(out, " LLC Misses to Remote DRAM : %10.1f%%\n", ((double)stats->rmt_dram/(double)llc_misses) * 100.); 2139 2141 fprintf(out, " LLC Misses to Remote cache (HIT) : %10.1f%%\n", ((double)stats->rmt_hit /(double)llc_misses) * 100.); ··· 2164 2162 fprintf(out, " L2D hits on shared lines : %10d\n", stats->ld_l2hit); 2165 2163 fprintf(out, " LLC hits on shared lines : %10d\n", stats->ld_llchit + stats->lcl_hitm); 2166 2164 fprintf(out, " Locked Access on shared lines : %10d\n", stats->locks); 2165 + fprintf(out, " Blocked Access on shared lines : %10d\n", stats->blk_data + stats->blk_addr); 2167 2166 fprintf(out, " Store HITs on shared lines : %10d\n", stats->store); 2168 2167 fprintf(out, " Store L1D hits on shared lines : %10d\n", stats->st_l1hit); 2169 2168 fprintf(out, " Total Merged records : %10d\n", hitm_cnt + stats->store);
+6
tools/perf/util/mem-events.c
··· 385 385 u64 lvl = data_src->mem_lvl; 386 386 u64 snoop = data_src->mem_snoop; 387 387 u64 lock = data_src->mem_lock; 388 + u64 blk = data_src->mem_blk; 388 389 /* 389 390 * Skylake might report unknown remote level via this 390 391 * bit, consider it when evaluating remote HITMs. ··· 404 403 stats->nr_entries++; 405 404 406 405 if (lock & P(LOCK, LOCKED)) stats->locks++; 406 + 407 + if (blk & P(BLK, DATA)) stats->blk_data++; 408 + if (blk & P(BLK, ADDR)) stats->blk_addr++; 407 409 408 410 if (op & P(OP, LOAD)) { 409 411 /* load */ ··· 519 515 stats->rmt_hit += add->rmt_hit; 520 516 stats->lcl_dram += add->lcl_dram; 521 517 stats->rmt_dram += add->rmt_dram; 518 + stats->blk_data += add->blk_data; 519 + stats->blk_addr += add->blk_addr; 522 520 stats->nomap += add->nomap; 523 521 stats->noparse += add->noparse; 524 522 }
+2
tools/perf/util/mem-events.h
··· 79 79 u32 rmt_hit; /* count of loads with remote hit clean; */ 80 80 u32 lcl_dram; /* count of loads miss to local DRAM */ 81 81 u32 rmt_dram; /* count of loads miss to remote DRAM */ 82 + u32 blk_data; /* count of loads blocked by data */ 83 + u32 blk_addr; /* count of loads blocked by address conflict */ 82 84 u32 nomap; /* count of load/stores with no phys adrs */ 83 85 u32 noparse; /* count of unparsable data sources */ 84 86 };