Lines Matching refs:evsel

4 #include "evsel.h"
55 static int evsel_context(const struct evsel *evsel)
59 if (evsel->core.attr.exclude_kernel)
61 if (evsel->core.attr.exclude_user)
63 if (evsel->core.attr.exclude_hv)
65 if (evsel->core.attr.exclude_host)
67 if (evsel->core.attr.exclude_idle)
79 static enum stat_type evsel__stat_type(const struct evsel *evsel)
98 if (evsel__is_clock(evsel))
100 else if (evsel__match(evsel, HARDWARE, HW_CPU_CYCLES))
102 else if (evsel__match(evsel, HARDWARE, HW_INSTRUCTIONS))
104 else if (evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_FRONTEND))
106 else if (evsel__match(evsel, HARDWARE, HW_STALLED_CYCLES_BACKEND))
108 else if (evsel__match(evsel, HARDWARE, HW_BRANCH_INSTRUCTIONS))
110 else if (evsel__match(evsel, HARDWARE, HW_BRANCH_MISSES))
112 else if (evsel__match(evsel, HARDWARE, HW_CACHE_REFERENCES))
114 else if (evsel__match(evsel, HARDWARE, HW_CACHE_MISSES))
116 else if (evsel__match(evsel, HW_CACHE, HW_CACHE_L1D))
118 else if (evsel__match(evsel, HW_CACHE, HW_CACHE_L1I))
120 else if (evsel__match(evsel, HW_CACHE, HW_CACHE_LL))
122 else if (evsel__match(evsel, HW_CACHE, HW_CACHE_DTLB))
124 else if (evsel__match(evsel, HW_CACHE, HW_CACHE_ITLB))
126 else if (evsel__match(evsel, HW_CACHE, hw_cache_l1d_miss))
128 else if (evsel__match(evsel, HW_CACHE, hw_cache_l1i_miss))
130 else if (evsel__match(evsel, HW_CACHE, hw_cache_ll_miss))
132 else if (evsel__match(evsel, HW_CACHE, hw_cache_dtlb_miss))
134 else if (evsel__match(evsel, HW_CACHE, hw_cache_itlb_miss))
153 static double find_stat(const struct evsel *evsel, int aggr_idx, enum stat_type type)
155 const struct evsel *cur;
156 int evsel_ctx = evsel_context(evsel);
158 evlist__for_each_entry(evsel->evlist, cur) {
161 /* Ignore the evsel that is being searched from. */
162 if (evsel == cur)
166 if (evsel->core.leader->nr_members > 1 &&
167 evsel->core.leader != cur->core.leader)
173 if (evsel->cgrp != cur->cgrp)
188 const struct evsel *evsel, int aggr_idx,
193 double denominator = find_stat(evsel, aggr_idx, denominator_type);
205 const struct evsel *evsel,
211 print_ratio(config, evsel, aggr_idx, stalled, out, STAT_CYCLES, color_ratios,
216 const struct evsel *evsel,
222 print_ratio(config, evsel, aggr_idx, stalled, out, STAT_CYCLES, color_ratios,
227 const struct evsel *evsel,
233 print_ratio(config, evsel, aggr_idx, misses, out, STAT_BRANCHES, color_ratios,
238 const struct evsel *evsel,
244 print_ratio(config, evsel, aggr_idx, misses, out, STAT_L1_DCACHE, color_ratios,
249 const struct evsel *evsel,
255 print_ratio(config, evsel, aggr_idx, misses, out, STAT_L1_ICACHE, color_ratios,
260 const struct evsel *evsel,
266 print_ratio(config, evsel, aggr_idx, misses, out, STAT_LL_CACHE, color_ratios,
271 const struct evsel *evsel,
277 print_ratio(config, evsel, aggr_idx, misses, out, STAT_DTLB_CACHE, color_ratios,
282 const struct evsel *evsel,
288 print_ratio(config, evsel, aggr_idx, misses, out, STAT_ITLB_CACHE, color_ratios,
293 const struct evsel *evsel,
299 print_ratio(config, evsel, aggr_idx, misses, out, STAT_CACHE_REFS, color_ratios,
304 const struct evsel *evsel,
310 double cycles = find_stat(evsel, aggr_idx, STAT_CYCLES);
311 double max_stalled = max(find_stat(evsel, aggr_idx, STAT_STALLED_CYCLES_FRONT),
312 find_stat(evsel, aggr_idx, STAT_STALLED_CYCLES_BACK));
328 const struct evsel *evsel,
332 double nsecs = find_stat(evsel, aggr_idx, STAT_NSECS);
343 const struct evsel *evsel,
353 nsecs / (wall_time * evsel->scale));
358 static int prepare_metric(struct evsel **metric_events,
441 struct evsel **metric_events,
538 struct evsel *evsel,
556 if (!need_full_name || !strcmp(last_pmu, evsel->pmu_name)) {
563 scnprintf(full_name, sizeof(full_name), "%s (%s)", name, evsel->pmu_name);
570 last_pmu = evsel->pmu_name;
574 * perf_stat__print_shadow_stats_metricgroup - Print out metrics associated with the evsel
576 * with the evsel are printed.
585 struct evsel *evsel,
598 me = metricgroup__lookup(metric_events, evsel, false);
621 perf_stat__print_metricgroup_header(config, evsel, ctxp,
629 mexp->metric_events, mexp->metric_refs, evsel->name,
638 struct evsel *evsel,
644 const struct evsel *evsel,
666 iostat_print_metric(config, evsel, out);
668 stat_print_function_t fn = stat_print_function[evsel__stat_type(evsel)];
671 fn(config, evsel, aggr_idx, avg, out);
673 double nsecs = find_stat(evsel, aggr_idx, STAT_NSECS);
689 perf_stat__print_shadow_stats_metricgroup(config, evsel, aggr_idx,
697 * perf_stat__skip_metric_event - Skip the evsel in the Default metricgroup,
700 bool perf_stat__skip_metric_event(struct evsel *evsel,
704 if (!evsel->default_metricgroup)
710 return !metricgroup__lookup(metric_events, evsel, false);