aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-07-21 07:24:42 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-07-29 17:34:45 -0400
commit03617c22e31f32cbf0e4797e216db898fb898d90 (patch)
tree2c344d33e287efb2abc1e2dfa2a9cb693fe6a231 /tools/perf/builtin-stat.c
parentf72f901d90b00aaf2a6c1335b41311687b3f2dec (diff)
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 <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20190721112506.12306-56-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c18
1 files changed, 9 insertions, 9 deletions
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,
263 */ 263 */
264static int read_counter(struct evsel *counter, struct timespec *rs) 264static int read_counter(struct evsel *counter, struct timespec *rs)
265{ 265{
266 int nthreads = thread_map__nr(evsel_list->threads); 266 int nthreads = thread_map__nr(evsel_list->core.threads);
267 int ncpus, cpu, thread; 267 int ncpus, cpu, thread;
268 268
269 if (target__has_cpu(&target) && !target__has_per_thread(&target)) 269 if (target__has_cpu(&target) && !target__has_per_thread(&target))
@@ -485,15 +485,15 @@ try_again:
485 ui__warning("%s\n", msg); 485 ui__warning("%s\n", msg);
486 goto try_again; 486 goto try_again;
487 } else if (target__has_per_thread(&target) && 487 } else if (target__has_per_thread(&target) &&
488 evsel_list->threads && 488 evsel_list->core.threads &&
489 evsel_list->threads->err_thread != -1) { 489 evsel_list->core.threads->err_thread != -1) {
490 /* 490 /*
491 * For global --per-thread case, skip current 491 * For global --per-thread case, skip current
492 * error thread. 492 * error thread.
493 */ 493 */
494 if (!thread_map__remove(evsel_list->threads, 494 if (!thread_map__remove(evsel_list->core.threads,
495 evsel_list->threads->err_thread)) { 495 evsel_list->core.threads->err_thread)) {
496 evsel_list->threads->err_thread = -1; 496 evsel_list->core.threads->err_thread = -1;
497 goto try_again; 497 goto try_again;
498 } 498 }
499 } 499 }
@@ -579,7 +579,7 @@ try_again:
579 enable_counters(); 579 enable_counters();
580 while (!done) { 580 while (!done) {
581 nanosleep(&ts, NULL); 581 nanosleep(&ts, NULL);
582 if (!is_target_alive(&target, evsel_list->threads)) 582 if (!is_target_alive(&target, evsel_list->core.threads))
583 break; 583 break;
584 if (timeout) 584 if (timeout)
585 break; 585 break;
@@ -1889,10 +1889,10 @@ int cmd_stat(int argc, const char **argv)
1889 * so we could print it out on output. 1889 * so we could print it out on output.
1890 */ 1890 */
1891 if (stat_config.aggr_mode == AGGR_THREAD) { 1891 if (stat_config.aggr_mode == AGGR_THREAD) {
1892 thread_map__read_comms(evsel_list->threads); 1892 thread_map__read_comms(evsel_list->core.threads);
1893 if (target.system_wide) { 1893 if (target.system_wide) {
1894 if (runtime_stat_new(&stat_config, 1894 if (runtime_stat_new(&stat_config,
1895 thread_map__nr(evsel_list->threads))) { 1895 thread_map__nr(evsel_list->core.threads))) {
1896 goto out; 1896 goto out;
1897 } 1897 }
1898 } 1898 }