Lines Matching refs:evsel
67 bool __perf_evsel_stat__is(struct perf_evsel *evsel, in __perf_evsel_stat__is() argument
70 struct perf_stat_evsel *ps = evsel->priv; in __perf_evsel_stat__is()
90 void perf_stat_evsel_id_init(struct perf_evsel *evsel) in perf_stat_evsel_id_init() argument
92 struct perf_stat_evsel *ps = evsel->priv; in perf_stat_evsel_id_init()
98 if (!strcmp(perf_evsel__name(evsel), id_str[i])) { in perf_stat_evsel_id_init()
105 static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) in perf_evsel__reset_stat_priv() argument
108 struct perf_stat_evsel *ps = evsel->priv; in perf_evsel__reset_stat_priv()
113 perf_stat_evsel_id_init(evsel); in perf_evsel__reset_stat_priv()
116 static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) in perf_evsel__alloc_stat_priv() argument
118 evsel->priv = zalloc(sizeof(struct perf_stat_evsel)); in perf_evsel__alloc_stat_priv()
119 if (evsel->priv == NULL) in perf_evsel__alloc_stat_priv()
121 perf_evsel__reset_stat_priv(evsel); in perf_evsel__alloc_stat_priv()
125 static void perf_evsel__free_stat_priv(struct perf_evsel *evsel) in perf_evsel__free_stat_priv() argument
127 zfree(&evsel->priv); in perf_evsel__free_stat_priv()
130 static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel, in perf_evsel__alloc_prev_raw_counts() argument
137 evsel->prev_raw_counts = counts; in perf_evsel__alloc_prev_raw_counts()
142 static void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel) in perf_evsel__free_prev_raw_counts() argument
144 perf_counts__delete(evsel->prev_raw_counts); in perf_evsel__free_prev_raw_counts()
145 evsel->prev_raw_counts = NULL; in perf_evsel__free_prev_raw_counts()
148 static int perf_evsel__alloc_stats(struct perf_evsel *evsel, bool alloc_raw) in perf_evsel__alloc_stats() argument
150 int ncpus = perf_evsel__nr_cpus(evsel); in perf_evsel__alloc_stats()
151 int nthreads = thread_map__nr(evsel->threads); in perf_evsel__alloc_stats()
153 if (perf_evsel__alloc_stat_priv(evsel) < 0 || in perf_evsel__alloc_stats()
154 perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 || in perf_evsel__alloc_stats()
155 (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, ncpus, nthreads) < 0)) in perf_evsel__alloc_stats()
163 struct perf_evsel *evsel; in perf_evlist__alloc_stats() local
165 evlist__for_each_entry(evlist, evsel) { in perf_evlist__alloc_stats()
166 if (perf_evsel__alloc_stats(evsel, alloc_raw)) in perf_evlist__alloc_stats()
179 struct perf_evsel *evsel; in perf_evlist__free_stats() local
181 evlist__for_each_entry(evlist, evsel) { in perf_evlist__free_stats()
182 perf_evsel__free_stat_priv(evsel); in perf_evlist__free_stats()
183 perf_evsel__free_counts(evsel); in perf_evlist__free_stats()
184 perf_evsel__free_prev_raw_counts(evsel); in perf_evlist__free_stats()
190 struct perf_evsel *evsel; in perf_evlist__reset_stats() local
192 evlist__for_each_entry(evlist, evsel) { in perf_evlist__reset_stats()
193 perf_evsel__reset_stat_priv(evsel); in perf_evlist__reset_stats()
194 perf_evsel__reset_counts(evsel); in perf_evlist__reset_stats()
247 process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel, in process_counter_values() argument
251 struct perf_counts_values *aggr = &evsel->counts->aggr; in process_counter_values()
255 if (check_per_pkg(evsel, count, cpu, &skip)) { in process_counter_values()
268 if (!evsel->snapshot) in process_counter_values()
269 perf_evsel__compute_deltas(evsel, cpu, thread, count); in process_counter_values()
272 perf_stat__update_shadow_stats(evsel, count->values, cpu); in process_counter_values()