perf evlist: Use the right prefix for 'struct evlist' stats methods

perf_evlist__ is for 'struct perf_evlist' methods, in tools/lib/perf/,
go on completing this split.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7b392ef0
...@@ -1847,7 +1847,7 @@ static void perf_sample__fprint_metric(struct perf_script *script, ...@@ -1847,7 +1847,7 @@ static void perf_sample__fprint_metric(struct perf_script *script,
u64 val; u64 val;
if (!evsel->stats) if (!evsel->stats)
perf_evlist__alloc_stats(script->session->evlist, false); evlist__alloc_stats(script->session->evlist, false);
if (evsel_script(evsel->leader)->gnum++ == 0) if (evsel_script(evsel->leader)->gnum++ == 0)
perf_stat__reset_shadow_stats(); perf_stat__reset_shadow_stats();
val = sample->period * evsel->scale; val = sample->period * evsel->scale;
...@@ -3308,7 +3308,7 @@ static int set_maps(struct perf_script *script) ...@@ -3308,7 +3308,7 @@ static int set_maps(struct perf_script *script)
perf_evlist__set_maps(&evlist->core, script->cpus, script->threads); perf_evlist__set_maps(&evlist->core, script->cpus, script->threads);
if (perf_evlist__alloc_stats(evlist, true)) if (evlist__alloc_stats(evlist, true))
return -ENOMEM; return -ENOMEM;
script->allocated = true; script->allocated = true;
...@@ -3935,7 +3935,7 @@ int cmd_script(int argc, const char **argv) ...@@ -3935,7 +3935,7 @@ int cmd_script(int argc, const char **argv)
zfree(&script.ptime_range); zfree(&script.ptime_range);
} }
perf_evlist__free_stats(session->evlist); evlist__free_stats(session->evlist);
perf_session__delete(session); perf_session__delete(session);
if (script_started) if (script_started)
......
...@@ -270,7 +270,7 @@ static void perf_stat__reset_stats(void) ...@@ -270,7 +270,7 @@ static void perf_stat__reset_stats(void)
{ {
int i; int i;
perf_evlist__reset_stats(evsel_list); evlist__reset_stats(evsel_list);
perf_stat__reset_shadow_stats(); perf_stat__reset_shadow_stats();
for (i = 0; i < stat_config.stats_num; i++) for (i = 0; i < stat_config.stats_num; i++)
...@@ -913,10 +913,10 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) ...@@ -913,10 +913,10 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
update_stats(&walltime_nsecs_stats, t1 - t0); update_stats(&walltime_nsecs_stats, t1 - t0);
if (stat_config.aggr_mode == AGGR_GLOBAL) if (stat_config.aggr_mode == AGGR_GLOBAL)
perf_evlist__save_aggr_prev_raw_counts(evsel_list); evlist__save_aggr_prev_raw_counts(evsel_list);
perf_evlist__copy_prev_raw_counts(evsel_list); evlist__copy_prev_raw_counts(evsel_list);
perf_evlist__reset_prev_raw_counts(evsel_list); evlist__reset_prev_raw_counts(evsel_list);
runtime_stat_reset(&stat_config); runtime_stat_reset(&stat_config);
perf_stat__reset_shadow_per_stat(&rt_stat); perf_stat__reset_shadow_per_stat(&rt_stat);
} else } else
...@@ -1907,7 +1907,7 @@ static int set_maps(struct perf_stat *st) ...@@ -1907,7 +1907,7 @@ static int set_maps(struct perf_stat *st)
perf_evlist__set_maps(&evsel_list->core, st->cpus, st->threads); perf_evlist__set_maps(&evsel_list->core, st->cpus, st->threads);
if (perf_evlist__alloc_stats(evsel_list, true)) if (evlist__alloc_stats(evsel_list, true))
return -ENOMEM; return -ENOMEM;
st->maps_allocated = true; st->maps_allocated = true;
...@@ -2309,7 +2309,7 @@ int cmd_stat(int argc, const char **argv) ...@@ -2309,7 +2309,7 @@ int cmd_stat(int argc, const char **argv)
goto out; goto out;
} }
if (perf_evlist__alloc_stats(evsel_list, interval)) if (evlist__alloc_stats(evsel_list, interval))
goto out; goto out;
if (perf_stat_init_aggr_mode()) if (perf_stat_init_aggr_mode())
...@@ -2349,7 +2349,7 @@ int cmd_stat(int argc, const char **argv) ...@@ -2349,7 +2349,7 @@ int cmd_stat(int argc, const char **argv)
run_idx + 1); run_idx + 1);
if (run_idx != 0) if (run_idx != 0)
perf_evlist__reset_prev_raw_counts(evsel_list); evlist__reset_prev_raw_counts(evsel_list);
status = run_perf_stat(argc, argv, run_idx); status = run_perf_stat(argc, argv, run_idx);
if (forever && status != -1 && !interval) { if (forever && status != -1 && !interval) {
...@@ -2400,7 +2400,7 @@ int cmd_stat(int argc, const char **argv) ...@@ -2400,7 +2400,7 @@ int cmd_stat(int argc, const char **argv)
} }
perf_stat__exit_aggr_mode(); perf_stat__exit_aggr_mode();
perf_evlist__free_stats(evsel_list); evlist__free_stats(evsel_list);
out: out:
zfree(&stat_config.walltime_run); zfree(&stat_config.walltime_run);
......
...@@ -166,7 +166,7 @@ static int __compute_metric(const char *name, struct value *vals, ...@@ -166,7 +166,7 @@ static int __compute_metric(const char *name, struct value *vals,
if (err) if (err)
goto out; goto out;
err = perf_evlist__alloc_stats(evlist, false); err = evlist__alloc_stats(evlist, false);
if (err) if (err)
goto out; goto out;
...@@ -183,7 +183,7 @@ static int __compute_metric(const char *name, struct value *vals, ...@@ -183,7 +183,7 @@ static int __compute_metric(const char *name, struct value *vals,
/* ... clenup. */ /* ... clenup. */
metricgroup__rblist_exit(&metric_events); metricgroup__rblist_exit(&metric_events);
runtime_stat__exit(&st); runtime_stat__exit(&st);
perf_evlist__free_stats(evlist); evlist__free_stats(evlist);
perf_cpu_map__put(cpus); perf_cpu_map__put(cpus);
evlist__delete(evlist); evlist__delete(evlist);
return err; return err;
......
...@@ -184,7 +184,7 @@ static int evsel__alloc_stats(struct evsel *evsel, bool alloc_raw) ...@@ -184,7 +184,7 @@ static int evsel__alloc_stats(struct evsel *evsel, bool alloc_raw)
return 0; return 0;
} }
int perf_evlist__alloc_stats(struct evlist *evlist, bool alloc_raw) int evlist__alloc_stats(struct evlist *evlist, bool alloc_raw)
{ {
struct evsel *evsel; struct evsel *evsel;
...@@ -196,11 +196,11 @@ int perf_evlist__alloc_stats(struct evlist *evlist, bool alloc_raw) ...@@ -196,11 +196,11 @@ int perf_evlist__alloc_stats(struct evlist *evlist, bool alloc_raw)
return 0; return 0;
out_free: out_free:
perf_evlist__free_stats(evlist); evlist__free_stats(evlist);
return -1; return -1;
} }
void perf_evlist__free_stats(struct evlist *evlist) void evlist__free_stats(struct evlist *evlist)
{ {
struct evsel *evsel; struct evsel *evsel;
...@@ -211,7 +211,7 @@ void perf_evlist__free_stats(struct evlist *evlist) ...@@ -211,7 +211,7 @@ void perf_evlist__free_stats(struct evlist *evlist)
} }
} }
void perf_evlist__reset_stats(struct evlist *evlist) void evlist__reset_stats(struct evlist *evlist)
{ {
struct evsel *evsel; struct evsel *evsel;
...@@ -221,7 +221,7 @@ void perf_evlist__reset_stats(struct evlist *evlist) ...@@ -221,7 +221,7 @@ void perf_evlist__reset_stats(struct evlist *evlist)
} }
} }
void perf_evlist__reset_prev_raw_counts(struct evlist *evlist) void evlist__reset_prev_raw_counts(struct evlist *evlist)
{ {
struct evsel *evsel; struct evsel *evsel;
...@@ -245,7 +245,7 @@ static void evsel__copy_prev_raw_counts(struct evsel *evsel) ...@@ -245,7 +245,7 @@ static void evsel__copy_prev_raw_counts(struct evsel *evsel)
evsel->counts->aggr = evsel->prev_raw_counts->aggr; evsel->counts->aggr = evsel->prev_raw_counts->aggr;
} }
void perf_evlist__copy_prev_raw_counts(struct evlist *evlist) void evlist__copy_prev_raw_counts(struct evlist *evlist)
{ {
struct evsel *evsel; struct evsel *evsel;
...@@ -253,7 +253,7 @@ void perf_evlist__copy_prev_raw_counts(struct evlist *evlist) ...@@ -253,7 +253,7 @@ void perf_evlist__copy_prev_raw_counts(struct evlist *evlist)
evsel__copy_prev_raw_counts(evsel); evsel__copy_prev_raw_counts(evsel);
} }
void perf_evlist__save_aggr_prev_raw_counts(struct evlist *evlist) void evlist__save_aggr_prev_raw_counts(struct evlist *evlist)
{ {
struct evsel *evsel; struct evsel *evsel;
......
...@@ -213,12 +213,12 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, ...@@ -213,12 +213,12 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
struct runtime_stat *st); struct runtime_stat *st);
void perf_stat__collect_metric_expr(struct evlist *); void perf_stat__collect_metric_expr(struct evlist *);
int perf_evlist__alloc_stats(struct evlist *evlist, bool alloc_raw); int evlist__alloc_stats(struct evlist *evlist, bool alloc_raw);
void perf_evlist__free_stats(struct evlist *evlist); void evlist__free_stats(struct evlist *evlist);
void perf_evlist__reset_stats(struct evlist *evlist); void evlist__reset_stats(struct evlist *evlist);
void perf_evlist__reset_prev_raw_counts(struct evlist *evlist); void evlist__reset_prev_raw_counts(struct evlist *evlist);
void perf_evlist__copy_prev_raw_counts(struct evlist *evlist); void evlist__copy_prev_raw_counts(struct evlist *evlist);
void perf_evlist__save_aggr_prev_raw_counts(struct evlist *evlist); void evlist__save_aggr_prev_raw_counts(struct evlist *evlist);
int perf_stat_process_counter(struct perf_stat_config *config, int perf_stat_process_counter(struct perf_stat_config *config,
struct evsel *counter); struct evsel *counter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment