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

libperf evlist: Add evsel as a parameter to ->idx()

Add evsel as a parameter to ->idx() in preparation for correctly
determining whether an auxtrace mmap is needed.

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-9-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
8f111be6 d8fe2efb

+4 -2
+1 -1
tools/lib/perf/evlist.c
··· 479 479 refcount_set(&map->refcnt, 2); 480 480 481 481 if (ops->idx) 482 - ops->idx(evlist, mp, idx); 482 + ops->idx(evlist, evsel, mp, idx); 483 483 484 484 if (ops->mmap(map, mp, *output, evlist_cpu) < 0) 485 485 return -1;
+2 -1
tools/lib/perf/include/internal/evlist.h
··· 38 38 }; 39 39 40 40 typedef void 41 - (*perf_evlist_mmap__cb_idx_t)(struct perf_evlist*, struct perf_mmap_param*, int); 41 + (*perf_evlist_mmap__cb_idx_t)(struct perf_evlist*, struct perf_evsel*, 42 + struct perf_mmap_param*, int); 42 43 typedef struct perf_mmap* 43 44 (*perf_evlist_mmap__cb_get_t)(struct perf_evlist*, bool, int); 44 45 typedef int
+1
tools/perf/util/evlist.c
··· 747 747 748 748 static void 749 749 perf_evlist__mmap_cb_idx(struct perf_evlist *_evlist, 750 + struct perf_evsel *_evsel __maybe_unused, 750 751 struct perf_mmap_param *_mp, 751 752 int idx) 752 753 {