Lines Matching refs:c2c_he

140 	struct c2c_hist_entry *c2c_he;  in c2c_he_zalloc()  local
142 c2c_he = zalloc(size + sizeof(*c2c_he)); in c2c_he_zalloc()
143 if (!c2c_he) in c2c_he_zalloc()
146 c2c_he->cpuset = bitmap_zalloc(c2c.cpus_cnt); in c2c_he_zalloc()
147 if (!c2c_he->cpuset) in c2c_he_zalloc()
150 c2c_he->nodeset = bitmap_zalloc(c2c.nodes_cnt); in c2c_he_zalloc()
151 if (!c2c_he->nodeset) in c2c_he_zalloc()
154 c2c_he->node_stats = zalloc(c2c.nodes_cnt * sizeof(*c2c_he->node_stats)); in c2c_he_zalloc()
155 if (!c2c_he->node_stats) in c2c_he_zalloc()
158 init_stats(&c2c_he->cstats.lcl_hitm); in c2c_he_zalloc()
159 init_stats(&c2c_he->cstats.rmt_hitm); in c2c_he_zalloc()
160 init_stats(&c2c_he->cstats.lcl_peer); in c2c_he_zalloc()
161 init_stats(&c2c_he->cstats.rmt_peer); in c2c_he_zalloc()
162 init_stats(&c2c_he->cstats.load); in c2c_he_zalloc()
164 return &c2c_he->he; in c2c_he_zalloc()
167 zfree(&c2c_he->nodeset); in c2c_he_zalloc()
168 zfree(&c2c_he->cpuset); in c2c_he_zalloc()
169 free(c2c_he); in c2c_he_zalloc()
175 struct c2c_hist_entry *c2c_he; in c2c_he_free() local
177 c2c_he = container_of(he, struct c2c_hist_entry, he); in c2c_he_free()
178 if (c2c_he->hists) { in c2c_he_free()
179 hists__delete_entries(&c2c_he->hists->hists); in c2c_he_free()
180 zfree(&c2c_he->hists); in c2c_he_free()
183 zfree(&c2c_he->cpuset); in c2c_he_free()
184 zfree(&c2c_he->nodeset); in c2c_he_free()
185 zfree(&c2c_he->nodestr); in c2c_he_free()
186 zfree(&c2c_he->node_stats); in c2c_he_free()
187 free(c2c_he); in c2c_he_free()
204 struct c2c_hist_entry *c2c_he; in he__get_c2c_hists() local
208 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__get_c2c_hists()
209 if (c2c_he->hists) in he__get_c2c_hists()
210 return c2c_he->hists; in he__get_c2c_hists()
212 hists = c2c_he->hists = zalloc(sizeof(*hists)); in he__get_c2c_hists()
225 static void c2c_he__set_cpu(struct c2c_hist_entry *c2c_he, in c2c_he__set_cpu() argument
232 __set_bit(sample->cpu, c2c_he->cpuset); in c2c_he__set_cpu()
235 static void c2c_he__set_node(struct c2c_hist_entry *c2c_he, in c2c_he__set_node() argument
241 c2c_he->paddr_zero = true; in c2c_he__set_node()
249 __set_bit(node, c2c_he->nodeset); in c2c_he__set_node()
251 if (c2c_he->paddr != sample->phys_addr) { in c2c_he__set_node()
252 c2c_he->paddr_cnt++; in c2c_he__set_node()
253 c2c_he->paddr = sample->phys_addr; in c2c_he__set_node()
257 static void compute_stats(struct c2c_hist_entry *c2c_he, in compute_stats() argument
261 struct compute_stats *cstats = &c2c_he->cstats; in compute_stats()
282 struct c2c_hist_entry *c2c_he; in process_sample_event() local
328 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
329 c2c_add_stats(&c2c_he->stats, &stats); 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()
362 c2c_he = container_of(he, struct c2c_hist_entry, he); in process_sample_event()
363 c2c_add_stats(&c2c_he->stats, &stats); in process_sample_event()
365 c2c_add_stats(&c2c_he->node_stats[node], &stats); in process_sample_event()
367 compute_stats(c2c_he, &stats, sample->weight); in process_sample_event()
369 c2c_he__set_cpu(c2c_he, sample); in process_sample_event()
370 c2c_he__set_node(c2c_he, sample); in process_sample_event()
541 struct c2c_hist_entry *c2c_he; in dcacheline_node_entry() local
544 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_entry()
545 if (WARN_ON_ONCE(!c2c_he->nodestr)) in dcacheline_node_entry()
548 return scnprintf(hpp->buf, hpp->size, "%*s", width, c2c_he->nodestr); in dcacheline_node_entry()
555 struct c2c_hist_entry *c2c_he; in dcacheline_node_count() local
558 c2c_he = container_of(he, struct c2c_hist_entry, he); in dcacheline_node_count()
559 return scnprintf(hpp->buf, hpp->size, "%*lu", width, c2c_he->paddr_cnt); in dcacheline_node_count()
615 struct c2c_hist_entry *c2c_he; in tot_hitm_entry() local
619 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_hitm_entry()
620 tot_hitm = c2c_he->stats.lcl_hitm + c2c_he->stats.rmt_hitm; in tot_hitm_entry()
648 struct c2c_hist_entry *c2c_he; \
651 c2c_he = container_of(he, struct c2c_hist_entry, he); \
653 c2c_he->stats.__f); \
723 struct c2c_hist_entry *c2c_he; in tot_recs_entry() local
727 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_recs_entry()
728 tot_recs = total_records(&c2c_he->stats); in tot_recs_entry()
761 struct c2c_hist_entry *c2c_he; in tot_loads_entry() local
765 c2c_he = container_of(he, struct c2c_hist_entry, he); in tot_loads_entry()
766 tot_recs = total_loads(&c2c_he->stats); in tot_loads_entry()
795 struct c2c_hist_entry *c2c_he; in percent_color() local
799 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_color()
800 per = get_percent(c2c_he); in percent_color()
809 static double percent_costly_snoop(struct c2c_hist_entry *c2c_he) in percent_costly_snoop() argument
817 hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in percent_costly_snoop()
818 stats = &c2c_he->stats; in percent_costly_snoop()
857 struct c2c_hist_entry *c2c_he; in percent_costly_snoop_entry() local
862 c2c_he = container_of(he, struct c2c_hist_entry, he); in percent_costly_snoop_entry()
863 per = percent_costly_snoop(c2c_he); in percent_costly_snoop_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); \
1193 struct c2c_hist_entry *c2c_he; in node_entry() local
1198 c2c_he = container_of(he, struct c2c_hist_entry, he); in node_entry()
1204 bitmap_and(set, c2c_he->cpuset, c2c.nodes[node], c2c.cpus_cnt); in node_entry()
1227 struct c2c_stats *stats = &c2c_he->node_stats[node]; in node_entry()
1235 c2c_he->stats.rmt_hitm); in node_entry()
1239 c2c_he->stats.lcl_hitm); in node_entry()
1243 c2c_he->stats.tot_hitm); in node_entry()
1247 c2c_he->stats.tot_peer); in node_entry()
1255 if (c2c_he->stats.store > 0) { in node_entry()
1257 percent(stats->store, c2c_he->stats.store)); in node_entry()
1300 struct c2c_hist_entry *c2c_he; \
1301 c2c_he = container_of(he, struct c2c_hist_entry, he); \
1302 return mean_entry(fmt, hpp, he, avg_stats(&c2c_he->cstats.__val)); \
1315 struct c2c_hist_entry *c2c_he; in cpucnt_entry() local
1319 c2c_he = container_of(he, struct c2c_hist_entry, he); in cpucnt_entry()
1321 scnprintf(buf, 10, "%d", bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt)); in cpucnt_entry()
1329 struct c2c_hist_entry *c2c_he; in cl_idx_entry() local
1333 c2c_he = container_of(he, struct c2c_hist_entry, he); in cl_idx_entry()
1335 scnprintf(buf, 10, "%u", c2c_he->cacheline_idx); in cl_idx_entry()
2108 struct c2c_hist_entry *c2c_he; in he__display() local
2113 c2c_he = container_of(he, struct c2c_hist_entry, he); in he__display()
2117 he->filtered = filter_display(c2c_he->stats.lcl_hitm, in he__display()
2121 he->filtered = filter_display(c2c_he->stats.rmt_hitm, in he__display()
2125 he->filtered = filter_display(c2c_he->stats.tot_hitm, in he__display()
2129 he->filtered = filter_display(c2c_he->stats.tot_peer, in he__display()
2141 struct c2c_hist_entry *c2c_he; in is_valid_hist_entry() local
2144 c2c_he = container_of(he, struct c2c_hist_entry, he); in is_valid_hist_entry()
2147 if (c2c_he->stats.store) in is_valid_hist_entry()
2152 has_record = !!c2c_he->stats.lcl_hitm; in is_valid_hist_entry()
2155 has_record = !!c2c_he->stats.rmt_hitm; in is_valid_hist_entry()
2158 has_record = !!c2c_he->stats.tot_hitm; in is_valid_hist_entry()
2161 has_record = !!c2c_he->stats.tot_peer; in is_valid_hist_entry()
2169 static void set_node_width(struct c2c_hist_entry *c2c_he, int len) in set_node_width() argument
2173 dim = &c2c.hists == c2c_he->hists ? in set_node_width()
2180 static int set_nodestr(struct c2c_hist_entry *c2c_he) in set_nodestr() argument
2185 if (c2c_he->nodestr) in set_nodestr()
2188 if (!bitmap_empty(c2c_he->nodeset, c2c.nodes_cnt)) { in set_nodestr()
2189 len = bitmap_scnprintf(c2c_he->nodeset, c2c.nodes_cnt, in set_nodestr()
2195 set_node_width(c2c_he, len); in set_nodestr()
2196 c2c_he->nodestr = strdup(buf); in set_nodestr()
2197 return c2c_he->nodestr ? 0 : -ENOMEM; in set_nodestr()
2200 static void calc_width(struct c2c_hist_entry *c2c_he) in calc_width() argument
2204 c2c_hists = container_of(c2c_he->he.hists, struct c2c_hists, hists); in calc_width()
2205 hists__calc_col_len(&c2c_hists->hists, &c2c_he->he); in calc_width()
2206 set_nodestr(c2c_he); in calc_width()
2211 struct c2c_hist_entry *c2c_he; in filter_cb() local
2213 c2c_he = container_of(he, struct c2c_hist_entry, he); in filter_cb()
2218 calc_width(c2c_he); in filter_cb()
2228 struct c2c_hist_entry *c2c_he; in resort_cl_cb() local
2232 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_cl_cb()
2233 c2c_hists = c2c_he->hists; in resort_cl_cb()
2238 c2c_he->cacheline_idx = idx++; in resort_cl_cb()
2239 calc_width(c2c_he); in resort_cl_cb()
2345 struct c2c_hist_entry *c2c_he; in resort_shared_cl_cb() local
2346 c2c_he = container_of(he, struct c2c_hist_entry, he); in resort_shared_cl_cb()
2348 if (HAS_HITMS(c2c_he) || HAS_PEER(c2c_he)) { in resort_shared_cl_cb()
2350 c2c_add_stats(&c2c.shared_clines_stats, &c2c_he->stats); in resort_shared_cl_cb()
2505 struct c2c_hist_entry *c2c_he; in print_pareto() local
2510 c2c_he = container_of(he, struct c2c_hist_entry, he); in print_pareto()
2511 print_cacheline(c2c_he->hists, he, &hpp_list, out); in print_pareto()
2623 struct c2c_hist_entry *c2c_he; in perf_c2c__browse_cacheline() local
2640 c2c_he = container_of(he, struct c2c_hist_entry, he); in perf_c2c__browse_cacheline()
2641 c2c_hists = c2c_he->hists; in perf_c2c__browse_cacheline()