Lines Matching refs:c2c_he
124 struct c2c_hist_entry *c2c_he; in c2c_he_zalloc() local
126 c2c_he = zalloc(size + sizeof(*c2c_he)); in c2c_he_zalloc()
127 if (!c2c_he) in c2c_he_zalloc()
130 c2c_he->cpuset = bitmap_alloc(c2c.cpus_cnt); in c2c_he_zalloc()
131 if (!c2c_he->cpuset) in c2c_he_zalloc()
134 c2c_he->nodeset = bitmap_alloc(c2c.nodes_cnt); in c2c_he_zalloc()
135 if (!c2c_he->nodeset) in c2c_he_zalloc()
138 c2c_he->node_stats = zalloc(c2c.nodes_cnt * sizeof(*c2c_he->node_stats)); in c2c_he_zalloc()
139 if (!c2c_he->node_stats) in c2c_he_zalloc()
142 init_stats(&c2c_he->cstats.lcl_hitm); in c2c_he_zalloc()
143 init_stats(&c2c_he->cstats.rmt_hitm); in c2c_he_zalloc()
144 init_stats(&c2c_he->cstats.load); in c2c_he_zalloc()
146 return &c2c_he->he; in c2c_he_zalloc()
151 struct c2c_hist_entry *c2c_he; in c2c_he_free() local
153 c2c_he = container_of(he, struct c2c_hist_entry, he); in c2c_he_free()
154 if (c2c_he->hists) { in c2c_he_free()
155 hists__delete_entries(&c2c_he->hists->hists); in c2c_he_free()
156 free(c2c_he->hists); in c2c_he_free()
159 free(c2c_he->cpuset); in c2c_he_free()
160 free(c2c_he->nodeset); in c2c_he_free()
161 free(c2c_he->nodestr); in c2c_he_free()
162 free(c2c_he->node_stats); in c2c_he_free()
163 free(c2c_he); in c2c_he_free()
180 struct c2c_hist_entry *c2c_he; in he__get_c2c_hists() local
184 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__get_c2c_hists()
185 if (c2c_he->hists) in he__get_c2c_hists()
186 return c2c_he->hists; in he__get_c2c_hists()
188 hists = c2c_he->hists = zalloc(sizeof(*hists)); in he__get_c2c_hists()
201 static void c2c_he__set_cpu(struct c2c_hist_entry *c2c_he, in c2c_he__set_cpu() argument
208 set_bit(sample->cpu, c2c_he->cpuset); in c2c_he__set_cpu()
211 static void c2c_he__set_node(struct c2c_hist_entry *c2c_he, in c2c_he__set_node() argument
217 c2c_he->paddr_zero = true; in c2c_he__set_node()
225 set_bit(node, c2c_he->nodeset); in c2c_he__set_node()
227 if (c2c_he->paddr != sample->phys_addr) { in c2c_he__set_node()
228 c2c_he->paddr_cnt++; in c2c_he__set_node()
229 c2c_he->paddr = sample->phys_addr; in c2c_he__set_node()
233 static void compute_stats(struct c2c_hist_entry *c2c_he, in compute_stats() argument
237 struct compute_stats *cstats = &c2c_he->cstats; in compute_stats()
254 struct c2c_hist_entry *c2c_he; in process_sample_event() local
291 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
292 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
295 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
296 c2c_he__set_node(c2c_he, sample); in process_sample_event()
325 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
326 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
328 c2c_add_stats(&c2c_he->node_stats[node], &stats); in process_sample_event()
330 compute_stats(c2c_he, &stats, sample->weight); in process_sample_event()
332 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
333 c2c_he__set_node(c2c_he, sample); in process_sample_event()
500 struct c2c_hist_entry *c2c_he; in dcacheline_node_entry() local
503 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_entry()
504 if (WARN_ON_ONCE(!c2c_he->nodestr)) in dcacheline_node_entry()
507 return scnprintf(hpp->buf, hpp->size, "%*s", width, c2c_he->nodestr); in dcacheline_node_entry()
514 struct c2c_hist_entry *c2c_he; in dcacheline_node_count() local
517 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_count()
518 return scnprintf(hpp->buf, hpp->size, "%*lu", width, c2c_he->paddr_cnt); in dcacheline_node_count()
573 struct c2c_hist_entry *c2c_he; in tot_hitm_entry() local
577 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_hitm_entry()
578 tot_hitm = c2c_he->stats.lcl_hitm + c2c_he->stats.rmt_hitm; in tot_hitm_entry()
606 struct c2c_hist_entry *c2c_he; \
609 c2c_he = container_of(he, struct c2c_hist_entry, he); \
611 c2c_he->stats.__f); \
657 struct c2c_hist_entry *c2c_he; in ld_llcmiss_entry() local
660 c2c_he = container_of(he, struct c2c_hist_entry, he); in ld_llcmiss_entry()
663 llc_miss(&c2c_he->stats)); in ld_llcmiss_entry()
706 struct c2c_hist_entry *c2c_he; in tot_recs_entry() local
710 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_recs_entry()
711 tot_recs = total_records(&c2c_he->stats); in tot_recs_entry()
757 struct c2c_hist_entry *c2c_he; in tot_loads_entry() local
761 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_loads_entry()
762 tot_recs = total_loads(&c2c_he->stats); in tot_loads_entry()
791 struct c2c_hist_entry *c2c_he; in percent_color() local
795 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_color()
796 per = get_percent(c2c_he); in percent_color()
805 static double percent_hitm(struct c2c_hist_entry *c2c_he) in percent_hitm() argument
813 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in percent_hitm()
814 stats = &c2c_he->stats; in percent_hitm()
848 struct c2c_hist_entry *c2c_he; in percent_hitm_entry() local
853 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_hitm_entry()
854 per = percent_hitm(c2c_he); in percent_hitm_entry()
885 struct c2c_hist_entry *c2c_he; in he_stats() local
887 c2c_he = container_of(he, struct c2c_hist_entry, he); in he_stats()
888 return &c2c_he->stats; in he_stats()
907 static double percent_ ## __f(struct c2c_hist_entry *c2c_he) \
911 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); \
912 return percent(c2c_he->stats.__f, hists->stats.__f); \
1075 struct c2c_hist_entry *c2c_he; in node_entry() local
1080 c2c_he = container_of(he, struct c2c_hist_entry, he); in node_entry()
1086 bitmap_and(set, c2c_he->cpuset, c2c.nodes[node], c2c.cpus_cnt); in node_entry()
1108 int num = bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt); in node_entry()
1109 struct c2c_stats *stats = &c2c_he->node_stats[node]; in node_entry()
1115 if (c2c_he->stats.__h> 0) { \ in node_entry()
1117 percent(stats->__h, c2c_he->stats.__h));\ in node_entry()
1139 if (c2c_he->stats.store > 0) { in node_entry()
1141 percent(stats->store, c2c_he->stats.store)); in node_entry()
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)); \
1197 struct c2c_hist_entry *c2c_he; in cpucnt_entry() local
1201 c2c_he = container_of(he, struct c2c_hist_entry, he); in cpucnt_entry()
1203 scnprintf(buf, 10, "%d", bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt)); in cpucnt_entry()
1211 struct c2c_hist_entry *c2c_he; in cl_idx_entry() local
1215 c2c_he = container_of(he, struct c2c_hist_entry, he); in cl_idx_entry()
1217 scnprintf(buf, 10, "%u", c2c_he->cacheline_idx); in cl_idx_entry()
1885 struct c2c_hist_entry *c2c_he; in he__display() local
1891 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__display()
1895 ld_dist = ((double)c2c_he->stats.__h / stats->__h); \ in he__display()
1922 struct c2c_hist_entry *c2c_he; in valid_hitm_or_store() local
1925 c2c_he = container_of(he, struct c2c_hist_entry, he); in valid_hitm_or_store()
1926 has_hitm = c2c.display == DISPLAY_TOT ? c2c_he->stats.tot_hitm : in valid_hitm_or_store()
1927 c2c.display == DISPLAY_LCL ? c2c_he->stats.lcl_hitm : in valid_hitm_or_store()
1928 c2c_he->stats.rmt_hitm; in valid_hitm_or_store()
1929 return has_hitm || c2c_he->stats.store; in valid_hitm_or_store()
1932 static void set_node_width(struct c2c_hist_entry *c2c_he, int len) in set_node_width() argument
1936 dim = &c2c.hists == c2c_he->hists ? in set_node_width()
1943 static int set_nodestr(struct c2c_hist_entry *c2c_he) in set_nodestr() argument
1948 if (c2c_he->nodestr) in set_nodestr()
1951 if (bitmap_weight(c2c_he->nodeset, c2c.nodes_cnt)) { in set_nodestr()
1952 len = bitmap_scnprintf(c2c_he->nodeset, c2c.nodes_cnt, in set_nodestr()
1958 set_node_width(c2c_he, len); in set_nodestr()
1959 c2c_he->nodestr = strdup(buf); in set_nodestr()
1960 return c2c_he->nodestr ? 0 : -ENOMEM; in set_nodestr()
1963 static void calc_width(struct c2c_hist_entry *c2c_he) in calc_width() argument
1967 c2c_hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in calc_width()
1968 hists__calc_col_len(&c2c_hists->hists, &c2c_he->he); in calc_width()
1969 set_nodestr(c2c_he); in calc_width()
1974 struct c2c_hist_entry *c2c_he; in filter_cb() local
1976 c2c_he = container_of(he, struct c2c_hist_entry, he); in filter_cb()
1981 calc_width(c2c_he); in filter_cb()
1991 struct c2c_hist_entry *c2c_he; in resort_cl_cb() local
1995 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_cl_cb()
1996 c2c_hists = c2c_he->hists; in resort_cl_cb()
2001 c2c_he->cacheline_idx = idx++; in resort_cl_cb()
2002 calc_width(c2c_he); in resort_cl_cb()
2078 struct c2c_hist_entry *c2c_he; in resort_hitm_cb() local
2079 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_hitm_cb()
2081 if (HAS_HITMS(c2c_he)) { in resort_hitm_cb()
2083 c2c_add_stats(&c2c.hitm_stats, &c2c_he->stats); in resort_hitm_cb()
2222 struct c2c_hist_entry *c2c_he; in print_pareto() local
2227 c2c_he = container_of(he, struct c2c_hist_entry, he); in print_pareto()
2228 print_cacheline(c2c_he->hists, he, &hpp_list, out); in print_pareto()
2341 struct c2c_hist_entry *c2c_he; in perf_c2c__browse_cacheline() local
2358 c2c_he = container_of(he, struct c2c_hist_entry, he); in perf_c2c__browse_cacheline()
2359 c2c_hists = c2c_he->hists; in perf_c2c__browse_cacheline()