Lines Matching refs:evsel
70 bool __perf_evsel_stat__is(struct perf_evsel *evsel, in __perf_evsel_stat__is() argument
73 struct perf_stat_evsel *ps = evsel->stats; in __perf_evsel_stat__is()
95 static void perf_stat_evsel_id_init(struct perf_evsel *evsel) in perf_stat_evsel_id_init() argument
97 struct perf_stat_evsel *ps = evsel->stats; in perf_stat_evsel_id_init()
103 if (!strcmp(perf_evsel__name(evsel), id_str[i])) { in perf_stat_evsel_id_init()
110 static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) in perf_evsel__reset_stat_priv() argument
113 struct perf_stat_evsel *ps = evsel->stats; in perf_evsel__reset_stat_priv()
118 perf_stat_evsel_id_init(evsel); in perf_evsel__reset_stat_priv()
121 static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) in perf_evsel__alloc_stat_priv() argument
123 evsel->stats = zalloc(sizeof(struct perf_stat_evsel)); in perf_evsel__alloc_stat_priv()
124 if (evsel->stats == NULL) in perf_evsel__alloc_stat_priv()
126 perf_evsel__reset_stat_priv(evsel); in perf_evsel__alloc_stat_priv()
130 static void perf_evsel__free_stat_priv(struct perf_evsel *evsel) in perf_evsel__free_stat_priv() argument
132 struct perf_stat_evsel *ps = evsel->stats; in perf_evsel__free_stat_priv()
136 zfree(&evsel->stats); in perf_evsel__free_stat_priv()
139 static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel, in perf_evsel__alloc_prev_raw_counts() argument
146 evsel->prev_raw_counts = counts; in perf_evsel__alloc_prev_raw_counts()
151 static void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel) in perf_evsel__free_prev_raw_counts() argument
153 perf_counts__delete(evsel->prev_raw_counts); in perf_evsel__free_prev_raw_counts()
154 evsel->prev_raw_counts = NULL; in perf_evsel__free_prev_raw_counts()
157 static int perf_evsel__alloc_stats(struct perf_evsel *evsel, bool alloc_raw) in perf_evsel__alloc_stats() argument
159 int ncpus = perf_evsel__nr_cpus(evsel); in perf_evsel__alloc_stats()
160 int nthreads = thread_map__nr(evsel->threads); in perf_evsel__alloc_stats()
162 if (perf_evsel__alloc_stat_priv(evsel) < 0 || in perf_evsel__alloc_stats()
163 perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 || in perf_evsel__alloc_stats()
164 (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, ncpus, nthreads) < 0)) in perf_evsel__alloc_stats()
172 struct perf_evsel *evsel; in perf_evlist__alloc_stats() local
174 evlist__for_each_entry(evlist, evsel) { in perf_evlist__alloc_stats()
175 if (perf_evsel__alloc_stats(evsel, alloc_raw)) in perf_evlist__alloc_stats()
188 struct perf_evsel *evsel; in perf_evlist__free_stats() local
190 evlist__for_each_entry(evlist, evsel) { in perf_evlist__free_stats()
191 perf_evsel__free_stat_priv(evsel); in perf_evlist__free_stats()
192 perf_evsel__free_counts(evsel); in perf_evlist__free_stats()
193 perf_evsel__free_prev_raw_counts(evsel); in perf_evlist__free_stats()
199 struct perf_evsel *evsel; in perf_evlist__reset_stats() local
201 evlist__for_each_entry(evlist, evsel) { in perf_evlist__reset_stats()
202 perf_evsel__reset_stat_priv(evsel); in perf_evlist__reset_stats()
203 perf_evsel__reset_counts(evsel); in perf_evlist__reset_stats()
256 process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel, in process_counter_values() argument
260 struct perf_counts_values *aggr = &evsel->counts->aggr; in process_counter_values()
264 if (check_per_pkg(evsel, count, cpu, &skip)) { in process_counter_values()
277 if (!evsel->snapshot) in process_counter_values()
278 perf_evsel__compute_deltas(evsel, cpu, thread, count); in process_counter_values()
281 perf_stat__update_shadow_stats(evsel, count->val, cpu, in process_counter_values()
285 perf_stat__update_shadow_stats(evsel, in process_counter_values()
288 perf_stat__update_shadow_stats(evsel, in process_counter_values()