libperf: Add has_user_cpus to struct perf_evlist
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>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
af663bd01b
commit
ec903f264f
@@ -5,6 +5,7 @@
|
|||||||
struct perf_evlist {
|
struct perf_evlist {
|
||||||
struct list_head entries;
|
struct list_head entries;
|
||||||
int nr_entries;
|
int nr_entries;
|
||||||
|
bool has_user_cpus;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __LIBPERF_INTERNAL_EVLIST_H */
|
#endif /* __LIBPERF_INTERNAL_EVLIST_H */
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ static void __perf_evlist__propagate_maps(struct evlist *evlist,
|
|||||||
* We already have cpus for evsel (via PMU sysfs) so
|
* We already have cpus for evsel (via PMU sysfs) so
|
||||||
* keep it, if there's no target cpu list defined.
|
* 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);
|
perf_cpu_map__put(evsel->core.cpus);
|
||||||
evsel->core.cpus = perf_cpu_map__get(evlist->cpus);
|
evsel->core.cpus = perf_cpu_map__get(evlist->cpus);
|
||||||
} else if (evsel->core.cpus != evsel->core.own_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)
|
if (!cpus)
|
||||||
goto out_delete_threads;
|
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);
|
perf_evlist__set_maps(evlist, cpus, threads);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ struct evlist {
|
|||||||
int nr_groups;
|
int nr_groups;
|
||||||
int nr_mmaps;
|
int nr_mmaps;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
bool has_user_cpus;
|
|
||||||
size_t mmap_len;
|
size_t mmap_len;
|
||||||
int id_pos;
|
int id_pos;
|
||||||
int is_pos;
|
int is_pos;
|
||||||
|
|||||||
Reference in New Issue
Block a user