Lines Matching refs:c2c_he
134 struct c2c_hist_entry *c2c_he; in c2c_he_zalloc() local
136 c2c_he = zalloc(size + sizeof(*c2c_he)); in c2c_he_zalloc()
137 if (!c2c_he) in c2c_he_zalloc()
140 c2c_he->cpuset = bitmap_alloc(c2c.cpus_cnt); in c2c_he_zalloc()
141 if (!c2c_he->cpuset) in c2c_he_zalloc()
144 c2c_he->nodeset = bitmap_alloc(c2c.nodes_cnt); in c2c_he_zalloc()
145 if (!c2c_he->nodeset) in c2c_he_zalloc()
148 c2c_he->node_stats = zalloc(c2c.nodes_cnt * sizeof(*c2c_he->node_stats)); in c2c_he_zalloc()
149 if (!c2c_he->node_stats) in c2c_he_zalloc()
152 init_stats(&c2c_he->cstats.lcl_hitm); in c2c_he_zalloc()
153 init_stats(&c2c_he->cstats.rmt_hitm); in c2c_he_zalloc()
154 init_stats(&c2c_he->cstats.load); in c2c_he_zalloc()
156 return &c2c_he->he; in c2c_he_zalloc()
161 struct c2c_hist_entry *c2c_he; in c2c_he_free() local
163 c2c_he = container_of(he, struct c2c_hist_entry, he); in c2c_he_free()
164 if (c2c_he->hists) { in c2c_he_free()
165 hists__delete_entries(&c2c_he->hists->hists); in c2c_he_free()
166 free(c2c_he->hists); in c2c_he_free()
169 free(c2c_he->cpuset); in c2c_he_free()
170 free(c2c_he->nodeset); in c2c_he_free()
171 free(c2c_he->nodestr); in c2c_he_free()
172 free(c2c_he->node_stats); in c2c_he_free()
173 free(c2c_he); in c2c_he_free()
190 struct c2c_hist_entry *c2c_he; in he__get_c2c_hists() local
194 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__get_c2c_hists()
195 if (c2c_he->hists) in he__get_c2c_hists()
196 return c2c_he->hists; in he__get_c2c_hists()
198 hists = c2c_he->hists = zalloc(sizeof(*hists)); in he__get_c2c_hists()
211 static void c2c_he__set_cpu(struct c2c_hist_entry *c2c_he, in c2c_he__set_cpu() argument
218 set_bit(sample->cpu, c2c_he->cpuset); in c2c_he__set_cpu()
221 static void c2c_he__set_node(struct c2c_hist_entry *c2c_he, in c2c_he__set_node() argument
227 c2c_he->paddr_zero = true; in c2c_he__set_node()
235 set_bit(node, c2c_he->nodeset); in c2c_he__set_node()
237 if (c2c_he->paddr != sample->phys_addr) { in c2c_he__set_node()
238 c2c_he->paddr_cnt++; in c2c_he__set_node()
239 c2c_he->paddr = sample->phys_addr; in c2c_he__set_node()
243 static void compute_stats(struct c2c_hist_entry *c2c_he, in compute_stats() argument
247 struct compute_stats *cstats = &c2c_he->cstats; in compute_stats()
264 struct c2c_hist_entry *c2c_he; in process_sample_event() local
304 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
305 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
308 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
309 c2c_he__set_node(c2c_he, sample); in process_sample_event()
338 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
339 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
341 c2c_add_stats(&c2c_he->node_stats[node], &stats); in process_sample_event()
343 compute_stats(c2c_he, &stats, sample->weight); in process_sample_event()
345 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
346 c2c_he__set_node(c2c_he, sample); in process_sample_event()
513 struct c2c_hist_entry *c2c_he; in dcacheline_node_entry() local
516 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_entry()
517 if (WARN_ON_ONCE(!c2c_he->nodestr)) in dcacheline_node_entry()
520 return scnprintf(hpp->buf, hpp->size, "%*s", width, c2c_he->nodestr); in dcacheline_node_entry()
527 struct c2c_hist_entry *c2c_he; in dcacheline_node_count() local
530 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_count()
531 return scnprintf(hpp->buf, hpp->size, "%*lu", width, c2c_he->paddr_cnt); in dcacheline_node_count()
586 struct c2c_hist_entry *c2c_he; in tot_hitm_entry() local
590 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_hitm_entry()
591 tot_hitm = c2c_he->stats.lcl_hitm + c2c_he->stats.rmt_hitm; in tot_hitm_entry()
619 struct c2c_hist_entry *c2c_he; \
622 c2c_he = container_of(he, struct c2c_hist_entry, he); \
624 c2c_he->stats.__f); \
682 struct c2c_hist_entry *c2c_he; in tot_recs_entry() local
686 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_recs_entry()
687 tot_recs = total_records(&c2c_he->stats); in tot_recs_entry()
733 struct c2c_hist_entry *c2c_he; in tot_loads_entry() local
737 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_loads_entry()
738 tot_recs = total_loads(&c2c_he->stats); in tot_loads_entry()
767 struct c2c_hist_entry *c2c_he; in percent_color() local
771 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_color()
772 per = get_percent(c2c_he); in percent_color()
781 static double percent_hitm(struct c2c_hist_entry *c2c_he) in percent_hitm() argument
789 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in percent_hitm()
790 stats = &c2c_he->stats; in percent_hitm()
824 struct c2c_hist_entry *c2c_he; in percent_hitm_entry() local
829 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_hitm_entry()
830 per = percent_hitm(c2c_he); in percent_hitm_entry()
861 struct c2c_hist_entry *c2c_he; in he_stats() local
863 c2c_he = container_of(he, struct c2c_hist_entry, he); in he_stats()
864 return &c2c_he->stats; in he_stats()
883 static double percent_ ## __f(struct c2c_hist_entry *c2c_he) \
887 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); \
888 return percent(c2c_he->stats.__f, hists->stats.__f); \
1051 struct c2c_hist_entry *c2c_he; in node_entry() local
1056 c2c_he = container_of(he, struct c2c_hist_entry, he); in node_entry()
1062 bitmap_and(set, c2c_he->cpuset, c2c.nodes[node], c2c.cpus_cnt); in node_entry()
1085 struct c2c_stats *stats = &c2c_he->node_stats[node]; in node_entry()
1091 if (c2c_he->stats.__h> 0) { \ in node_entry()
1093 percent(stats->__h, c2c_he->stats.__h));\ in node_entry()
1115 if (c2c_he->stats.store > 0) { in node_entry()
1117 percent(stats->store, c2c_he->stats.store)); in node_entry()
1160 struct c2c_hist_entry *c2c_he; \
1161 c2c_he = container_of(he, struct c2c_hist_entry, he); \
1162 return mean_entry(fmt, hpp, he, avg_stats(&c2c_he->cstats.__val)); \
1173 struct c2c_hist_entry *c2c_he; in cpucnt_entry() local
1177 c2c_he = container_of(he, struct c2c_hist_entry, he); in cpucnt_entry()
1179 scnprintf(buf, 10, "%d", bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt)); in cpucnt_entry()
1187 struct c2c_hist_entry *c2c_he; in cl_idx_entry() local
1191 c2c_he = container_of(he, struct c2c_hist_entry, he); in cl_idx_entry()
1193 scnprintf(buf, 10, "%u", c2c_he->cacheline_idx); in cl_idx_entry()
1852 struct c2c_hist_entry *c2c_he; in he__display() local
1858 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__display()
1862 ld_dist = ((double)c2c_he->stats.__h / stats->__h); \ in he__display()
1889 struct c2c_hist_entry *c2c_he; in valid_hitm_or_store() local
1892 c2c_he = container_of(he, struct c2c_hist_entry, he); in valid_hitm_or_store()
1893 has_hitm = c2c.display == DISPLAY_TOT ? c2c_he->stats.tot_hitm : in valid_hitm_or_store()
1894 c2c.display == DISPLAY_LCL ? c2c_he->stats.lcl_hitm : in valid_hitm_or_store()
1895 c2c_he->stats.rmt_hitm; in valid_hitm_or_store()
1896 return has_hitm || c2c_he->stats.store; in valid_hitm_or_store()
1899 static void set_node_width(struct c2c_hist_entry *c2c_he, int len) in set_node_width() argument
1903 dim = &c2c.hists == c2c_he->hists ? in set_node_width()
1910 static int set_nodestr(struct c2c_hist_entry *c2c_he) in set_nodestr() argument
1915 if (c2c_he->nodestr) in set_nodestr()
1918 if (bitmap_weight(c2c_he->nodeset, c2c.nodes_cnt)) { in set_nodestr()
1919 len = bitmap_scnprintf(c2c_he->nodeset, c2c.nodes_cnt, in set_nodestr()
1925 set_node_width(c2c_he, len); in set_nodestr()
1926 c2c_he->nodestr = strdup(buf); in set_nodestr()
1927 return c2c_he->nodestr ? 0 : -ENOMEM; in set_nodestr()
1930 static void calc_width(struct c2c_hist_entry *c2c_he) in calc_width() argument
1934 c2c_hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in calc_width()
1935 hists__calc_col_len(&c2c_hists->hists, &c2c_he->he); in calc_width()
1936 set_nodestr(c2c_he); in calc_width()
1941 struct c2c_hist_entry *c2c_he; in filter_cb() local
1943 c2c_he = container_of(he, struct c2c_hist_entry, he); in filter_cb()
1948 calc_width(c2c_he); in filter_cb()
1958 struct c2c_hist_entry *c2c_he; in resort_cl_cb() local
1962 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_cl_cb()
1963 c2c_hists = c2c_he->hists; in resort_cl_cb()
1968 c2c_he->cacheline_idx = idx++; in resort_cl_cb()
1969 calc_width(c2c_he); in resort_cl_cb()
2049 struct c2c_hist_entry *c2c_he; in resort_hitm_cb() local
2050 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_hitm_cb()
2052 if (HAS_HITMS(c2c_he)) { in resort_hitm_cb()
2054 c2c_add_stats(&c2c.hitm_stats, &c2c_he->stats); in resort_hitm_cb()
2193 struct c2c_hist_entry *c2c_he; in print_pareto() local
2198 c2c_he = container_of(he, struct c2c_hist_entry, he); in print_pareto()
2199 print_cacheline(c2c_he->hists, he, &hpp_list, out); in print_pareto()
2311 struct c2c_hist_entry *c2c_he; in perf_c2c__browse_cacheline() local
2328 c2c_he = container_of(he, struct c2c_hist_entry, he); in perf_c2c__browse_cacheline()
2329 c2c_hists = c2c_he->hists; in perf_c2c__browse_cacheline()