Lines Matching refs:c2c_he

133 	struct c2c_hist_entry *c2c_he;  in c2c_he_zalloc()  local
135 c2c_he = zalloc(size + sizeof(*c2c_he)); in c2c_he_zalloc()
136 if (!c2c_he) in c2c_he_zalloc()
139 c2c_he->cpuset = bitmap_alloc(c2c.cpus_cnt); in c2c_he_zalloc()
140 if (!c2c_he->cpuset) in c2c_he_zalloc()
143 c2c_he->nodeset = bitmap_alloc(c2c.nodes_cnt); in c2c_he_zalloc()
144 if (!c2c_he->nodeset) in c2c_he_zalloc()
147 c2c_he->node_stats = zalloc(c2c.nodes_cnt * sizeof(*c2c_he->node_stats)); in c2c_he_zalloc()
148 if (!c2c_he->node_stats) in c2c_he_zalloc()
151 init_stats(&c2c_he->cstats.lcl_hitm); in c2c_he_zalloc()
152 init_stats(&c2c_he->cstats.rmt_hitm); in c2c_he_zalloc()
153 init_stats(&c2c_he->cstats.load); in c2c_he_zalloc()
155 return &c2c_he->he; in c2c_he_zalloc()
160 struct c2c_hist_entry *c2c_he; in c2c_he_free() local
162 c2c_he = container_of(he, struct c2c_hist_entry, he); in c2c_he_free()
163 if (c2c_he->hists) { in c2c_he_free()
164 hists__delete_entries(&c2c_he->hists->hists); in c2c_he_free()
165 free(c2c_he->hists); in c2c_he_free()
168 free(c2c_he->cpuset); in c2c_he_free()
169 free(c2c_he->nodeset); in c2c_he_free()
170 free(c2c_he->nodestr); in c2c_he_free()
171 free(c2c_he->node_stats); in c2c_he_free()
172 free(c2c_he); in c2c_he_free()
189 struct c2c_hist_entry *c2c_he; in he__get_c2c_hists() local
193 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__get_c2c_hists()
194 if (c2c_he->hists) in he__get_c2c_hists()
195 return c2c_he->hists; in he__get_c2c_hists()
197 hists = c2c_he->hists = zalloc(sizeof(*hists)); in he__get_c2c_hists()
210 static void c2c_he__set_cpu(struct c2c_hist_entry *c2c_he, in c2c_he__set_cpu() argument
217 set_bit(sample->cpu, c2c_he->cpuset); in c2c_he__set_cpu()
220 static void c2c_he__set_node(struct c2c_hist_entry *c2c_he, in c2c_he__set_node() argument
226 c2c_he->paddr_zero = true; in c2c_he__set_node()
234 set_bit(node, c2c_he->nodeset); in c2c_he__set_node()
236 if (c2c_he->paddr != sample->phys_addr) { in c2c_he__set_node()
237 c2c_he->paddr_cnt++; in c2c_he__set_node()
238 c2c_he->paddr = sample->phys_addr; in c2c_he__set_node()
242 static void compute_stats(struct c2c_hist_entry *c2c_he, in compute_stats() argument
246 struct compute_stats *cstats = &c2c_he->cstats; in compute_stats()
263 struct c2c_hist_entry *c2c_he; in process_sample_event() local
300 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
301 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
304 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
305 c2c_he__set_node(c2c_he, sample); in process_sample_event()
334 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
335 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
337 c2c_add_stats(&c2c_he->node_stats[node], &stats); in process_sample_event()
339 compute_stats(c2c_he, &stats, sample->weight); in process_sample_event()
341 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
342 c2c_he__set_node(c2c_he, sample); in process_sample_event()
509 struct c2c_hist_entry *c2c_he; in dcacheline_node_entry() local
512 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_entry()
513 if (WARN_ON_ONCE(!c2c_he->nodestr)) in dcacheline_node_entry()
516 return scnprintf(hpp->buf, hpp->size, "%*s", width, c2c_he->nodestr); in dcacheline_node_entry()
523 struct c2c_hist_entry *c2c_he; in dcacheline_node_count() local
526 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_count()
527 return scnprintf(hpp->buf, hpp->size, "%*lu", width, c2c_he->paddr_cnt); in dcacheline_node_count()
582 struct c2c_hist_entry *c2c_he; in tot_hitm_entry() local
586 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_hitm_entry()
587 tot_hitm = c2c_he->stats.lcl_hitm + c2c_he->stats.rmt_hitm; in tot_hitm_entry()
615 struct c2c_hist_entry *c2c_he; \
618 c2c_he = container_of(he, struct c2c_hist_entry, he); \
620 c2c_he->stats.__f); \
666 struct c2c_hist_entry *c2c_he; in ld_llcmiss_entry() local
669 c2c_he = container_of(he, struct c2c_hist_entry, he); in ld_llcmiss_entry()
672 llc_miss(&c2c_he->stats)); in ld_llcmiss_entry()
715 struct c2c_hist_entry *c2c_he; in tot_recs_entry() local
719 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_recs_entry()
720 tot_recs = total_records(&c2c_he->stats); in tot_recs_entry()
766 struct c2c_hist_entry *c2c_he; in tot_loads_entry() local
770 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_loads_entry()
771 tot_recs = total_loads(&c2c_he->stats); in tot_loads_entry()
800 struct c2c_hist_entry *c2c_he; in percent_color() local
804 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_color()
805 per = get_percent(c2c_he); in percent_color()
814 static double percent_hitm(struct c2c_hist_entry *c2c_he) in percent_hitm() argument
822 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in percent_hitm()
823 stats = &c2c_he->stats; in percent_hitm()
857 struct c2c_hist_entry *c2c_he; in percent_hitm_entry() local
862 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_hitm_entry()
863 per = percent_hitm(c2c_he); in percent_hitm_entry()
894 struct c2c_hist_entry *c2c_he; in he_stats() local
896 c2c_he = container_of(he, struct c2c_hist_entry, he); in he_stats()
897 return &c2c_he->stats; in he_stats()
916 static double percent_ ## __f(struct c2c_hist_entry *c2c_he) \
920 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); \
921 return percent(c2c_he->stats.__f, hists->stats.__f); \
1084 struct c2c_hist_entry *c2c_he; in node_entry() local
1089 c2c_he = container_of(he, struct c2c_hist_entry, he); in node_entry()
1095 bitmap_and(set, c2c_he->cpuset, c2c.nodes[node], c2c.cpus_cnt); in node_entry()
1118 struct c2c_stats *stats = &c2c_he->node_stats[node]; in node_entry()
1124 if (c2c_he->stats.__h> 0) { \ in node_entry()
1126 percent(stats->__h, c2c_he->stats.__h));\ in node_entry()
1148 if (c2c_he->stats.store > 0) { in node_entry()
1150 percent(stats->store, c2c_he->stats.store)); in node_entry()
1193 struct c2c_hist_entry *c2c_he; \
1194 c2c_he = container_of(he, struct c2c_hist_entry, he); \
1195 return mean_entry(fmt, hpp, he, avg_stats(&c2c_he->cstats.__val)); \
1206 struct c2c_hist_entry *c2c_he; in cpucnt_entry() local
1210 c2c_he = container_of(he, struct c2c_hist_entry, he); in cpucnt_entry()
1212 scnprintf(buf, 10, "%d", bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt)); in cpucnt_entry()
1220 struct c2c_hist_entry *c2c_he; in cl_idx_entry() local
1224 c2c_he = container_of(he, struct c2c_hist_entry, he); in cl_idx_entry()
1226 scnprintf(buf, 10, "%u", c2c_he->cacheline_idx); in cl_idx_entry()
1894 struct c2c_hist_entry *c2c_he; in he__display() local
1900 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__display()
1904 ld_dist = ((double)c2c_he->stats.__h / stats->__h); \ in he__display()
1931 struct c2c_hist_entry *c2c_he; in valid_hitm_or_store() local
1934 c2c_he = container_of(he, struct c2c_hist_entry, he); in valid_hitm_or_store()
1935 has_hitm = c2c.display == DISPLAY_TOT ? c2c_he->stats.tot_hitm : in valid_hitm_or_store()
1936 c2c.display == DISPLAY_LCL ? c2c_he->stats.lcl_hitm : in valid_hitm_or_store()
1937 c2c_he->stats.rmt_hitm; in valid_hitm_or_store()
1938 return has_hitm || c2c_he->stats.store; in valid_hitm_or_store()
1941 static void set_node_width(struct c2c_hist_entry *c2c_he, int len) in set_node_width() argument
1945 dim = &c2c.hists == c2c_he->hists ? in set_node_width()
1952 static int set_nodestr(struct c2c_hist_entry *c2c_he) in set_nodestr() argument
1957 if (c2c_he->nodestr) in set_nodestr()
1960 if (bitmap_weight(c2c_he->nodeset, c2c.nodes_cnt)) { in set_nodestr()
1961 len = bitmap_scnprintf(c2c_he->nodeset, c2c.nodes_cnt, in set_nodestr()
1967 set_node_width(c2c_he, len); in set_nodestr()
1968 c2c_he->nodestr = strdup(buf); in set_nodestr()
1969 return c2c_he->nodestr ? 0 : -ENOMEM; in set_nodestr()
1972 static void calc_width(struct c2c_hist_entry *c2c_he) in calc_width() argument
1976 c2c_hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in calc_width()
1977 hists__calc_col_len(&c2c_hists->hists, &c2c_he->he); in calc_width()
1978 set_nodestr(c2c_he); in calc_width()
1983 struct c2c_hist_entry *c2c_he; in filter_cb() local
1985 c2c_he = container_of(he, struct c2c_hist_entry, he); in filter_cb()
1990 calc_width(c2c_he); in filter_cb()
2000 struct c2c_hist_entry *c2c_he; in resort_cl_cb() local
2004 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_cl_cb()
2005 c2c_hists = c2c_he->hists; in resort_cl_cb()
2010 c2c_he->cacheline_idx = idx++; in resort_cl_cb()
2011 calc_width(c2c_he); in resort_cl_cb()
2091 struct c2c_hist_entry *c2c_he; in resort_hitm_cb() local
2092 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_hitm_cb()
2094 if (HAS_HITMS(c2c_he)) { in resort_hitm_cb()
2096 c2c_add_stats(&c2c.hitm_stats, &c2c_he->stats); in resort_hitm_cb()
2235 struct c2c_hist_entry *c2c_he; in print_pareto() local
2240 c2c_he = container_of(he, struct c2c_hist_entry, he); in print_pareto()
2241 print_cacheline(c2c_he->hists, he, &hpp_list, out); in print_pareto()
2354 struct c2c_hist_entry *c2c_he; in perf_c2c__browse_cacheline() local
2371 c2c_he = container_of(he, struct c2c_hist_entry, he); in perf_c2c__browse_cacheline()
2372 c2c_hists = c2c_he->hists; in perf_c2c__browse_cacheline()