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