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));
359 const struct evsel *evsel,
363 struct evsel * const *metric_events = mexp->metric_events;
410 if (evsel && evsel->metric_leader &&
411 evsel->pmu != evsel->metric_leader->pmu &&
412 mexp->metric_events[i]->pmu == evsel->metric_leader->pmu) {
413 struct evsel *pos;
415 evlist__for_each_entry(evsel->evlist, pos) {
416 if (pos->pmu != evsel->pmu)
464 struct evsel *evsel,
473 struct evsel * const *metric_events = mexp->metric_events;
489 i = prepare_metric(mexp, evsel, pctx, aggr_idx);
524 out->force_header ? evsel->name : "",
530 (metric_name ?: evsel->name) : "", 0);
535 (metric_name ?: evsel->name) : "", 0);
550 if (prepare_metric(mexp, /*evsel=*/NULL, pctx, aggr_idx) < 0)
562 struct evsel *evsel,
580 if (!need_full_name || !strcmp(last_pmu, evsel->pmu_name)) {
587 scnprintf(full_name, sizeof(full_name), "%s (%s)", name, evsel->pmu_name);
594 last_pmu = evsel->pmu_name;
598 * perf_stat__print_shadow_stats_metricgroup - Print out metrics associated with the evsel
600 * with the evsel are printed.
609 struct evsel *evsel,
622 me = metricgroup__lookup(metric_events, evsel, false);
645 perf_stat__print_metricgroup_header(config, evsel, ctxp,
652 generic_metric(config, mexp, evsel, aggr_idx, out);
659 struct evsel *evsel,
665 const struct evsel *evsel,
687 iostat_print_metric(config, evsel, out);
689 stat_print_function_t fn = stat_print_function[evsel__stat_type(evsel)];
692 fn(config, evsel, aggr_idx, avg, out);
694 double nsecs = find_stat(evsel, aggr_idx, STAT_NSECS);
710 perf_stat__print_shadow_stats_metricgroup(config, evsel, aggr_idx,
718 * perf_stat__skip_metric_event - Skip the evsel in the Default metricgroup,
721 bool perf_stat__skip_metric_event(struct evsel *evsel,
725 if (!evsel->default_metricgroup)
731 return !metricgroup__lookup(metric_events, evsel, false);