Commit d9d5d767 authored by Kan Liang's avatar Kan Liang Committed by Arnaldo Carvalho de Melo

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: default avatarKan 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a054c298
...@@ -2134,6 +2134,8 @@ static void print_c2c__display_stats(FILE *out) ...@@ -2134,6 +2134,8 @@ static void print_c2c__display_stats(FILE *out)
fprintf(out, " Load MESI State Exclusive : %10d\n", stats->ld_excl); fprintf(out, " Load MESI State Exclusive : %10d\n", stats->ld_excl);
fprintf(out, " Load MESI State Shared : %10d\n", stats->ld_shared); fprintf(out, " Load MESI State Shared : %10d\n", stats->ld_shared);
fprintf(out, " Load LLC Misses : %10d\n", llc_misses); fprintf(out, " Load LLC Misses : %10d\n", llc_misses);
fprintf(out, " Load access blocked by data : %10d\n", stats->blk_data);
fprintf(out, " Load access blocked by address : %10d\n", stats->blk_addr);
fprintf(out, " LLC Misses to Local DRAM : %10.1f%%\n", ((double)stats->lcl_dram/(double)llc_misses) * 100.); fprintf(out, " LLC Misses to Local DRAM : %10.1f%%\n", ((double)stats->lcl_dram/(double)llc_misses) * 100.);
fprintf(out, " LLC Misses to Remote DRAM : %10.1f%%\n", ((double)stats->rmt_dram/(double)llc_misses) * 100.); fprintf(out, " LLC Misses to Remote DRAM : %10.1f%%\n", ((double)stats->rmt_dram/(double)llc_misses) * 100.);
fprintf(out, " LLC Misses to Remote cache (HIT) : %10.1f%%\n", ((double)stats->rmt_hit /(double)llc_misses) * 100.); fprintf(out, " LLC Misses to Remote cache (HIT) : %10.1f%%\n", ((double)stats->rmt_hit /(double)llc_misses) * 100.);
...@@ -2162,6 +2164,7 @@ static void print_shared_cacheline_info(FILE *out) ...@@ -2162,6 +2164,7 @@ static void print_shared_cacheline_info(FILE *out)
fprintf(out, " L2D hits on shared lines : %10d\n", stats->ld_l2hit); fprintf(out, " L2D hits on shared lines : %10d\n", stats->ld_l2hit);
fprintf(out, " LLC hits on shared lines : %10d\n", stats->ld_llchit + stats->lcl_hitm); fprintf(out, " LLC hits on shared lines : %10d\n", stats->ld_llchit + stats->lcl_hitm);
fprintf(out, " Locked Access on shared lines : %10d\n", stats->locks); fprintf(out, " Locked Access on shared lines : %10d\n", stats->locks);
fprintf(out, " Blocked Access on shared lines : %10d\n", stats->blk_data + stats->blk_addr);
fprintf(out, " Store HITs on shared lines : %10d\n", stats->store); fprintf(out, " Store HITs on shared lines : %10d\n", stats->store);
fprintf(out, " Store L1D hits on shared lines : %10d\n", stats->st_l1hit); fprintf(out, " Store L1D hits on shared lines : %10d\n", stats->st_l1hit);
fprintf(out, " Total Merged records : %10d\n", hitm_cnt + stats->store); fprintf(out, " Total Merged records : %10d\n", hitm_cnt + stats->store);
......
...@@ -385,6 +385,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi) ...@@ -385,6 +385,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
u64 lvl = data_src->mem_lvl; u64 lvl = data_src->mem_lvl;
u64 snoop = data_src->mem_snoop; u64 snoop = data_src->mem_snoop;
u64 lock = data_src->mem_lock; u64 lock = data_src->mem_lock;
u64 blk = data_src->mem_blk;
/* /*
* Skylake might report unknown remote level via this * Skylake might report unknown remote level via this
* bit, consider it when evaluating remote HITMs. * bit, consider it when evaluating remote HITMs.
...@@ -404,6 +405,9 @@ do { \ ...@@ -404,6 +405,9 @@ do { \
if (lock & P(LOCK, LOCKED)) stats->locks++; if (lock & P(LOCK, LOCKED)) stats->locks++;
if (blk & P(BLK, DATA)) stats->blk_data++;
if (blk & P(BLK, ADDR)) stats->blk_addr++;
if (op & P(OP, LOAD)) { if (op & P(OP, LOAD)) {
/* load */ /* load */
stats->load++; stats->load++;
...@@ -515,6 +519,8 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add) ...@@ -515,6 +519,8 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add)
stats->rmt_hit += add->rmt_hit; stats->rmt_hit += add->rmt_hit;
stats->lcl_dram += add->lcl_dram; stats->lcl_dram += add->lcl_dram;
stats->rmt_dram += add->rmt_dram; stats->rmt_dram += add->rmt_dram;
stats->blk_data += add->blk_data;
stats->blk_addr += add->blk_addr;
stats->nomap += add->nomap; stats->nomap += add->nomap;
stats->noparse += add->noparse; stats->noparse += add->noparse;
} }
...@@ -79,6 +79,8 @@ struct c2c_stats { ...@@ -79,6 +79,8 @@ struct c2c_stats {
u32 rmt_hit; /* count of loads with remote hit clean; */ u32 rmt_hit; /* count of loads with remote hit clean; */
u32 lcl_dram; /* count of loads miss to local DRAM */ u32 lcl_dram; /* count of loads miss to local DRAM */
u32 rmt_dram; /* count of loads miss to remote DRAM */ u32 rmt_dram; /* count of loads miss to remote DRAM */
u32 blk_data; /* count of loads blocked by data */
u32 blk_addr; /* count of loads blocked by address conflict */
u32 nomap; /* count of load/stores with no phys adrs */ u32 nomap; /* count of load/stores with no phys adrs */
u32 noparse; /* count of unparsable data sources */ u32 noparse; /* count of unparsable data sources */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment