libperf: Add has_user_cpus to struct perf_evlist
authorJiri Olsa <jolsa@kernel.org>
Sun, 21 Jul 2019 11:24:40 +0000 (13:24 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 29 Jul 2019 21:34:45 +0000 (18:34 -0300)
Move has_user_cpus from tools/perf's evlist to libbperf'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-54-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/lib/include/internal/evlist.h
tools/perf/util/evlist.c
tools/perf/util/evlist.h

index a12c712a91975a60ea8f314cdf739b3c0d19279f..9964e4a9456e17360629ae498e0d2244eced821d 100644 (file)
@@ -5,6 +5,7 @@
 struct perf_evlist {
        struct list_head        entries;
        int                     nr_entries;
+       bool                    has_user_cpus;
 };
 
 #endif /* __LIBPERF_INTERNAL_EVLIST_H */
index 5ce8fc730453575dd2149151bd1bae25c9874363..23a8ead4512fa460d7907a67048380f5cc68d90f 100644 (file)
@@ -159,7 +159,7 @@ static void __perf_evlist__propagate_maps(struct evlist *evlist,
         * We already have cpus for evsel (via PMU sysfs) so
         * keep it, if there's no target cpu list defined.
         */
-       if (!evsel->core.own_cpus || evlist->has_user_cpus) {
+       if (!evsel->core.own_cpus || evlist->core.has_user_cpus) {
                perf_cpu_map__put(evsel->core.cpus);
                evsel->core.cpus = perf_cpu_map__get(evlist->cpus);
        } else if (evsel->core.cpus != evsel->core.own_cpus) {
@@ -1095,7 +1095,7 @@ int perf_evlist__create_maps(struct evlist *evlist, struct target *target)
        if (!cpus)
                goto out_delete_threads;
 
-       evlist->has_user_cpus = !!target->cpu_list;
+       evlist->core.has_user_cpus = !!target->cpu_list;
 
        perf_evlist__set_maps(evlist, cpus, threads);
 
index 17dd83021a7963939340a4b30ac152d416336725..35cca024263169b04996b0aff5334b147e7c6d9f 100644 (file)
@@ -31,7 +31,6 @@ struct evlist {
        int              nr_groups;
        int              nr_mmaps;
        bool             enabled;
-       bool             has_user_cpus;
        size_t           mmap_len;
        int              id_pos;
        int              is_pos;