Lines Matching defs:c2c_he

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