aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
authorJiri Olsa2019-07-30 13:04:59 +0200
committerArnaldo Carvalho de Melo2019-09-25 09:51:47 -0300
commitc976ee11a0e1b3ba5e63e734dbf4b19154e39fab (patch)
tree6a602c35ede8eb22841fd2307585dd9999fa8081 /tools/perf/util
parent648b5af3f3ae7f4fad7395c8dc84cb79eafe2ba9 (diff)
libperf: Move 'nr_mmaps' from 'struct evlist' to 'struct perf_evlist'
Moving 'nr_mmaps' from 'struct evlist' to 'struct perf_evlist', it will be used in following patches. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lore.kernel.org/lkml/20190913132355.21634-21-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/evlist.c16
-rw-r--r--tools/perf/util/evlist.h1
-rw-r--r--tools/perf/util/python.c2
3 files changed, 9 insertions, 10 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 16866533745c..d147834fbe60 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -651,7 +651,7 @@ static int perf_evlist__set_paused(struct evlist *evlist, bool value)
if (!evlist->overwrite_mmap)
return 0;
- for (i = 0; i < evlist->nr_mmaps; i++) {
+ for (i = 0; i < evlist->core.nr_mmaps; i++) {
int fd = evlist->overwrite_mmap[i].core.fd;
int err;
@@ -679,11 +679,11 @@ static void evlist__munmap_nofree(struct evlist *evlist)
int i;
if (evlist->mmap)
- for (i = 0; i < evlist->nr_mmaps; i++)
+ for (i = 0; i < evlist->core.nr_mmaps; i++)
perf_mmap__munmap(&evlist->mmap[i]);
if (evlist->overwrite_mmap)
- for (i = 0; i < evlist->nr_mmaps; i++)
+ for (i = 0; i < evlist->core.nr_mmaps; i++)
perf_mmap__munmap(&evlist->overwrite_mmap[i]);
}
@@ -700,14 +700,14 @@ static struct mmap *evlist__alloc_mmap(struct evlist *evlist,
int i;
struct mmap *map;
- evlist->nr_mmaps = perf_cpu_map__nr(evlist->core.cpus);
+ evlist->core.nr_mmaps = perf_cpu_map__nr(evlist->core.cpus);
if (perf_cpu_map__empty(evlist->core.cpus))
- evlist->nr_mmaps = perf_thread_map__nr(evlist->core.threads);
- map = zalloc(evlist->nr_mmaps * sizeof(struct mmap));
+ evlist->core.nr_mmaps = perf_thread_map__nr(evlist->core.threads);
+ map = zalloc(evlist->core.nr_mmaps * sizeof(struct mmap));
if (!map)
return NULL;
- for (i = 0; i < evlist->nr_mmaps; i++) {
+ for (i = 0; i < evlist->core.nr_mmaps; i++) {
map[i].core.fd = -1;
map[i].core.overwrite = overwrite;
/*
@@ -1847,7 +1847,7 @@ static void *perf_evlist__poll_thread(void *arg)
if (!draining)
perf_evlist__poll(evlist, 1000);
- for (i = 0; i < evlist->nr_mmaps; i++) {
+ for (i = 0; i < evlist->core.nr_mmaps; i++) {
struct mmap *map = &evlist->mmap[i];
union perf_event *event;
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 8b9c35efea67..816b72a2b1e5 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -55,7 +55,6 @@ struct evlist {
struct perf_evlist core;
struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
int nr_groups;
- int nr_mmaps;
bool enabled;
size_t mmap_len;
int id_pos;
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index ba4085d7ae9f..62144b97e17b 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -988,7 +988,7 @@ static struct mmap *get_md(struct evlist *evlist, int cpu)
{
int i;
- for (i = 0; i < evlist->nr_mmaps; i++) {
+ for (i = 0; i < evlist->core.nr_mmaps; i++) {
struct mmap *md = &evlist->mmap[i];
if (md->core.cpu == cpu)