libperf: Move 'mmap_len' from 'struct evlist' to 'struct perf_evlist'
authorJiri Olsa <jolsa@kernel.org>
Tue, 6 Aug 2019 13:14:05 +0000 (15:14 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 25 Sep 2019 12:51:47 +0000 (09:51 -0300)
Moving 'mmap_len' 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-22-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-record.c
tools/perf/lib/include/internal/evlist.h
tools/perf/util/evlist.c
tools/perf/util/evlist.h

index 8577bf33a556999b05ba2f9bc8889e71da22f39a..94997144547dd86f5bacfaf2f55a660a2f0b8fd9 100644 (file)
@@ -1412,7 +1412,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
                err = -1;
                goto out_child;
        }
-       session->header.env.comp_mmap_len = session->evlist->mmap_len;
+       session->header.env.comp_mmap_len = session->evlist->core.mmap_len;
 
        err = bpf__apply_obj_config();
        if (err) {
index 035c1e1cc32424c3561e97bf8acc398a1a7de2c5..01b8136164405df6c58d84cbeff3dd75a3f5fab6 100644 (file)
@@ -14,6 +14,7 @@ struct perf_evlist {
        struct perf_cpu_map     *cpus;
        struct perf_thread_map  *threads;
        int                      nr_mmaps;
+       size_t                   mmap_len;
 };
 
 /**
index d147834fbe60b6812c417cb9870900e6987e158f..4d8cde099e10a96513a54c0a36ac434654d8303b 100644 (file)
@@ -1012,11 +1012,11 @@ int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
        if (evlist->pollfd.entries == NULL && perf_evlist__alloc_pollfd(evlist) < 0)
                return -ENOMEM;
 
-       evlist->mmap_len = evlist__mmap_size(pages);
-       pr_debug("mmap size %zuB\n", evlist->mmap_len);
-       mp.mask = evlist->mmap_len - page_size - 1;
+       evlist->core.mmap_len = evlist__mmap_size(pages);
+       pr_debug("mmap size %zuB\n", evlist->core.mmap_len);
+       mp.mask = evlist->core.mmap_len - page_size - 1;
 
-       auxtrace_mmap_params__init(&mp.auxtrace_mp, evlist->mmap_len,
+       auxtrace_mmap_params__init(&mp.auxtrace_mp, evlist->core.mmap_len,
                                   auxtrace_pages, auxtrace_overwrite);
 
        evlist__for_each_entry(evlist, evsel) {
@@ -1600,7 +1600,7 @@ out_default:
 int perf_evlist__strerror_mmap(struct evlist *evlist, int err, char *buf, size_t size)
 {
        char sbuf[STRERR_BUFSIZE], *emsg = str_error_r(err, sbuf, sizeof(sbuf));
-       int pages_attempted = evlist->mmap_len / 1024, pages_max_per_user, printed = 0;
+       int pages_attempted = evlist->core.mmap_len / 1024, pages_max_per_user, printed = 0;
 
        switch (err) {
        case EPERM:
index 816b72a2b1e5a8cef3a2f9a7e9aa8c6699467657..765cee8bced1c3fc00b1ccfec4dcc75aa9ee0f22 100644 (file)
@@ -56,7 +56,6 @@ struct evlist {
        struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
        int              nr_groups;
        bool             enabled;
-       size_t           mmap_len;
        int              id_pos;
        int              is_pos;
        u64              combined_sample_type;