@@ -143,9 +143,9 @@ void evlist__delete(struct evlist *evlist)
143143
144144 perf_evlist__munmap (evlist );
145145 evlist__close (evlist );
146- perf_cpu_map__put (evlist -> cpus );
146+ perf_cpu_map__put (evlist -> core . cpus );
147147 perf_thread_map__put (evlist -> threads );
148- evlist -> cpus = NULL ;
148+ evlist -> core . cpus = NULL ;
149149 evlist -> threads = NULL ;
150150 perf_evlist__purge (evlist );
151151 perf_evlist__exit (evlist );
@@ -161,7 +161,7 @@ static void __perf_evlist__propagate_maps(struct evlist *evlist,
161161 */
162162 if (!evsel -> core .own_cpus || evlist -> core .has_user_cpus ) {
163163 perf_cpu_map__put (evsel -> core .cpus );
164- evsel -> core .cpus = perf_cpu_map__get (evlist -> cpus );
164+ evsel -> core .cpus = perf_cpu_map__get (evlist -> core . cpus );
165165 } else if (evsel -> core .cpus != evsel -> core .own_cpus ) {
166166 perf_cpu_map__put (evsel -> core .cpus );
167167 evsel -> core .cpus = perf_cpu_map__get (evsel -> core .own_cpus );
@@ -398,7 +398,7 @@ static int perf_evlist__enable_event_thread(struct evlist *evlist,
398398 int thread )
399399{
400400 int cpu ;
401- int nr_cpus = cpu_map__nr (evlist -> cpus );
401+ int nr_cpus = cpu_map__nr (evlist -> core . cpus );
402402
403403 if (!evsel -> fd )
404404 return - EINVAL ;
@@ -414,7 +414,7 @@ static int perf_evlist__enable_event_thread(struct evlist *evlist,
414414int perf_evlist__enable_event_idx (struct evlist * evlist ,
415415 struct evsel * evsel , int idx )
416416{
417- bool per_cpu_mmaps = !cpu_map__empty (evlist -> cpus );
417+ bool per_cpu_mmaps = !cpu_map__empty (evlist -> core . cpus );
418418
419419 if (per_cpu_mmaps )
420420 return perf_evlist__enable_event_cpu (evlist , evsel , idx );
@@ -424,7 +424,7 @@ int perf_evlist__enable_event_idx(struct evlist *evlist,
424424
425425int perf_evlist__alloc_pollfd (struct evlist * evlist )
426426{
427- int nr_cpus = cpu_map__nr (evlist -> cpus );
427+ int nr_cpus = cpu_map__nr (evlist -> core . cpus );
428428 int nr_threads = thread_map__nr (evlist -> threads );
429429 int nfds = 0 ;
430430 struct evsel * evsel ;
@@ -552,8 +552,8 @@ static void perf_evlist__set_sid_idx(struct evlist *evlist,
552552{
553553 struct perf_sample_id * sid = SID (evsel , cpu , thread );
554554 sid -> idx = idx ;
555- if (evlist -> cpus && cpu >= 0 )
556- sid -> cpu = evlist -> cpus -> map [cpu ];
555+ if (evlist -> core . cpus && cpu >= 0 )
556+ sid -> cpu = evlist -> core . cpus -> map [cpu ];
557557 else
558558 sid -> cpu = -1 ;
559559 if (!evsel -> system_wide && evlist -> threads && thread >= 0 )
@@ -720,8 +720,8 @@ static struct perf_mmap *perf_evlist__alloc_mmap(struct evlist *evlist,
720720 int i ;
721721 struct perf_mmap * map ;
722722
723- evlist -> nr_mmaps = cpu_map__nr (evlist -> cpus );
724- if (cpu_map__empty (evlist -> cpus ))
723+ evlist -> nr_mmaps = cpu_map__nr (evlist -> core . cpus );
724+ if (cpu_map__empty (evlist -> core . cpus ))
725725 evlist -> nr_mmaps = thread_map__nr (evlist -> threads );
726726 map = zalloc (evlist -> nr_mmaps * sizeof (struct perf_mmap ));
727727 if (!map )
@@ -759,7 +759,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx,
759759{
760760 struct evsel * evsel ;
761761 int revent ;
762- int evlist_cpu = cpu_map__cpu (evlist -> cpus , cpu_idx );
762+ int evlist_cpu = cpu_map__cpu (evlist -> core . cpus , cpu_idx );
763763
764764 evlist__for_each_entry (evlist , evsel ) {
765765 struct perf_mmap * maps = evlist -> mmap ;
@@ -835,7 +835,7 @@ static int perf_evlist__mmap_per_cpu(struct evlist *evlist,
835835 struct mmap_params * mp )
836836{
837837 int cpu , thread ;
838- int nr_cpus = cpu_map__nr (evlist -> cpus );
838+ int nr_cpus = cpu_map__nr (evlist -> core . cpus );
839839 int nr_threads = thread_map__nr (evlist -> threads );
840840
841841 pr_debug2 ("perf event ring buffer mmapped per cpu\n" );
@@ -1014,7 +1014,7 @@ int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
10141014 int comp_level )
10151015{
10161016 struct evsel * evsel ;
1017- const struct perf_cpu_map * cpus = evlist -> cpus ;
1017+ const struct perf_cpu_map * cpus = evlist -> core . cpus ;
10181018 const struct perf_thread_map * threads = evlist -> threads ;
10191019 /*
10201020 * Delay setting mp.prot: set it before calling perf_mmap__mmap.
@@ -1116,9 +1116,9 @@ void perf_evlist__set_maps(struct evlist *evlist, struct perf_cpu_map *cpus,
11161116 * original reference count of 1. If that is not the case it is up to
11171117 * the caller to increase the reference count.
11181118 */
1119- if (cpus != evlist -> cpus ) {
1120- perf_cpu_map__put (evlist -> cpus );
1121- evlist -> cpus = perf_cpu_map__get (cpus );
1119+ if (cpus != evlist -> core . cpus ) {
1120+ perf_cpu_map__put (evlist -> core . cpus );
1121+ evlist -> core . cpus = perf_cpu_map__get (cpus );
11221122 }
11231123
11241124 if (threads != evlist -> threads ) {
@@ -1398,7 +1398,7 @@ int evlist__open(struct evlist *evlist)
13981398 * Default: one fd per CPU, all threads, aka systemwide
13991399 * as sys_perf_event_open(cpu = -1, thread = -1) is EINVAL
14001400 */
1401- if (evlist -> threads == NULL && evlist -> cpus == NULL ) {
1401+ if (evlist -> threads == NULL && evlist -> core . cpus == NULL ) {
14021402 err = perf_evlist__create_syswide_maps (evlist );
14031403 if (err < 0 )
14041404 goto out_err ;
@@ -1920,7 +1920,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
19201920 goto out_delete_evlist ;
19211921
19221922 evlist__for_each_entry (evlist , counter ) {
1923- if (evsel__open (counter , evlist -> cpus ,
1923+ if (evsel__open (counter , evlist -> core . cpus ,
19241924 evlist -> threads ) < 0 )
19251925 goto out_delete_evlist ;
19261926 }
0 commit comments