15 #include <linux/compiler.h> 16 #include <linux/kernel.h> 17 #include <linux/stringify.h> 19 #include <sys/param.h> 23 #include <subcmd/parse-options.h> 44 struct stats lcl_hitm;
45 struct stats rmt_hitm;
116 OPT_INCR(
'v',
"verbose", &
verbose,
"be more verbose (show counter open errors, etc)"),
126 c2c_he =
zalloc(size +
sizeof(*c2c_he));
173 int nr_header_lines);
186 return c2c_he->
hists;
204 if (WARN_ONCE(sample->
cpu == (
unsigned int) -1,
205 "WARNING: no sample cpu value"))
222 if (WARN_ONCE(node < 0,
"WARNING: failed to find node\n"))
225 set_bit(node, c2c_he->
nodeset);
243 else if (stats->
load)
262 pr_debug(
"problem processing %d event, skipping it.\n",
310 int cpu = sample->
cpu == (
unsigned int) -1 ? 0 : sample->
cpu;
359 .ordered_events =
true,
360 .ordering_requires_timestamps =
true,
365 "perf c2c {record|report}",
376 #define C2C_HEADER_MAX 2 404 #define SYMBOL_WIDTH 30 420 struct perf_hpp *hpp __maybe_unused,
426 c2c_fmt = container_of(fmt,
struct c2c_fmt, fmt);
437 struct hists *hists,
int line,
int *span)
442 const char *text = NULL;
445 c2c_fmt = container_of(fmt,
struct c2c_fmt, fmt);
467 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width, text);
470 #define HEX_STR(__s, __v) \ 472 scnprintf(__s, sizeof(__s), "0x%" PRIx64, __v); \ 493 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
HEX_STR(buf, addr));
504 if (WARN_ON_ONCE(!c2c_he->
nodestr))
507 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width, c2c_he->
nodestr);
531 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
HEX_STR(buf, addr));
538 uint64_t l = 0, r = 0;
545 return (int64_t)(r - l);
559 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
HEX_STR(buf, addr));
575 unsigned int tot_hitm;
580 return scnprintf(hpp->
buf, hpp->
size,
"%*u", width, tot_hitm);
589 unsigned int tot_hitm_left;
590 unsigned int tot_hitm_right;
598 return tot_hitm_left - tot_hitm_right;
601 #define STAT_FN_ENTRY(__f) \ 603 __f ## _entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, \ 604 struct hist_entry *he) \ 606 struct c2c_hist_entry *c2c_he; \ 607 int width = c2c_width(fmt, hpp, he->hists); \ 609 c2c_he = container_of(he, struct c2c_hist_entry, he); \ 610 return scnprintf(hpp->buf, hpp->size, "%*u", width, \ 611 c2c_he->stats.__f); \ 614 #define STAT_FN_CMP(__f) \ 616 __f ## _cmp(struct perf_hpp_fmt *fmt __maybe_unused, \ 617 struct hist_entry *left, struct hist_entry *right) \ 619 struct c2c_hist_entry *c2c_left, *c2c_right; \ 621 c2c_left = container_of(left, struct c2c_hist_entry, he); \ 622 c2c_right = container_of(right, struct c2c_hist_entry, he); \ 623 return c2c_left->stats.__f - c2c_right->stats.__f; \ 626 #define STAT_FN(__f) \ 645 llcmiss = stats->lcl_dram +
662 return scnprintf(hpp->
buf, hpp->
size,
"%*lu", width,
681 uint64_t lclmiss, ldcnt, total;
713 return scnprintf(hpp->
buf, hpp->
size,
"%*" PRIu64, width, tot_recs);
722 uint64_t tot_recs_left;
723 uint64_t tot_recs_right;
731 return tot_recs_left - tot_recs_right;
736 uint64_t lclmiss, ldcnt;
764 return scnprintf(hpp->
buf, hpp->
size,
"%*" PRIu64, width, tot_recs);
773 uint64_t tot_recs_left;
774 uint64_t tot_recs_right;
782 return tot_recs_left - tot_recs_right;
796 per = get_percent(c2c_he);
798 #ifdef HAVE_SLANG_SUPPORT 814 stats = &c2c_he->
stats;
815 total = &hists->
stats;
833 p = tot ? (double) st / tot : 0;
838 #define PERC_STR(__s, __v) \ 840 scnprintf(__s, sizeof(__s), "%.2F%%", __v); \ 855 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
PERC_STR(buf, per));
880 return per_left - per_right;
888 return &c2c_he->
stats;
896 return &hists->
stats;
901 return tot ? 100. * (double) st / (
double) tot : 0;
904 #define PERCENT(__h, __f) percent(he_stats(__h)->__f, total_stats(__h)->__f) 906 #define PERCENT_FN(__f) \ 907 static double percent_ ## __f(struct c2c_hist_entry *c2c_he) \ 909 struct c2c_hists *hists; \ 911 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); \ 912 return percent(c2c_he->stats.__f, hists->stats.__f); \ 925 double per =
PERCENT(he, rmt_hitm);
928 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
PERC_STR(buf, per));
945 per_left =
PERCENT(left, lcl_hitm);
946 per_right =
PERCENT(right, lcl_hitm);
948 return per_left - per_right;
956 double per =
PERCENT(he, lcl_hitm);
959 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
PERC_STR(buf, per));
976 per_left =
PERCENT(left, lcl_hitm);
977 per_right =
PERCENT(right, lcl_hitm);
979 return per_left - per_right;
987 double per =
PERCENT(he, st_l1hit);
990 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
PERC_STR(buf, per));
1007 per_left =
PERCENT(left, st_l1hit);
1008 per_right =
PERCENT(right, st_l1hit);
1010 return per_left - per_right;
1018 double per =
PERCENT(he, st_l1miss);
1021 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
PERC_STR(buf, per));
1038 per_left =
PERCENT(left, st_l1miss);
1039 per_right =
PERCENT(right, st_l1miss);
1041 return per_left - per_right;
1082 for (node = 0; node < c2c.
nodes_cnt; node++) {
1088 if (!bitmap_weight(
set, c2c.
cpus_cnt)) {
1090 ret = scnprintf(hpp->
buf, hpp->
size,
"%21s",
" ");
1097 ret = scnprintf(hpp->
buf, hpp->
size,
" ");
1103 ret = scnprintf(hpp->
buf, hpp->
size,
"%2d", node);
1111 ret = scnprintf(hpp->
buf, hpp->
size,
"%2d{%2d ", node, num);
1114 #define DISPLAY_HITM(__h) \ 1115 if (c2c_he->stats.__h> 0) { \ 1116 ret = scnprintf(hpp->buf, hpp->size, "%5.1f%% ", \ 1117 percent(stats->__h, c2c_he->stats.__h));\ 1119 ret = scnprintf(hpp->buf, hpp->size, "%6s ", "n/a"); \ 1140 ret = scnprintf(hpp->
buf, hpp->
size,
"%5.1f%%}",
1143 ret = scnprintf(hpp->
buf, hpp->
size,
"%6s}",
"n/a");
1150 ret = scnprintf(hpp->
buf, hpp->
size,
"%2d{", node);
1156 ret = scnprintf(hpp->
buf, hpp->
size,
"}");
1176 scnprintf(buf, 10,
"%6.0f", mean);
1177 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width, buf);
1180 #define MEAN_ENTRY(__func, __val) \ 1182 __func(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) \ 1184 struct c2c_hist_entry *c2c_he; \ 1185 c2c_he = container_of(he, struct c2c_hist_entry, he); \ 1186 return mean_entry(fmt, hpp, he, avg_stats(&c2c_he->cstats.__val)); \ 1203 scnprintf(buf, 10,
"%d", bitmap_weight(c2c_he->
cpuset, c2c.
cpus_cnt));
1204 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width, buf);
1218 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width, buf);
1227 return scnprintf(hpp->
buf, hpp->
size,
"%*s", width,
"");
1230 #define HEADER_LOW(__h) \ 1237 #define HEADER_BOTH(__h0, __h1) \ 1247 #define HEADER_SPAN(__h0, __h1, __s) \ 1258 #define HEADER_SPAN_LOW(__h) \ 1267 .name =
"dcacheline",
1275 .name =
"dcacheline_node",
1283 .name =
"dcacheline_count",
1301 .name =
"offset_node",
1326 .cmp = lcl_hitm_cmp,
1327 .entry = lcl_hitm_entry,
1334 .cmp = rmt_hitm_cmp,
1335 .entry = rmt_hitm_entry,
1341 .name =
"cl_rmt_hitm",
1342 .cmp = rmt_hitm_cmp,
1343 .entry = rmt_hitm_entry,
1349 .name =
"cl_lcl_hitm",
1350 .cmp = lcl_hitm_cmp,
1351 .entry = lcl_hitm_entry,
1359 .entry = store_entry,
1365 .name =
"stores_l1hit",
1366 .cmp = st_l1hit_cmp,
1367 .entry = st_l1hit_entry,
1373 .name =
"stores_l1miss",
1374 .cmp = st_l1miss_cmp,
1375 .entry = st_l1miss_entry,
1381 .name =
"cl_stores_l1hit",
1382 .cmp = st_l1hit_cmp,
1383 .entry = st_l1hit_entry,
1389 .name =
"cl_stores_l1miss",
1390 .cmp = st_l1miss_cmp,
1391 .entry = st_l1miss_entry,
1398 .cmp = ld_fbhit_cmp,
1399 .entry = ld_fbhit_entry,
1406 .cmp = ld_l1hit_cmp,
1407 .entry = ld_l1hit_entry,
1414 .cmp = ld_l2hit_cmp,
1415 .entry = ld_l2hit_entry,
1421 .name =
"ld_lclhit",
1422 .cmp = ld_llchit_cmp,
1423 .entry = ld_llchit_entry,
1429 .name =
"ld_rmthit",
1431 .entry = rmt_hit_entry,
1437 .name =
"ld_llcmiss",
1453 .name =
"tot_loads",
1466 .
name =
"percent_hitm",
1475 .name =
"percent_rmt_hitm",
1484 .name =
"percent_lcl_hitm",
1493 .name =
"percent_stores_l1hit",
1502 .name =
"percent_stores_l1miss",
1512 .cmp = lcl_dram_cmp,
1513 .entry = lcl_dram_entry,
1520 .cmp = rmt_dram_cmp,
1521 .entry = rmt_dram_entry,
1567 .entry = mean_rmt_entry,
1575 .entry = mean_lcl_entry,
1581 .name =
"mean_load",
1583 .entry = mean_load_entry,
1596 .
name =
"cl_srcline",
1618 .name =
"cl_num_empty",
1676 c2c_fmt = container_of(fmt,
struct c2c_fmt, fmt);
1685 return c2c_a->
dim == c2c_b->
dim;
1692 for (i = 0; dimensions[i]; i++) {
1695 if (!strcmp(dim->
name, name))
1705 struct c2c_fmt *
c2c_fmt = container_of(fmt,
struct c2c_fmt, fmt);
1712 if (dim == &dim_symbol || dim == &dim_srcline)
1722 struct c2c_fmt *
c2c_fmt = container_of(fmt,
struct c2c_fmt, fmt);
1731 struct c2c_fmt *
c2c_fmt = container_of(fmt,
struct c2c_fmt, fmt);
1736 return collapse_fn(a, b);
1748 c2c_fmt =
zalloc(
sizeof(*c2c_fmt));
1754 fmt = &c2c_fmt->
fmt;
1755 INIT_LIST_HEAD(&fmt->
list);
1795 if (dim == &dim_dso)
1802 #define PARSE_LIST(_list, _fn) \ 1810 for (tok = strtok_r((char *)_list, ", ", &tmp); \ 1811 tok; tok = strtok_r(NULL, ", ", &tmp)) { \ 1812 ret = _fn(hpp_list, tok); \ 1813 if (ret == -EINVAL) { \ 1814 pr_err("Invalid --fields key: `%s'", tok); \ 1816 } else if (ret == -ESRCH) { \ 1817 pr_err("Unknown --fields key: `%s'", tok); \ 1824 const char *output_,
1827 char *
output = output_ ? strdup(output_) : NULL;
1828 char *sort = sort_ ? strdup(sort_) : NULL;
1856 int nr_header_lines)
1881 #define DISPLAY_LINE_LIMIT 0.0005 1893 #define FILTER_HITM(__h) \ 1895 ld_dist = ((double)c2c_he->stats.__h / stats->__h); \ 1896 if (ld_dist < DISPLAY_LINE_LIMIT) \ 1897 he->filtered = HIST_FILTER__C2C; \ 1899 he->filtered = HIST_FILTER__C2C; \ 1939 if (len > dim->
width)
1955 len = scnprintf(buf,
sizeof(buf),
"N/A");
1959 c2c_he->
nodestr = strdup(buf);
1960 return c2c_he->
nodestr ? 0 : -ENOMEM;
1967 c2c_hists = container_of(c2c_he->
he.
hists,
struct c2c_hists, hists);
1996 c2c_hists = c2c_he->
hists;
1998 if (display && c2c_hists) {
1999 static unsigned int idx;
2021 unsigned long **nodes;
2045 for (cpu = 0; cpu < c2c.
cpus_cnt; cpu++)
2050 for (node = 0; node < c2c.
nodes_cnt; node++) {
2058 for (cpu = 0; cpu < map->
nr; cpu++) {
2059 set_bit(map->
map[cpu],
set);
2061 if (WARN_ONCE(cpu2node[map->
map[cpu]] != -1,
"node/cpu topology bug"))
2064 cpu2node[map->
map[cpu]] = node;
2074 #define HAS_HITMS(__h) ((__h)->stats.lcl_hitm || (__h)->stats.rmt_hitm) 2091 struct rb_node *next = rb_first(&hists->
entries);
2117 fprintf(out,
"=================================================\n");
2118 fprintf(out,
" Trace Event Information \n");
2119 fprintf(out,
"=================================================\n");
2120 fprintf(out,
" Total records : %10d\n", stats->
nr_entries);
2121 fprintf(out,
" Locked Load/Store Operations : %10d\n", stats->
locks);
2122 fprintf(out,
" Load Operations : %10d\n", stats->
load);
2123 fprintf(out,
" Loads - uncacheable : %10d\n", stats->
ld_uncache);
2124 fprintf(out,
" Loads - IO : %10d\n", stats->
ld_io);
2125 fprintf(out,
" Loads - Miss : %10d\n", stats->
ld_miss);
2126 fprintf(out,
" Loads - no mapping : %10d\n", stats->
ld_noadrs);
2127 fprintf(out,
" Load Fill Buffer Hit : %10d\n", stats->
ld_fbhit);
2128 fprintf(out,
" Load L1D hit : %10d\n", stats->
ld_l1hit);
2129 fprintf(out,
" Load L2D hit : %10d\n", stats->
ld_l2hit);
2131 fprintf(out,
" Load Local HITM : %10d\n", stats->
lcl_hitm);
2132 fprintf(out,
" Load Remote HITM : %10d\n", stats->
rmt_hitm);
2133 fprintf(out,
" Load Remote HIT : %10d\n", stats->
rmt_hit);
2134 fprintf(out,
" Load Local DRAM : %10d\n", stats->
lcl_dram);
2135 fprintf(out,
" Load Remote DRAM : %10d\n", stats->
rmt_dram);
2136 fprintf(out,
" Load MESI State Exclusive : %10d\n", stats->
ld_excl);
2137 fprintf(out,
" Load MESI State Shared : %10d\n", stats->
ld_shared);
2138 fprintf(out,
" Load LLC Misses : %10d\n", llc_misses);
2139 fprintf(out,
" LLC Misses to Local DRAM : %10.1f%%\n", ((
double)stats->
lcl_dram/(
double)llc_misses) * 100.);
2140 fprintf(out,
" LLC Misses to Remote DRAM : %10.1f%%\n", ((
double)stats->
rmt_dram/(
double)llc_misses) * 100.);
2141 fprintf(out,
" LLC Misses to Remote cache (HIT) : %10.1f%%\n", ((
double)stats->
rmt_hit /(
double)llc_misses) * 100.);
2142 fprintf(out,
" LLC Misses to Remote cache (HITM) : %10.1f%%\n", ((
double)stats->
rmt_hitm/(
double)llc_misses) * 100.);
2143 fprintf(out,
" Store Operations : %10d\n", stats->
store);
2144 fprintf(out,
" Store - uncacheable : %10d\n", stats->
st_uncache);
2145 fprintf(out,
" Store - no mapping : %10d\n", stats->
st_noadrs);
2146 fprintf(out,
" Store L1D Hit : %10d\n", stats->
st_l1hit);
2147 fprintf(out,
" Store L1D Miss : %10d\n", stats->
st_l1miss);
2148 fprintf(out,
" No Page Map Rejects : %10d\n", stats->
nomap);
2149 fprintf(out,
" Unable to parse data source : %10d\n", stats->
noparse);
2157 fprintf(out,
"=================================================\n");
2158 fprintf(out,
" Global Shared Cache Line Event Information \n");
2159 fprintf(out,
"=================================================\n");
2160 fprintf(out,
" Total Shared Cache Lines : %10d\n", c2c.
shared_clines);
2161 fprintf(out,
" Load HITs on shared lines : %10d\n", stats->
load);
2162 fprintf(out,
" Fill Buffer Hits on shared lines : %10d\n", stats->
ld_fbhit);
2163 fprintf(out,
" L1D hits on shared lines : %10d\n", stats->
ld_l1hit);
2164 fprintf(out,
" L2D hits on shared lines : %10d\n", stats->
ld_l2hit);
2165 fprintf(out,
" LLC hits on shared lines : %10d\n", stats->
ld_llchit + stats->
lcl_hitm);
2166 fprintf(out,
" Locked Access on shared lines : %10d\n", stats->
locks);
2167 fprintf(out,
" Store HITs on shared lines : %10d\n", stats->
store);
2168 fprintf(out,
" Store L1D hits on shared lines : %10d\n", stats->
st_l1hit);
2169 fprintf(out,
" Total Merged records : %10d\n", hitm_cnt + stats->
store);
2191 fprintf(out,
" -------------------------------------------------------------\n");
2193 fprintf(out,
"%s\n", bf);
2194 fprintf(out,
" -------------------------------------------------------------\n");
2215 if (WARN_ONCE(ret,
"failed to setup sort entries\n"))
2220 for (; nd; nd = rb_next(nd)) {
2238 fprintf(out,
"=================================================\n");
2239 fprintf(out,
" c2c details \n");
2240 fprintf(out,
"=================================================\n");
2243 fprintf(out,
"%-36s: %s\n", first ?
" Events" :
"",
2247 fprintf(out,
" Cachelines sort on : %s HITMs\n",
2249 fprintf(out,
" Cacheline data grouping : %s\n", c2c.
cl_sort);
2266 fprintf(out,
"=================================================\n");
2267 fprintf(out,
" Shared Data Cache Line Table \n");
2268 fprintf(out,
"=================================================\n");
2269 fprintf(out,
"#\n");
2274 fprintf(out,
"=================================================\n");
2275 fprintf(out,
" Shared Cache Line Distribution Pareto \n");
2276 fprintf(out,
"=================================================\n");
2277 fprintf(out,
"#\n");
2282 #ifdef HAVE_SLANG_SUPPORT 2283 static void c2c_browser__update_nr_entries(
struct hist_browser *hb)
2300 struct c2c_cacheline_browser {
2306 perf_c2c_cacheline_browser__title(
struct hist_browser *browser,
2307 char *bf,
size_t size)
2309 struct c2c_cacheline_browser *cl_browser;
2313 cl_browser = container_of(browser,
struct c2c_cacheline_browser, hb);
2314 he = cl_browser->he;
2319 scnprintf(bf, size,
"Cacheline 0x%lx", addr);
2323 static struct c2c_cacheline_browser*
2324 c2c_cacheline_browser__new(
struct hists *hists,
struct hist_entry *he)
2326 struct c2c_cacheline_browser *browser;
2328 browser =
zalloc(
sizeof(*browser));
2331 browser->hb.c2c_filter =
true;
2332 browser->hb.title = perf_c2c_cacheline_browser__title;
2339 static int perf_c2c__browse_cacheline(
struct hist_entry *he)
2343 struct c2c_cacheline_browser *cl_browser;
2347 " ENTER Toggle callchains (if present) \n" 2348 " n Toggle Node details info \n" 2349 " s Toggle full length of symbol and source line columns \n" 2350 " q Return back to cacheline list \n";
2356 c2c_hists = c2c_he->
hists;
2358 cl_browser = c2c_cacheline_browser__new(&c2c_hists->
hists, he);
2359 if (cl_browser == NULL)
2362 browser = &cl_browser->hb;
2366 SLang_init_tty(0, 0, 0);
2368 c2c_browser__update_nr_entries(browser);
2396 static int perf_c2c_browser__title(
struct hist_browser *browser,
2397 char *bf,
size_t size)
2400 "Shared Data Cache Line Table " 2401 "(%lu entries, sorted on %s HITMs)",
2408 perf_c2c_browser__new(
struct hists *hists)
2413 browser->
title = perf_c2c_browser__title;
2420 static int perf_c2c__hists_browse(
struct hists *hists)
2425 " d Display cacheline details \n" 2426 " ENTER Toggle callchains (if present) \n" 2429 browser = perf_c2c_browser__new(hists);
2430 if (browser == NULL)
2435 SLang_init_tty(0, 0, 0);
2437 c2c_browser__update_nr_entries(browser);
2478 int i, j, olen = strlen(orig);
2485 j = len / 2 - olen / 2;
2487 for (i = 0; i < j - 1; i++)
2492 strcpy(buf + i, orig);
2498 for (; i < len; i++)
2506 const char *nodestr =
"Data address";
2510 dim_offset.
width = 5;
2519 dim_dcacheline_node.
width +
2520 dim_dcacheline_count.
width + 4);
2528 dim_offset_node.
width +
2529 dim_dcacheline_count.
width + 4);
2538 #define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent" 2567 if ((sample_type & PERF_SAMPLE_REGS_USER) &&
2568 (sample_type & PERF_SAMPLE_STACK_USER)) {
2571 }
else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
2573 else if (sample_type & PERF_SAMPLE_CALLCHAIN)
2581 ui__error(
"Can't register callchain params.\n");
2593 const char *display = str ?:
"tot";
2595 if (!strcmp(display,
"tot"))
2597 else if (!strcmp(display,
"rmt"))
2599 else if (!strcmp(display,
"lcl"))
2602 pr_err(
"failed: unknown display type: %s\n", str);
2609 #define for_each_token(__tok, __buf, __sep, __tmp) \ 2610 for (__tok = strtok_r(__buf, __sep, &__tmp); __tok; \ 2611 __tok = strtok_r(NULL, __sep, &__tmp)) 2615 char *tok, *tmp, *buf = strdup(cl_sort);
2616 bool add_pid =
false;
2617 bool add_tid =
false;
2618 bool add_iaddr =
false;
2619 bool add_sym =
false;
2620 bool add_dso =
false;
2621 bool add_src =
false;
2627 if (!strcmp(tok,
"tid")) {
2629 }
else if (!strcmp(tok,
"pid")) {
2631 }
else if (!strcmp(tok,
"iaddr")) {
2635 add_src = no_source ? false :
true;
2636 }
else if (!strcmp(tok,
"dso")) {
2638 }
else if (strcmp(tok,
"offset")) {
2639 pr_err(
"unrecognized sort token: %s\n", tok);
2645 "%s%s%s%s%s%s%s%s%s%s",
2649 "percent_stores_l1hit," 2650 "percent_stores_l1miss," 2651 "offset,offset_node,dcacheline_count,",
2652 add_pid ?
"pid," :
"",
2653 add_tid ?
"tid," :
"",
2654 add_iaddr ?
"iaddr," :
"",
2660 add_sym ?
"symbol," :
"",
2661 add_dso ?
"dso," :
"",
2662 add_src ?
"cl_srcline," :
"",
2676 if (asprintf(&c2c.
cl_sort,
"offset,%s", c) < 0)
2682 if (asprintf(&c2c.
cl_resort,
"offset,%s",
2686 "rmt_hitm,lcl_hitm" :
2687 "lcl_hitm,rmt_hitm") < 0)
2704 const char *display = NULL;
2705 const char *coalesce = NULL;
2706 bool no_source =
false;
2707 const struct option options[] = {
2709 "file",
"vmlinux pathname"),
2710 OPT_STRING(
'i',
"input", &
input_name,
"file",
2711 "the input file to process"),
2712 OPT_INCR(
'N',
"node-info", &c2c.
node_info,
2713 "show extra node info in report (repeat for more info)"),
2714 #ifdef HAVE_SLANG_SUPPORT 2715 OPT_BOOLEAN(0,
"stdio", &c2c.
use_stdio,
"Use the stdio interface"),
2718 "Display only statistic tables (implies --stdio)"),
2720 "Display full length of symbols"),
2721 OPT_BOOLEAN(0,
"no-source", &no_source,
2722 "Do not display Source Line column"),
2723 OPT_BOOLEAN(0,
"show-all", &c2c.
show_all,
2724 "Show all captured HITM lines."),
2726 "print_type,threshold[,print_limit],order,sort_key[,branch],value",
2728 callchain_default_opt),
2729 OPT_STRING(
'd',
"display", &display,
"Switch HITM output type",
"lcl,rmt"),
2730 OPT_STRING(
'c',
"coalesce", &coalesce,
"coalesce fields",
2731 "coalesce fields: pid,tid,iaddr,dso"),
2739 PARSE_OPT_STOP_AT_NON_OPTION);
2758 pr_debug(
"Failed to initialize hists\n");
2764 pr_debug(
"Failed to initialize hists\n");
2769 if (session == NULL) {
2770 pr_debug(
"No memory for session\n");
2776 pr_err(
"Failed setup nodes\n");
2793 pr_debug(
"No pipe support at the moment.\n");
2806 pr_err(
"failed to process sample\n");
2817 "tot_hitm,lcl_hitm,rmt_hitm," 2818 "stores,stores_l1hit,stores_l1miss," 2819 "dram_lcl,dram_rmt," 2822 "ld_fbhit,ld_l1hit,ld_l2hit," 2823 "ld_lclhit,ld_rmthit",
2837 pr_err(
"failed to setup UI\n");
2852 const char *
str,
int unset __maybe_unused)
2854 bool *event_set = (
bool *) opt->value;
2862 "perf c2c record [<options>] [<command>]",
2863 "perf c2c record [<options>] -- <command> [<options>]",
2871 int rec_argc, i = 0, j;
2872 const char **rec_argv;
2874 bool all_user =
false, all_kernel =
false;
2875 bool event_set =
false;
2876 struct option options[] = {
2877 OPT_CALLBACK(
'e',
"event", &event_set,
"event",
2878 "event selector. Use 'perf mem record -e list' to list available events",
2880 OPT_BOOLEAN(
'u',
"all-user", &all_user,
"collect only user level data"),
2881 OPT_BOOLEAN(
'k',
"all-kernel", &all_kernel,
"collect only kernel level data"),
2888 pr_err(
"failed: memory events not supported\n");
2893 PARSE_OPT_KEEP_UNKNOWN);
2895 rec_argc = argc + 11;
2896 rec_argv = calloc(rec_argc + 1,
sizeof(
char *));
2900 rec_argv[i++] =
"record";
2908 rec_argv[i++] =
"-W";
2910 rec_argv[i++] =
"-d";
2911 rec_argv[i++] =
"--phys-data";
2912 rec_argv[i++] =
"--sample-cpu";
2919 pr_err(
"failed: event '%s' not supported\n",
2925 rec_argv[i++] =
"-e";
2930 rec_argv[i++] =
"--all-user";
2933 rec_argv[i++] =
"--all-kernel";
2935 for (j = 0; j <
argc; j++, i++)
2936 rec_argv[i] = argv[j];
2943 while (rec_argv[j]) {
2958 PARSE_OPT_STOP_AT_NON_OPTION);
2963 if (!strncmp(argv[0],
"rec", 3)) {
2965 }
else if (!strncmp(argv[0],
"rep", 3)) {
#define PERCENT(__h, __f)
void perf_hpp__setup_output_field(struct perf_hpp_list *list)
static struct c2c_hists * he__get_c2c_hists(struct hist_entry *he, const char *sort, int nr_header_lines)
static int set_nodestr(struct c2c_hist_entry *c2c_he)
int mem2node__node(struct mem2node *map, u64 addr)
struct sort_entry sort_dso
static int iaddr_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
int(* width)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists)
u64 nr_non_filtered_entries
static struct c2c_dimension dim_percent_stores_l1miss
struct perf_evlist * evlist
static struct c2c_dimension dim_offset
static struct c2c_dimension dim_dcacheline
int(* title)(struct hist_browser *browser, char *bf, size_t size)
static struct c2c_dimension * get_dimension(const char *name)
static int percent_stores_l1hit_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
#define DISPLAY_HITM(__h)
int machine__resolve(struct machine *machine, struct addr_location *al, struct perf_sample *sample)
static int setup_coalesce(const char *coalesce, bool no_source)
static struct c2c_dimension dim_tot_hitm
const char * vmlinux_name
static struct c2c_fmt * get_format(const char *name)
static void print_c2c_info(FILE *out, struct perf_session *session)
void reset_dimensions(void)
struct sort_entry sort_thread
static struct c2c_dimension dim_dcacheline_num
static int dcacheline_node_count(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
int ui__error(const char *format,...)
static int64_t tot_loads_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
static int cpucnt_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
struct numa_node * numa_nodes
static u64 cl_offset(u64 address)
#define CALLCHAIN_REPORT_HELP
int cmd_record(int argc, const char **argv)
int64_t(* se_collapse)(struct hist_entry *, struct hist_entry *)
#define PERC_STR(__s, __v)
static int c2c_hists__init_output(struct perf_hpp_list *hpp_list, char *name)
static void c2c_he_free(void *he)
int(* entry)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
#define HEADER_SPAN(__h0, __h1, __s)
static int percent_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he, get_percent_cb get_percent)
int(* entry)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
int perf_event__process_mmap(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
struct c2c_stats hitm_stats
static int c2c_hists__init_sort(struct perf_hpp_list *hpp_list, char *name)
int hists__collapse_resort(struct hists *hists, struct ui_progress *prog)
int64_t(* se_cmp)(struct hist_entry *, struct hist_entry *)
#define PARSE_LIST(_list, _fn)
int hist_browser__run(struct hist_browser *browser, const char *help, bool warn_lost_event)
void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
void hists__output_resort_cb(struct hists *hists, struct ui_progress *prog, hists__resort_cb_t cb)
static struct c2c_dimension dim_ld_rmthit
static struct c2c_dimension dim_percent_hitm
static struct c2c_dimension dim_lcl_hitm
static int c2c_hists__init(struct c2c_hists *hists, const char *sort, int nr_header_lines)
void perf_hpp_list__register_sort_field(struct perf_hpp_list *list, struct perf_hpp_fmt *format)
static struct c2c_dimension dim_srcline
static int64_t empty_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left __maybe_unused, struct hist_entry *right __maybe_unused)
static struct c2c_dimension dim_iaddr
static uint64_t total_loads(struct c2c_stats *stats)
struct perf_data_file file
int perf_mem_events__init(void)
static uint64_t total_records(struct c2c_stats *stats)
static int filter_cb(struct hist_entry *he)
enum perf_call_graph_mode record_mode
int(* se_snprintf)(struct hist_entry *he, char *bf, size_t size, unsigned int width)
void hist_browser__init(struct hist_browser *browser, struct hists *hists)
static const char *const __usage_record[]
static int64_t tot_recs_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
struct addr_map_symbol daddr
struct list_head sort_list
int perf_event__process_comm(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
static struct c2c_dimension dim_stores_l1hit
int perf_event__process_exit(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
static bool he__display(struct hist_entry *he, struct c2c_stats *stats)
static int parse_record_events(const struct option *opt, const char *str, int unset __maybe_unused)
int64_t sort__iaddr_cmp(struct hist_entry *left, struct hist_entry *right)
void(* free)(struct perf_hpp_fmt *fmt)
static struct c2c_dimension dim_dcacheline_idx
void *(* new)(size_t size)
void mem2node__exit(struct mem2node *map)
int perf_event__process_fork(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
static int setup_nodes(struct perf_session *session)
static struct c2c_dimension dim_cpucnt
static int percent_stores_l1miss_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static void perf_c2c_display(struct perf_session *session)
#define HEADER_BOTH(__h0, __h1)
unsigned int perf_mem_events__loads_ldlat
static int64_t c2c_se_collapse(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
int64_t(* sort)(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
static int process_sample_event(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
static struct c2c_dimension dim_dcacheline_num_empty
static int percent_rmt_hitm_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static int percent_hitm_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
void perf_session__delete(struct perf_session *session)
static void print_pareto(FILE *out)
static struct c2c_dimension dim_stores_l1miss
static void print_c2c__display_stats(FILE *out)
static void init_stats(struct stats *stats)
int hists__fprintf_headers(struct hists *hists, FILE *fp)
static void * c2c_he_zalloc(size_t size)
int sample__resolve_callchain(struct perf_sample *sample, struct callchain_cursor *cursor, struct symbol **parent, struct perf_evsel *evsel, struct addr_location *al, int max_stack)
static struct c2c_dimension dim_dram_lcl
static const char *const __usage_report[]
static void c2c_he__set_cpu(struct c2c_hist_entry *c2c_he, struct perf_sample *sample)
u64 perf_evlist__combined_sample_type(struct perf_evlist *evlist)
static struct c2c_dimension dim_percent_lcl_hitm
static struct c2c_stats * he_stats(struct hist_entry *he)
void hist_browser__delete(struct hist_browser *browser)
bool(* equal)(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
int64_t(* cmp)(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
static struct c2c_dimension dim_offset_node
int ui_browser__help_window(struct ui_browser *browser, const char *text)
char * perf_mem_events__name(int i)
static int64_t offset_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
int cmd_c2c(int argc, const char **argv)
void addr_location__put(struct addr_location *al)
int(* header)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists, int line, int *span)
static struct hist_entry_ops c2c_entry_ops
unsigned int cacheline_idx
static struct c2c_dimension dim_ld_l1hit
void setup_browser(bool fallback_to_pager)
static struct c2c_dimension dim_symbol
static int sort_dimension__add(const char *tok, struct list_head *list)
bool dwarf_callchain_users
static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session)
int output_field_add(struct perf_hpp_list *list, char *tok)
int parse_callchain_report_opt(const char *arg)
#define HEADER_SPAN_LOW(__h)
static void print_shared_cacheline_info(FILE *out)
#define pr_debug(fmt,...)
void update_stats(struct stats *stats, u64 val)
static struct perf_session * session
static void fmt_free(struct perf_hpp_fmt *fmt)
void perf_hpp__append_sort_keys(struct perf_hpp_list *list)
static struct c2c_dimension dim_cl_lcl_hitm
#define evlist__for_each_entry(evlist, evsel)
static int64_t tot_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
static int percent_lcl_hitm_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
struct perf_hpp_list list
#define CALLCHAIN_DEFAULT_OPT
static int c2c_width(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp __maybe_unused, struct hists *hists)
static int percent_stores_l1miss_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static struct c2c_dimension * dimensions[]
static int pid_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static int entry(u64 ip, struct unwind_info *ui)
static int64_t percent_lcl_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
static int offset_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static double percent_hitm(struct c2c_hist_entry *c2c_he)
static struct c2c_stats * total_stats(struct hist_entry *he)
static int64_t dcacheline_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
static int64_t percent_stores_l1miss_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
int(* hists__resort_cb_t)(struct hist_entry *he)
u16 hists__col_len(struct hists *hists, enum hist_column col)
static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS)
int64_t(* collapse)(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
static const char *const c2c_usage[]
static struct perf_tool tool
struct hist_entry * he_selection
void perf_hpp__reset_output_field(struct perf_hpp_list *list)
static struct c2c_header percent_hitm_header[]
int64_t(* cmp)(struct perf_hpp_fmt *fmt, struct hist_entry *, struct hist_entry *)
#define HEX_STR(__s, __v)
static void setup_nodes_header(void)
static int percent_hitm_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
struct compute_stats cstats
static int str(yyscan_t scanner, int token)
static void set_node_width(struct c2c_hist_entry *c2c_he, int len)
static int symbol_width(struct hists *hists, struct sort_entry *se)
static struct c2c_header header_node[3]
struct c2c_stats * node_stats
static struct c2c_dimension dim_tot_recs
static int dcacheline_node_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
#define ui_progress__init(p, total, title)
static struct c2c_dimension dim_node
static struct c2c_dimension dim_ld_l2hit
static int64_t c2c_se_cmp(struct perf_hpp_fmt *fmt, struct hist_entry *a, struct hist_entry *b)
int __hpp__slsmg_color_printf(struct perf_hpp *hpp, const char *fmt,...)
static int valid_hitm_or_store(struct hist_entry *he)
static int perf_c2c__record(int argc, const char **argv)
static int cl_idx_empty_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static struct c2c_dimension dim_ld_llchit
static struct c2c_dimension dim_rmt_hitm
static char const * coalesce_default
const char * perf_evsel__name(struct perf_evsel *evsel)
static void calc_width(struct c2c_hist_entry *c2c_he)
int __hist_entry__snprintf(struct hist_entry *he, struct perf_hpp *hpp, struct perf_hpp_list *hpp_list)
static bool fmt_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
struct perf_event_header header
int __hists__init(struct hists *hists, struct perf_hpp_list *hpp_list)
static int node_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp, struct hist_entry *he)
static struct c2c_dimension dim_stores
void ui_progress__finish(void)
struct mem_info * mem_info__get(struct mem_info *mi)
static int perf_data__is_pipe(struct perf_data *data)
#define for_each_token(__tok, __buf, __sep, __tmp)
static struct @9 output[OUTPUT_TYPE_MAX]
struct perf_session * perf_session__new(struct perf_data *data, bool repipe, struct perf_tool *tool)
struct mem_info * mem_info
static struct c2c_dimension dim_percent_rmt_hitm
int perf_event__process_mmap2(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
static int64_t percent_rmt_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
static int percent_stores_l1hit_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static int64_t percent_stores_l1hit_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
struct sort_entry sort_srcline
int perf_session__process_events(struct perf_session *session)
static struct c2c_dimension dim_mean_rmt
static int tot_loads_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static int64_t pid_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
struct sort_entry sort_sym
static int c2c_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists, int line, int *span)
static struct c2c_dimension dim_pid
int(* color)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static void advance_hpp(struct perf_hpp *hpp, int inc)
double() get_percent_cb(struct c2c_hist_entry *)
static void c2c_he__set_node(struct c2c_hist_entry *c2c_he, struct perf_sample *sample)
int mem2node__init(struct mem2node *map, struct perf_env *env)
static int c2c_hists__reinit(struct c2c_hists *c2c_hists, const char *output, const char *sort)
int perf_mem_events__parse(const char *str)
int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample *sample)
static int setup_callchain(struct perf_evlist *evlist)
static int tot_recs_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static struct c2c_dimension dim_mean_load
static struct c2c_dimension dim_tot_loads
#define MEAN_ENTRY(__func, __val)
struct perf_header header
static int resort_hitm_cb(struct hist_entry *he)
static double percent(int st, int tot)
static int hists__iterate_cb(struct hists *hists, hists__resort_cb_t cb)
void perf_hpp_list__column_register(struct perf_hpp_list *list, struct perf_hpp_fmt *format)
static u64 cl_address(u64 address)
int symbol__init(struct perf_env *env)
void perf_hpp_list__init(struct perf_hpp_list *list)
struct perf_hpp_list * hpp_list
static int64_t ld_llcmiss_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
static uint64_t llc_miss(struct c2c_stats *stats)
struct hist_entry * hists__add_entry_ops(struct hists *hists, struct hist_entry_ops *ops, struct addr_location *al, struct symbol *sym_parent, struct branch_info *bi, struct mem_info *mi, struct perf_sample *sample, bool sample_self)
static struct c2c_dimension dim_percent_stores_l1hit
static const char *const * record_mem_usage
static struct c2c_dimension dim_tid
static int percent_rmt_hitm_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static struct c2c_dimension dim_mean_lcl
static int setup_display(const char *str)
static int ui_quirks(void)
struct addr_map_symbol iaddr
struct mem_info * sample__resolve_mem(struct perf_sample *sample, struct addr_location *al)
static struct c2c_dimension dim_cl_stores_l1hit
struct hist_browser * hist_browser__new(struct hists *hists)
void hists__delete_entries(struct hists *hists)
int perf_event__process_lost(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
static int resort_cl_cb(struct hist_entry *he)
static int hpp_list__parse(struct perf_hpp_list *hpp_list, const char *output_, const char *sort_)
static int percent_lcl_hitm_color(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
int(* color)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static const char *const * report_c2c_usage
static struct c2c_dimension dim_ld_fbhit
static void print_cacheline(struct c2c_hists *c2c_hists, struct hist_entry *he_cl, struct perf_hpp_list *hpp_list, FILE *out)
static int c2c_se_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
void mem_info__put(struct mem_info *mi)
static char * fill_line(const char *orig, int len)
static int dcacheline_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
int hpp_color_scnprintf(struct perf_hpp *hpp, const char *fmt,...)
int sysctl_perf_event_max_stack
static int64_t percent_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
void hists__inc_nr_samples(struct hists *hists, bool filtered)
static int perf_c2c__report(int argc, const char **argv)
static struct c2c_dimension dim_dcacheline_node
size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, int max_cols, float min_pcnt, FILE *fp, bool use_callchain)
static struct c2c_dimension dim_dso
static int parse_callchain_opt(const struct option *opt, const char *arg, int unset)
static const struct option c2c_options[]
static void compute_stats(struct c2c_hist_entry *c2c_he, struct c2c_stats *stats, u64 weight)
static struct c2c_dimension dim_cl_stores_l1miss
int callchain_register_param(struct callchain_param *param)
static const char * display_str[DISPLAY_MAX]
int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
static struct c2c_dimension dim_cl_rmt_hitm
struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX]
static struct perf_c2c c2c
static int build_cl_output(char *cl_sort, bool no_source)
static struct c2c_header header_offset_tui
char * hist_entry__srcline(struct hist_entry *he)
void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add)
struct c2c_dimension * dim
static int tot_hitm_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static struct c2c_dimension dim_dram_rmt
static struct c2c_dimension dim_dcacheline_count
def store(time, event, cpu, thread, val, ena, run)
static int64_t iaddr_cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right)
int64_t sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right)
static struct c2c_dimension dim_ld_llcmiss
static int mean_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he, double mean)
void static void * zalloc(size_t size)
static int ld_llcmiss_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
static int cl_idx_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he)
const char callchain_help[]