Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
d8fe2efb 6a7b8a5a

+3 -6
+3 -6
tools/lib/perf/evlist.c
··· 478 478 */ 479 479 refcount_set(&map->refcnt, 2); 480 480 481 + if (ops->idx) 482 + ops->idx(evlist, mp, idx); 483 + 481 484 if (ops->mmap(map, mp, *output, evlist_cpu) < 0) 482 485 return -1; 483 486 ··· 523 520 int output = -1; 524 521 int output_overwrite = -1; 525 522 526 - if (ops->idx) 527 - ops->idx(evlist, mp, thread); 528 - 529 523 if (mmap_per_evsel(evlist, ops, thread, mp, 0, thread, 530 524 &output, &output_overwrite)) 531 525 goto out_unmap; ··· 546 546 for (cpu = 0; cpu < nr_cpus; cpu++) { 547 547 int output = -1; 548 548 int output_overwrite = -1; 549 - 550 - if (ops->idx) 551 - ops->idx(evlist, mp, cpu); 552 549 553 550 for (thread = 0; thread < nr_threads; thread++) { 554 551 if (mmap_per_evsel(evlist, ops, cpu, mp, cpu,