diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2022-05-06 15:25:45 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-05-10 14:26:27 -0300 |
commit | d8fe2efb65acdc213eb180b7853fc1121c1bff37 (patch) | |
tree | 0f001728a2f8d0362f6e676e5d0280cdccb3b823 /tools/lib | |
parent | 6a7b8a5a30e60e27cd2489af3d0a441280b441e6 (diff) | |
download | lwn-d8fe2efb65acdc213eb180b7853fc1121c1bff37.tar.gz lwn-d8fe2efb65acdc213eb180b7853fc1121c1bff37.zip |
libperf evlist: Move ->idx() into mmap_per_evsel()
Move ->idx() into mmap_per_evsel() in preparation for adding evsel as a
parameter.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20220506122601.367589-8-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/perf/evlist.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c index 5e8ad854fa8a..4fce417432aa 100644 --- a/tools/lib/perf/evlist.c +++ b/tools/lib/perf/evlist.c @@ -478,6 +478,9 @@ mmap_per_evsel(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops, */ refcount_set(&map->refcnt, 2); + if (ops->idx) + ops->idx(evlist, mp, idx); + if (ops->mmap(map, mp, *output, evlist_cpu) < 0) return -1; @@ -520,9 +523,6 @@ mmap_per_thread(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops, int output = -1; int output_overwrite = -1; - if (ops->idx) - ops->idx(evlist, mp, thread); - if (mmap_per_evsel(evlist, ops, thread, mp, 0, thread, &output, &output_overwrite)) goto out_unmap; @@ -547,9 +547,6 @@ mmap_per_cpu(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops, int output = -1; int output_overwrite = -1; - if (ops->idx) - ops->idx(evlist, mp, cpu); - for (thread = 0; thread < nr_threads; thread++) { if (mmap_per_evsel(evlist, ops, cpu, mp, cpu, thread, &output, &output_overwrite)) |