From 03617c22e31f32cbf0e4797e216db898fb898d90 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Sun, 21 Jul 2019 13:24:42 +0200 Subject: libperf: Add threads to struct perf_evlist Move threads from tools/perf's evlist to libperf's perf_evlist struct. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190721112506.12306-56-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tools/perf/builtin-stat.c') diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index d81b0b1ef514..4a94ca131d56 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -263,7 +263,7 @@ static int read_single_counter(struct evsel *counter, int cpu, */ static int read_counter(struct evsel *counter, struct timespec *rs) { - int nthreads = thread_map__nr(evsel_list->threads); + int nthreads = thread_map__nr(evsel_list->core.threads); int ncpus, cpu, thread; if (target__has_cpu(&target) && !target__has_per_thread(&target)) @@ -485,15 +485,15 @@ try_again: ui__warning("%s\n", msg); goto try_again; } else if (target__has_per_thread(&target) && - evsel_list->threads && - evsel_list->threads->err_thread != -1) { + evsel_list->core.threads && + evsel_list->core.threads->err_thread != -1) { /* * For global --per-thread case, skip current * error thread. */ - if (!thread_map__remove(evsel_list->threads, - evsel_list->threads->err_thread)) { - evsel_list->threads->err_thread = -1; + if (!thread_map__remove(evsel_list->core.threads, + evsel_list->core.threads->err_thread)) { + evsel_list->core.threads->err_thread = -1; goto try_again; } } @@ -579,7 +579,7 @@ try_again: enable_counters(); while (!done) { nanosleep(&ts, NULL); - if (!is_target_alive(&target, evsel_list->threads)) + if (!is_target_alive(&target, evsel_list->core.threads)) break; if (timeout) break; @@ -1889,10 +1889,10 @@ int cmd_stat(int argc, const char **argv) * so we could print it out on output. */ if (stat_config.aggr_mode == AGGR_THREAD) { - thread_map__read_comms(evsel_list->threads); + thread_map__read_comms(evsel_list->core.threads); if (target.system_wide) { if (runtime_stat_new(&stat_config, - thread_map__nr(evsel_list->threads))) { + thread_map__nr(evsel_list->core.threads))) { goto out; } } -- cgit v1.2.3