Lines Matching refs:c2c_he

141 	struct c2c_hist_entry *c2c_he;  in c2c_he_zalloc()  local
143 c2c_he = zalloc(size + sizeof(*c2c_he)); in c2c_he_zalloc()
144 if (!c2c_he) in c2c_he_zalloc()
147 c2c_he->cpuset = bitmap_zalloc(c2c.cpus_cnt); in c2c_he_zalloc()
148 if (!c2c_he->cpuset) in c2c_he_zalloc()
151 c2c_he->nodeset = bitmap_zalloc(c2c.nodes_cnt); in c2c_he_zalloc()
152 if (!c2c_he->nodeset) in c2c_he_zalloc()
155 c2c_he->node_stats = zalloc(c2c.nodes_cnt * sizeof(*c2c_he->node_stats)); in c2c_he_zalloc()
156 if (!c2c_he->node_stats) in c2c_he_zalloc()
159 init_stats(&c2c_he->cstats.lcl_hitm); in c2c_he_zalloc()
160 init_stats(&c2c_he->cstats.rmt_hitm); in c2c_he_zalloc()
161 init_stats(&c2c_he->cstats.lcl_peer); in c2c_he_zalloc()
162 init_stats(&c2c_he->cstats.rmt_peer); in c2c_he_zalloc()
163 init_stats(&c2c_he->cstats.load); in c2c_he_zalloc()
165 return &c2c_he->he; in c2c_he_zalloc()
168 free(c2c_he->nodeset); in c2c_he_zalloc()
169 free(c2c_he->cpuset); in c2c_he_zalloc()
170 free(c2c_he); in c2c_he_zalloc()
176 struct c2c_hist_entry *c2c_he; in c2c_he_free() local
178 c2c_he = container_of(he, struct c2c_hist_entry, he); in c2c_he_free()
179 if (c2c_he->hists) { in c2c_he_free()
180 hists__delete_entries(&c2c_he->hists->hists); in c2c_he_free()
181 free(c2c_he->hists); in c2c_he_free()
184 free(c2c_he->cpuset); in c2c_he_free()
185 free(c2c_he->nodeset); in c2c_he_free()
186 free(c2c_he->nodestr); in c2c_he_free()
187 free(c2c_he->node_stats); in c2c_he_free()
188 free(c2c_he); in c2c_he_free()
205 struct c2c_hist_entry *c2c_he; in he__get_c2c_hists() local
209 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__get_c2c_hists()
210 if (c2c_he->hists) in he__get_c2c_hists()
211 return c2c_he->hists; in he__get_c2c_hists()
213 hists = c2c_he->hists = zalloc(sizeof(*hists)); in he__get_c2c_hists()
226 static void c2c_he__set_cpu(struct c2c_hist_entry *c2c_he, in c2c_he__set_cpu() argument
233 set_bit(sample->cpu, c2c_he->cpuset); in c2c_he__set_cpu()
236 static void c2c_he__set_node(struct c2c_hist_entry *c2c_he, in c2c_he__set_node() argument
242 c2c_he->paddr_zero = true; in c2c_he__set_node()
250 set_bit(node, c2c_he->nodeset); in c2c_he__set_node()
252 if (c2c_he->paddr != sample->phys_addr) { in c2c_he__set_node()
253 c2c_he->paddr_cnt++; in c2c_he__set_node()
254 c2c_he->paddr = sample->phys_addr; in c2c_he__set_node()
258 static void compute_stats(struct c2c_hist_entry *c2c_he, in compute_stats() argument
262 struct compute_stats *cstats = &c2c_he->cstats; in compute_stats()
283 struct c2c_hist_entry *c2c_he; in process_sample_event() local
323 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
324 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
327 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
328 c2c_he__set_node(c2c_he, sample); in process_sample_event()
357 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
358 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
360 c2c_add_stats(&c2c_he->node_stats[node], &stats); in process_sample_event()
362 compute_stats(c2c_he, &stats, sample->weight); in process_sample_event()
364 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
365 c2c_he__set_node(c2c_he, sample); in process_sample_event()
536 struct c2c_hist_entry *c2c_he; in dcacheline_node_entry() local
539 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_entry()
540 if (WARN_ON_ONCE(!c2c_he->nodestr)) in dcacheline_node_entry()
543 return scnprintf(hpp->buf, hpp->size, "%*s", width, c2c_he->nodestr); in dcacheline_node_entry()
550 struct c2c_hist_entry *c2c_he; in dcacheline_node_count() local
553 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_count()
554 return scnprintf(hpp->buf, hpp->size, "%*lu", width, c2c_he->paddr_cnt); in dcacheline_node_count()
609 struct c2c_hist_entry *c2c_he; in tot_hitm_entry() local
613 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_hitm_entry()
614 tot_hitm = c2c_he->stats.lcl_hitm + c2c_he->stats.rmt_hitm; in tot_hitm_entry()
642 struct c2c_hist_entry *c2c_he; \
645 c2c_he = container_of(he, struct c2c_hist_entry, he); \
647 c2c_he->stats.__f); \
717 struct c2c_hist_entry *c2c_he; in tot_recs_entry() local
721 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_recs_entry()
722 tot_recs = total_records(&c2c_he->stats); in tot_recs_entry()
755 struct c2c_hist_entry *c2c_he; in tot_loads_entry() local
759 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_loads_entry()
760 tot_recs = total_loads(&c2c_he->stats); in tot_loads_entry()
789 struct c2c_hist_entry *c2c_he; in percent_color() local
793 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_color()
794 per = get_percent(c2c_he); in percent_color()
803 static double percent_costly_snoop(struct c2c_hist_entry *c2c_he) in percent_costly_snoop() argument
811 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in percent_costly_snoop()
812 stats = &c2c_he->stats; in percent_costly_snoop()
851 struct c2c_hist_entry *c2c_he; in percent_costly_snoop_entry() local
856 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_costly_snoop_entry()
857 per = percent_costly_snoop(c2c_he); in percent_costly_snoop_entry()
888 struct c2c_hist_entry *c2c_he; in he_stats() local
890 c2c_he = container_of(he, struct c2c_hist_entry, he); in he_stats()
891 return &c2c_he->stats; in he_stats()
910 static double percent_ ## __f(struct c2c_hist_entry *c2c_he) \
914 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); \
915 return percent(c2c_he->stats.__f, hists->stats.__f); \
1187 struct c2c_hist_entry *c2c_he; in node_entry() local
1192 c2c_he = container_of(he, struct c2c_hist_entry, he); in node_entry()
1198 bitmap_and(set, c2c_he->cpuset, c2c.nodes[node], c2c.cpus_cnt); in node_entry()
1221 struct c2c_stats *stats = &c2c_he->node_stats[node]; in node_entry()
1229 c2c_he->stats.rmt_hitm); in node_entry()
1233 c2c_he->stats.lcl_hitm); in node_entry()
1237 c2c_he->stats.tot_hitm); in node_entry()
1241 c2c_he->stats.tot_peer); in node_entry()
1249 if (c2c_he->stats.store > 0) { in node_entry()
1251 percent(stats->store, c2c_he->stats.store)); in node_entry()
1294 struct c2c_hist_entry *c2c_he; \
1295 c2c_he = container_of(he, struct c2c_hist_entry, he); \
1296 return mean_entry(fmt, hpp, he, avg_stats(&c2c_he->cstats.__val)); \
1309 struct c2c_hist_entry *c2c_he; in cpucnt_entry() local
1313 c2c_he = container_of(he, struct c2c_hist_entry, he); in cpucnt_entry()
1315 scnprintf(buf, 10, "%d", bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt)); in cpucnt_entry()
1323 struct c2c_hist_entry *c2c_he; in cl_idx_entry() local
1327 c2c_he = container_of(he, struct c2c_hist_entry, he); in cl_idx_entry()
1329 scnprintf(buf, 10, "%u", c2c_he->cacheline_idx); in cl_idx_entry()
2102 struct c2c_hist_entry *c2c_he; in he__display() local
2107 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__display()
2111 he->filtered = filter_display(c2c_he->stats.lcl_hitm, in he__display()
2115 he->filtered = filter_display(c2c_he->stats.rmt_hitm, in he__display()
2119 he->filtered = filter_display(c2c_he->stats.tot_hitm, in he__display()
2123 he->filtered = filter_display(c2c_he->stats.tot_peer, in he__display()
2135 struct c2c_hist_entry *c2c_he; in is_valid_hist_entry() local
2138 c2c_he = container_of(he, struct c2c_hist_entry, he); in is_valid_hist_entry()
2141 if (c2c_he->stats.store) in is_valid_hist_entry()
2146 has_record = !!c2c_he->stats.lcl_hitm; in is_valid_hist_entry()
2149 has_record = !!c2c_he->stats.rmt_hitm; in is_valid_hist_entry()
2152 has_record = !!c2c_he->stats.tot_hitm; in is_valid_hist_entry()
2155 has_record = !!c2c_he->stats.tot_peer; in is_valid_hist_entry()
2163 static void set_node_width(struct c2c_hist_entry *c2c_he, int len) in set_node_width() argument
2167 dim = &c2c.hists == c2c_he->hists ? in set_node_width()
2174 static int set_nodestr(struct c2c_hist_entry *c2c_he) in set_nodestr() argument
2179 if (c2c_he->nodestr) in set_nodestr()
2182 if (!bitmap_empty(c2c_he->nodeset, c2c.nodes_cnt)) { in set_nodestr()
2183 len = bitmap_scnprintf(c2c_he->nodeset, c2c.nodes_cnt, in set_nodestr()
2189 set_node_width(c2c_he, len); in set_nodestr()
2190 c2c_he->nodestr = strdup(buf); in set_nodestr()
2191 return c2c_he->nodestr ? 0 : -ENOMEM; in set_nodestr()
2194 static void calc_width(struct c2c_hist_entry *c2c_he) in calc_width() argument
2198 c2c_hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in calc_width()
2199 hists__calc_col_len(&c2c_hists->hists, &c2c_he->he); in calc_width()
2200 set_nodestr(c2c_he); in calc_width()
2205 struct c2c_hist_entry *c2c_he; in filter_cb() local
2207 c2c_he = container_of(he, struct c2c_hist_entry, he); in filter_cb()
2212 calc_width(c2c_he); in filter_cb()
2222 struct c2c_hist_entry *c2c_he; in resort_cl_cb() local
2226 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_cl_cb()
2227 c2c_hists = c2c_he->hists; in resort_cl_cb()
2232 c2c_he->cacheline_idx = idx++; in resort_cl_cb()
2233 calc_width(c2c_he); in resort_cl_cb()
2339 struct c2c_hist_entry *c2c_he; in resort_shared_cl_cb() local
2340 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_shared_cl_cb()
2342 if (HAS_HITMS(c2c_he) || HAS_PEER(c2c_he)) { in resort_shared_cl_cb()
2344 c2c_add_stats(&c2c.shared_clines_stats, &c2c_he->stats); in resort_shared_cl_cb()
2499 struct c2c_hist_entry *c2c_he; in print_pareto() local
2504 c2c_he = container_of(he, struct c2c_hist_entry, he); in print_pareto()
2505 print_cacheline(c2c_he->hists, he, &hpp_list, out); in print_pareto()
2617 struct c2c_hist_entry *c2c_he; in perf_c2c__browse_cacheline() local
2634 c2c_he = container_of(he, struct c2c_hist_entry, he); in perf_c2c__browse_cacheline()
2635 c2c_hists = c2c_he->hists; in perf_c2c__browse_cacheline()