summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-07-21 07:23:52 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-07-29 17:34:42 -0400
commit63503dba87acfab49280d3b05df6705a6f327e8a (patch)
treeb26183a9198ef947a95cd4d4d9d3e441a5d07d13
parent32dcd021d004038ca12ac17319da5aa4756e9312 (diff)
perf evlist: Rename struct perf_evlist to struct evlist
Rename struct perf_evlist to struct evlist, so we don't have a name clash when we add struct perf_evlist in libperf. Committer notes: Added fixes to build on arm64, from Jiri and from me (tools/perf/util/cs-etm.c) Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20190721112506.12306-6-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/arch/arm/util/auxtrace.c2
-rw-r--r--tools/perf/arch/arm/util/cs-etm.c8
-rw-r--r--tools/perf/arch/arm64/util/arm-spe.c6
-rw-r--r--tools/perf/arch/powerpc/util/kvm-stat.c6
-rw-r--r--tools/perf/arch/s390/util/auxtrace.c6
-rw-r--r--tools/perf/arch/x86/tests/intel-cqm.c2
-rw-r--r--tools/perf/arch/x86/tests/perf-time-to-tsc.c2
-rw-r--r--tools/perf/arch/x86/util/auxtrace.c4
-rw-r--r--tools/perf/arch/x86/util/intel-bts.c6
-rw-r--r--tools/perf/arch/x86/util/intel-pt.c14
-rw-r--r--tools/perf/builtin-c2c.c4
-rw-r--r--tools/perf/builtin-diff.c8
-rw-r--r--tools/perf/builtin-ftrace.c2
-rw-r--r--tools/perf/builtin-inject.c8
-rw-r--r--tools/perf/builtin-kvm.c8
-rw-r--r--tools/perf/builtin-record.c14
-rw-r--r--tools/perf/builtin-report.c8
-rw-r--r--tools/perf/builtin-sched.c4
-rw-r--r--tools/perf/builtin-script.c10
-rw-r--r--tools/perf/builtin-stat.c2
-rw-r--r--tools/perf/builtin-top.c14
-rw-r--r--tools/perf/builtin-trace.c16
-rw-r--r--tools/perf/tests/backward-ring-buffer.c6
-rw-r--r--tools/perf/tests/bpf.c2
-rw-r--r--tools/perf/tests/code-reading.c8
-rw-r--r--tools/perf/tests/event-times.c20
-rw-r--r--tools/perf/tests/event_update.c2
-rw-r--r--tools/perf/tests/evsel-roundtrip-name.c4
-rw-r--r--tools/perf/tests/hists_cumulate.c2
-rw-r--r--tools/perf/tests/hists_filter.c4
-rw-r--r--tools/perf/tests/hists_link.c4
-rw-r--r--tools/perf/tests/hists_output.c2
-rw-r--r--tools/perf/tests/keep-tracking.c4
-rw-r--r--tools/perf/tests/mmap-basic.c2
-rw-r--r--tools/perf/tests/openat-syscall-tp-fields.c2
-rw-r--r--tools/perf/tests/parse-events.c126
-rw-r--r--tools/perf/tests/parse-no-sample-id-all.c4
-rw-r--r--tools/perf/tests/perf-record.c2
-rw-r--r--tools/perf/tests/sw-clock.c2
-rw-r--r--tools/perf/tests/switch-tracking.c10
-rw-r--r--tools/perf/tests/task-exit.c2
-rw-r--r--tools/perf/tests/time-utils-test.c2
-rw-r--r--tools/perf/ui/browsers/hists.c6
-rw-r--r--tools/perf/ui/gtk/gtk.h4
-rw-r--r--tools/perf/ui/gtk/hists.c2
-rw-r--r--tools/perf/ui/hist.c2
-rw-r--r--tools/perf/util/auxtrace.c10
-rw-r--r--tools/perf/util/auxtrace.h24
-rw-r--r--tools/perf/util/bpf-event.c2
-rw-r--r--tools/perf/util/bpf-event.h4
-rw-r--r--tools/perf/util/bpf-loader.c20
-rw-r--r--tools/perf/util/bpf-loader.h24
-rw-r--r--tools/perf/util/cgroup.c10
-rw-r--r--tools/perf/util/cgroup.h6
-rw-r--r--tools/perf/util/cs-etm.c4
-rw-r--r--tools/perf/util/data-convert-bt.c4
-rw-r--r--tools/perf/util/evlist.c194
-rw-r--r--tools/perf/util/evlist.h160
-rw-r--r--tools/perf/util/evsel.c4
-rw-r--r--tools/perf/util/evsel.h4
-rw-r--r--tools/perf/util/header.c86
-rw-r--r--tools/perf/util/header.h16
-rw-r--r--tools/perf/util/hist.c2
-rw-r--r--tools/perf/util/hist.h10
-rw-r--r--tools/perf/util/intel-bts.c2
-rw-r--r--tools/perf/util/intel-pt.c10
-rw-r--r--tools/perf/util/kvm-stat.h4
-rw-r--r--tools/perf/util/metricgroup.c6
-rw-r--r--tools/perf/util/mmap.c2
-rw-r--r--tools/perf/util/parse-events.c10
-rw-r--r--tools/perf/util/parse-events.h6
-rw-r--r--tools/perf/util/python.c16
-rw-r--r--tools/perf/util/record.c8
-rw-r--r--tools/perf/util/s390-sample-raw.c2
-rw-r--r--tools/perf/util/sample-raw.c2
-rw-r--r--tools/perf/util/sample-raw.h6
-rw-r--r--tools/perf/util/session.c24
-rw-r--r--tools/perf/util/session.h4
-rw-r--r--tools/perf/util/sort.c20
-rw-r--r--tools/perf/util/sort.h6
-rw-r--r--tools/perf/util/stat-display.c18
-rw-r--r--tools/perf/util/stat-shadow.c4
-rw-r--r--tools/perf/util/stat.c8
-rw-r--r--tools/perf/util/stat.h14
-rw-r--r--tools/perf/util/tool.h4
-rw-r--r--tools/perf/util/top.h4
86 files changed, 571 insertions, 571 deletions
diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c
index fd17dccfcb0b..306a54185438 100644
--- a/tools/perf/arch/arm/util/auxtrace.c
+++ b/tools/perf/arch/arm/util/auxtrace.c
@@ -50,7 +50,7 @@ static struct perf_pmu **find_all_arm_spe_pmus(int *nr_spes, int *err)
50} 50}
51 51
52struct auxtrace_record 52struct auxtrace_record
53*auxtrace_record__init(struct perf_evlist *evlist, int *err) 53*auxtrace_record__init(struct evlist *evlist, int *err)
54{ 54{
55 struct perf_pmu *cs_etm_pmu; 55 struct perf_pmu *cs_etm_pmu;
56 struct evsel *evsel; 56 struct evsel *evsel;
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 476f845be5fe..91c64daa4487 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -32,7 +32,7 @@
32struct cs_etm_recording { 32struct cs_etm_recording {
33 struct auxtrace_record itr; 33 struct auxtrace_record itr;
34 struct perf_pmu *cs_etm_pmu; 34 struct perf_pmu *cs_etm_pmu;
35 struct perf_evlist *evlist; 35 struct evlist *evlist;
36 int wrapped_cnt; 36 int wrapped_cnt;
37 bool *wrapped; 37 bool *wrapped;
38 bool snapshot_mode; 38 bool snapshot_mode;
@@ -245,7 +245,7 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu,
245} 245}
246 246
247static int cs_etm_recording_options(struct auxtrace_record *itr, 247static int cs_etm_recording_options(struct auxtrace_record *itr,
248 struct perf_evlist *evlist, 248 struct evlist *evlist,
249 struct record_opts *opts) 249 struct record_opts *opts)
250{ 250{
251 int ret; 251 int ret;
@@ -434,7 +434,7 @@ static u64 cs_etm_get_config(struct auxtrace_record *itr)
434 struct cs_etm_recording *ptr = 434 struct cs_etm_recording *ptr =
435 container_of(itr, struct cs_etm_recording, itr); 435 container_of(itr, struct cs_etm_recording, itr);
436 struct perf_pmu *cs_etm_pmu = ptr->cs_etm_pmu; 436 struct perf_pmu *cs_etm_pmu = ptr->cs_etm_pmu;
437 struct perf_evlist *evlist = ptr->evlist; 437 struct evlist *evlist = ptr->evlist;
438 struct evsel *evsel; 438 struct evsel *evsel;
439 439
440 evlist__for_each_entry(evlist, evsel) { 440 evlist__for_each_entry(evlist, evsel) {
@@ -485,7 +485,7 @@ static u64 cs_etmv4_get_config(struct auxtrace_record *itr)
485 485
486static size_t 486static size_t
487cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused, 487cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused,
488 struct perf_evlist *evlist __maybe_unused) 488 struct evlist *evlist __maybe_unused)
489{ 489{
490 int i; 490 int i;
491 int etmv3 = 0, etmv4 = 0; 491 int etmv3 = 0, etmv4 = 0;
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index 103bf20ae32a..cc29b995c751 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -27,12 +27,12 @@
27struct arm_spe_recording { 27struct arm_spe_recording {
28 struct auxtrace_record itr; 28 struct auxtrace_record itr;
29 struct perf_pmu *arm_spe_pmu; 29 struct perf_pmu *arm_spe_pmu;
30 struct perf_evlist *evlist; 30 struct evlist *evlist;
31}; 31};
32 32
33static size_t 33static size_t
34arm_spe_info_priv_size(struct auxtrace_record *itr __maybe_unused, 34arm_spe_info_priv_size(struct auxtrace_record *itr __maybe_unused,
35 struct perf_evlist *evlist __maybe_unused) 35 struct evlist *evlist __maybe_unused)
36{ 36{
37 return ARM_SPE_AUXTRACE_PRIV_SIZE; 37 return ARM_SPE_AUXTRACE_PRIV_SIZE;
38} 38}
@@ -59,7 +59,7 @@ static int arm_spe_info_fill(struct auxtrace_record *itr,
59} 59}
60 60
61static int arm_spe_recording_options(struct auxtrace_record *itr, 61static int arm_spe_recording_options(struct auxtrace_record *itr,
62 struct perf_evlist *evlist, 62 struct evlist *evlist,
63 struct record_opts *opts) 63 struct record_opts *opts)
64{ 64{
65 struct arm_spe_recording *sper = 65 struct arm_spe_recording *sper =
diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools/perf/arch/powerpc/util/kvm-stat.c
index 557c474f0a4b..28fc0bab370f 100644
--- a/tools/perf/arch/powerpc/util/kvm-stat.c
+++ b/tools/perf/arch/powerpc/util/kvm-stat.c
@@ -106,7 +106,7 @@ const char * const kvm_skip_events[] = {
106}; 106};
107 107
108 108
109static int is_tracepoint_available(const char *str, struct perf_evlist *evlist) 109static int is_tracepoint_available(const char *str, struct evlist *evlist)
110{ 110{
111 struct parse_events_error err; 111 struct parse_events_error err;
112 int ret; 112 int ret;
@@ -119,7 +119,7 @@ static int is_tracepoint_available(const char *str, struct perf_evlist *evlist)
119} 119}
120 120
121static int ppc__setup_book3s_hv(struct perf_kvm_stat *kvm, 121static int ppc__setup_book3s_hv(struct perf_kvm_stat *kvm,
122 struct perf_evlist *evlist) 122 struct evlist *evlist)
123{ 123{
124 const char **events_ptr; 124 const char **events_ptr;
125 int i, nr_tp = 0, err = -1; 125 int i, nr_tp = 0, err = -1;
@@ -146,7 +146,7 @@ static int ppc__setup_book3s_hv(struct perf_kvm_stat *kvm,
146/* Wrapper to setup kvm tracepoints */ 146/* Wrapper to setup kvm tracepoints */
147static int ppc__setup_kvm_tp(struct perf_kvm_stat *kvm) 147static int ppc__setup_kvm_tp(struct perf_kvm_stat *kvm)
148{ 148{
149 struct perf_evlist *evlist = perf_evlist__new(); 149 struct evlist *evlist = perf_evlist__new();
150 150
151 if (evlist == NULL) 151 if (evlist == NULL)
152 return -ENOMEM; 152 return -ENOMEM;
diff --git a/tools/perf/arch/s390/util/auxtrace.c b/tools/perf/arch/s390/util/auxtrace.c
index aec819b945c5..833f60fa9c5a 100644
--- a/tools/perf/arch/s390/util/auxtrace.c
+++ b/tools/perf/arch/s390/util/auxtrace.c
@@ -20,7 +20,7 @@ static void cpumsf_free(struct auxtrace_record *itr)
20} 20}
21 21
22static size_t cpumsf_info_priv_size(struct auxtrace_record *itr __maybe_unused, 22static size_t cpumsf_info_priv_size(struct auxtrace_record *itr __maybe_unused,
23 struct perf_evlist *evlist __maybe_unused) 23 struct evlist *evlist __maybe_unused)
24{ 24{
25 return 0; 25 return 0;
26} 26}
@@ -43,7 +43,7 @@ cpumsf_reference(struct auxtrace_record *itr __maybe_unused)
43 43
44static int 44static int
45cpumsf_recording_options(struct auxtrace_record *ar __maybe_unused, 45cpumsf_recording_options(struct auxtrace_record *ar __maybe_unused,
46 struct perf_evlist *evlist __maybe_unused, 46 struct evlist *evlist __maybe_unused,
47 struct record_opts *opts) 47 struct record_opts *opts)
48{ 48{
49 unsigned int factor = 1; 49 unsigned int factor = 1;
@@ -82,7 +82,7 @@ cpumsf_parse_snapshot_options(struct auxtrace_record *itr __maybe_unused,
82 * auxtrace_record__init is called when perf record 82 * auxtrace_record__init is called when perf record
83 * check if the event really need auxtrace 83 * check if the event really need auxtrace
84 */ 84 */
85struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist, 85struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
86 int *err) 86 int *err)
87{ 87{
88 struct auxtrace_record *aux; 88 struct auxtrace_record *aux;
diff --git a/tools/perf/arch/x86/tests/intel-cqm.c b/tools/perf/arch/x86/tests/intel-cqm.c
index b88ed71b2e3f..333b2f0d61e4 100644
--- a/tools/perf/arch/x86/tests/intel-cqm.c
+++ b/tools/perf/arch/x86/tests/intel-cqm.c
@@ -40,7 +40,7 @@ static pid_t spawn(void)
40 */ 40 */
41int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused) 41int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused)
42{ 42{
43 struct perf_evlist *evlist = NULL; 43 struct evlist *evlist = NULL;
44 struct evsel *evsel = NULL; 44 struct evsel *evsel = NULL;
45 struct perf_event_attr pe; 45 struct perf_event_attr pe;
46 int i, fd[2], flag, ret; 46 int i, fd[2], flag, ret;
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
index 43fc7d426d93..d7092fc00e3b 100644
--- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c
+++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
@@ -51,7 +51,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
51 }; 51 };
52 struct perf_thread_map *threads = NULL; 52 struct perf_thread_map *threads = NULL;
53 struct perf_cpu_map *cpus = NULL; 53 struct perf_cpu_map *cpus = NULL;
54 struct perf_evlist *evlist = NULL; 54 struct evlist *evlist = NULL;
55 struct evsel *evsel = NULL; 55 struct evsel *evsel = NULL;
56 int err = -1, ret, i; 56 int err = -1, ret, i;
57 const char *comm1, *comm2; 57 const char *comm1, *comm2;
diff --git a/tools/perf/arch/x86/util/auxtrace.c b/tools/perf/arch/x86/util/auxtrace.c
index 02f192114448..6b3ad5c826fd 100644
--- a/tools/perf/arch/x86/util/auxtrace.c
+++ b/tools/perf/arch/x86/util/auxtrace.c
@@ -16,7 +16,7 @@
16#include "../../util/evlist.h" 16#include "../../util/evlist.h"
17 17
18static 18static
19struct auxtrace_record *auxtrace_record__init_intel(struct perf_evlist *evlist, 19struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist,
20 int *err) 20 int *err)
21{ 21{
22 struct perf_pmu *intel_pt_pmu; 22 struct perf_pmu *intel_pt_pmu;
@@ -50,7 +50,7 @@ struct auxtrace_record *auxtrace_record__init_intel(struct perf_evlist *evlist,
50 return NULL; 50 return NULL;
51} 51}
52 52
53struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist, 53struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
54 int *err) 54 int *err)
55{ 55{
56 char buffer[64]; 56 char buffer[64];
diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
index 59685a19c3b9..c845531d383a 100644
--- a/tools/perf/arch/x86/util/intel-bts.c
+++ b/tools/perf/arch/x86/util/intel-bts.c
@@ -35,7 +35,7 @@ struct intel_bts_snapshot_ref {
35struct intel_bts_recording { 35struct intel_bts_recording {
36 struct auxtrace_record itr; 36 struct auxtrace_record itr;
37 struct perf_pmu *intel_bts_pmu; 37 struct perf_pmu *intel_bts_pmu;
38 struct perf_evlist *evlist; 38 struct evlist *evlist;
39 bool snapshot_mode; 39 bool snapshot_mode;
40 size_t snapshot_size; 40 size_t snapshot_size;
41 int snapshot_ref_cnt; 41 int snapshot_ref_cnt;
@@ -50,7 +50,7 @@ struct branch {
50 50
51static size_t 51static size_t
52intel_bts_info_priv_size(struct auxtrace_record *itr __maybe_unused, 52intel_bts_info_priv_size(struct auxtrace_record *itr __maybe_unused,
53 struct perf_evlist *evlist __maybe_unused) 53 struct evlist *evlist __maybe_unused)
54{ 54{
55 return INTEL_BTS_AUXTRACE_PRIV_SIZE; 55 return INTEL_BTS_AUXTRACE_PRIV_SIZE;
56} 56}
@@ -99,7 +99,7 @@ static int intel_bts_info_fill(struct auxtrace_record *itr,
99} 99}
100 100
101static int intel_bts_recording_options(struct auxtrace_record *itr, 101static int intel_bts_recording_options(struct auxtrace_record *itr,
102 struct perf_evlist *evlist, 102 struct evlist *evlist,
103 struct record_opts *opts) 103 struct record_opts *opts)
104{ 104{
105 struct intel_bts_recording *btsr = 105 struct intel_bts_recording *btsr =
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index b42df73fd7ff..e4dfe8c3d5c3 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -44,7 +44,7 @@ struct intel_pt_recording {
44 struct auxtrace_record itr; 44 struct auxtrace_record itr;
45 struct perf_pmu *intel_pt_pmu; 45 struct perf_pmu *intel_pt_pmu;
46 int have_sched_switch; 46 int have_sched_switch;
47 struct perf_evlist *evlist; 47 struct evlist *evlist;
48 bool snapshot_mode; 48 bool snapshot_mode;
49 bool snapshot_init_done; 49 bool snapshot_init_done;
50 size_t snapshot_size; 50 size_t snapshot_size;
@@ -110,7 +110,7 @@ static u64 intel_pt_masked_bits(u64 mask, u64 bits)
110} 110}
111 111
112static int intel_pt_read_config(struct perf_pmu *intel_pt_pmu, const char *str, 112static int intel_pt_read_config(struct perf_pmu *intel_pt_pmu, const char *str,
113 struct perf_evlist *evlist, u64 *res) 113 struct evlist *evlist, u64 *res)
114{ 114{
115 struct evsel *evsel; 115 struct evsel *evsel;
116 u64 mask; 116 u64 mask;
@@ -132,7 +132,7 @@ static int intel_pt_read_config(struct perf_pmu *intel_pt_pmu, const char *str,
132} 132}
133 133
134static size_t intel_pt_psb_period(struct perf_pmu *intel_pt_pmu, 134static size_t intel_pt_psb_period(struct perf_pmu *intel_pt_pmu,
135 struct perf_evlist *evlist) 135 struct evlist *evlist)
136{ 136{
137 u64 val; 137 u64 val;
138 int err, topa_multiple_entries; 138 int err, topa_multiple_entries;
@@ -268,7 +268,7 @@ intel_pt_pmu_default_config(struct perf_pmu *intel_pt_pmu)
268 return attr; 268 return attr;
269} 269}
270 270
271static const char *intel_pt_find_filter(struct perf_evlist *evlist, 271static const char *intel_pt_find_filter(struct evlist *evlist,
272 struct perf_pmu *intel_pt_pmu) 272 struct perf_pmu *intel_pt_pmu)
273{ 273{
274 struct evsel *evsel; 274 struct evsel *evsel;
@@ -289,7 +289,7 @@ static size_t intel_pt_filter_bytes(const char *filter)
289} 289}
290 290
291static size_t 291static size_t
292intel_pt_info_priv_size(struct auxtrace_record *itr, struct perf_evlist *evlist) 292intel_pt_info_priv_size(struct auxtrace_record *itr, struct evlist *evlist)
293{ 293{
294 struct intel_pt_recording *ptr = 294 struct intel_pt_recording *ptr =
295 container_of(itr, struct intel_pt_recording, itr); 295 container_of(itr, struct intel_pt_recording, itr);
@@ -398,7 +398,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
398 return 0; 398 return 0;
399} 399}
400 400
401static int intel_pt_track_switches(struct perf_evlist *evlist) 401static int intel_pt_track_switches(struct evlist *evlist)
402{ 402{
403 const char *sched_switch = "sched:sched_switch"; 403 const char *sched_switch = "sched:sched_switch";
404 struct evsel *evsel; 404 struct evsel *evsel;
@@ -549,7 +549,7 @@ static int intel_pt_validate_config(struct perf_pmu *intel_pt_pmu,
549} 549}
550 550
551static int intel_pt_recording_options(struct auxtrace_record *itr, 551static int intel_pt_recording_options(struct auxtrace_record *itr,
552 struct perf_evlist *evlist, 552 struct evlist *evlist,
553 struct record_opts *opts) 553 struct record_opts *opts)
554{ 554{
555 struct intel_pt_recording *ptr = 555 struct intel_pt_recording *ptr =
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index d251a486f329..f0aae6e13a33 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2236,7 +2236,7 @@ static void print_pareto(FILE *out)
2236 2236
2237static void print_c2c_info(FILE *out, struct perf_session *session) 2237static void print_c2c_info(FILE *out, struct perf_session *session)
2238{ 2238{
2239 struct perf_evlist *evlist = session->evlist; 2239 struct evlist *evlist = session->evlist;
2240 struct evsel *evsel; 2240 struct evsel *evsel;
2241 bool first = true; 2241 bool first = true;
2242 2242
@@ -2567,7 +2567,7 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
2567 return parse_callchain_report_opt(arg); 2567 return parse_callchain_report_opt(arg);
2568} 2568}
2569 2569
2570static int setup_callchain(struct perf_evlist *evlist) 2570static int setup_callchain(struct evlist *evlist)
2571{ 2571{
2572 u64 sample_type = perf_evlist__combined_sample_type(evlist); 2572 u64 sample_type = perf_evlist__combined_sample_type(evlist);
2573 enum perf_call_graph_mode mode = CALLCHAIN_NONE; 2573 enum perf_call_graph_mode mode = CALLCHAIN_NONE;
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index c3b4b8196e00..e91c0d798181 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -449,7 +449,7 @@ static struct perf_diff pdiff = {
449}; 449};
450 450
451static struct evsel *evsel_match(struct evsel *evsel, 451static struct evsel *evsel_match(struct evsel *evsel,
452 struct perf_evlist *evlist) 452 struct evlist *evlist)
453{ 453{
454 struct evsel *e; 454 struct evsel *e;
455 455
@@ -461,7 +461,7 @@ static struct evsel *evsel_match(struct evsel *evsel,
461 return NULL; 461 return NULL;
462} 462}
463 463
464static void perf_evlist__collapse_resort(struct perf_evlist *evlist) 464static void perf_evlist__collapse_resort(struct evlist *evlist)
465{ 465{
466 struct evsel *evsel; 466 struct evsel *evsel;
467 467
@@ -1009,7 +1009,7 @@ static void data__fprintf(void)
1009 1009
1010static void data_process(void) 1010static void data_process(void)
1011{ 1011{
1012 struct perf_evlist *evlist_base = data__files[0].session->evlist; 1012 struct evlist *evlist_base = data__files[0].session->evlist;
1013 struct evsel *evsel_base; 1013 struct evsel *evsel_base;
1014 bool first = true; 1014 bool first = true;
1015 1015
@@ -1019,7 +1019,7 @@ static void data_process(void)
1019 int i; 1019 int i;
1020 1020
1021 data__for_each_file_new(i, d) { 1021 data__for_each_file_new(i, d) {
1022 struct perf_evlist *evlist = d->session->evlist; 1022 struct evlist *evlist = d->session->evlist;
1023 struct evsel *evsel; 1023 struct evsel *evsel;
1024 struct hists *hists; 1024 struct hists *hists;
1025 1025
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index 3e81e0b6628f..1263987c291a 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -27,7 +27,7 @@
27#define DEFAULT_TRACER "function_graph" 27#define DEFAULT_TRACER "function_graph"
28 28
29struct perf_ftrace { 29struct perf_ftrace {
30 struct perf_evlist *evlist; 30 struct evlist *evlist;
31 struct target target; 31 struct target target;
32 const char *tracer; 32 const char *tracer;
33 struct list_head filters; 33 struct list_head filters;
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 646a1bf790fc..d2131fc863be 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -96,7 +96,7 @@ static int perf_event__repipe_op2_synth(struct perf_session *session,
96 96
97static int perf_event__repipe_attr(struct perf_tool *tool, 97static int perf_event__repipe_attr(struct perf_tool *tool,
98 union perf_event *event, 98 union perf_event *event,
99 struct perf_evlist **pevlist) 99 struct evlist **pevlist)
100{ 100{
101 struct perf_inject *inject = container_of(tool, struct perf_inject, 101 struct perf_inject *inject = container_of(tool, struct perf_inject,
102 tool); 102 tool);
@@ -567,7 +567,7 @@ static int drop_sample(struct perf_tool *tool __maybe_unused,
567 567
568static void strip_init(struct perf_inject *inject) 568static void strip_init(struct perf_inject *inject)
569{ 569{
570 struct perf_evlist *evlist = inject->session->evlist; 570 struct evlist *evlist = inject->session->evlist;
571 struct evsel *evsel; 571 struct evsel *evsel;
572 572
573 inject->tool.context_switch = perf_event__drop; 573 inject->tool.context_switch = perf_event__drop;
@@ -590,7 +590,7 @@ static bool has_tracking(struct evsel *evsel)
590 * their selected event to exist, except if there is only 1 selected event left 590 * their selected event to exist, except if there is only 1 selected event left
591 * and it has a compatible sample type. 591 * and it has a compatible sample type.
592 */ 592 */
593static bool ok_to_remove(struct perf_evlist *evlist, 593static bool ok_to_remove(struct evlist *evlist,
594 struct evsel *evsel_to_remove) 594 struct evsel *evsel_to_remove)
595{ 595{
596 struct evsel *evsel; 596 struct evsel *evsel;
@@ -614,7 +614,7 @@ static bool ok_to_remove(struct perf_evlist *evlist,
614 614
615static void strip_fini(struct perf_inject *inject) 615static void strip_fini(struct perf_inject *inject)
616{ 616{
617 struct perf_evlist *evlist = inject->session->evlist; 617 struct evlist *evlist = inject->session->evlist;
618 struct evsel *evsel, *tmp; 618 struct evsel *evsel, *tmp;
619 619
620 /* Remove non-synthesized evsels if possible */ 620 /* Remove non-synthesized evsels if possible */
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index cf8f27d05296..963dddc5853d 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -743,7 +743,7 @@ static bool verify_vcpu(int vcpu)
743static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx, 743static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx,
744 u64 *mmap_time) 744 u64 *mmap_time)
745{ 745{
746 struct perf_evlist *evlist = kvm->evlist; 746 struct evlist *evlist = kvm->evlist;
747 union perf_event *event; 747 union perf_event *event;
748 struct perf_mmap *md; 748 struct perf_mmap *md;
749 u64 timestamp; 749 u64 timestamp;
@@ -1012,7 +1012,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
1012{ 1012{
1013 int err, rc = -1; 1013 int err, rc = -1;
1014 struct evsel *pos; 1014 struct evsel *pos;
1015 struct perf_evlist *evlist = kvm->evlist; 1015 struct evlist *evlist = kvm->evlist;
1016 char sbuf[STRERR_BUFSIZE]; 1016 char sbuf[STRERR_BUFSIZE];
1017 1017
1018 perf_evlist__config(evlist, &kvm->opts, NULL); 1018 perf_evlist__config(evlist, &kvm->opts, NULL);
@@ -1283,9 +1283,9 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
1283} 1283}
1284 1284
1285#ifdef HAVE_TIMERFD_SUPPORT 1285#ifdef HAVE_TIMERFD_SUPPORT
1286static struct perf_evlist *kvm_live_event_list(void) 1286static struct evlist *kvm_live_event_list(void)
1287{ 1287{
1288 struct perf_evlist *evlist; 1288 struct evlist *evlist;
1289 char *tp, *name, *sys; 1289 char *tp, *name, *sys;
1290 int err = -1; 1290 int err = -1;
1291 const char * const *events_tp; 1291 const char * const *events_tp;
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 7ba3a2c32e54..f08d1e6a1651 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -73,7 +73,7 @@ struct record {
73 u64 bytes_written; 73 u64 bytes_written;
74 struct perf_data data; 74 struct perf_data data;
75 struct auxtrace_record *itr; 75 struct auxtrace_record *itr;
76 struct perf_evlist *evlist; 76 struct evlist *evlist;
77 struct perf_session *session; 77 struct perf_session *session;
78 int realtime_prio; 78 int realtime_prio;
79 bool no_buildid; 79 bool no_buildid;
@@ -346,7 +346,7 @@ static void record__aio_set_pos(int trace_fd, off_t pos)
346static void record__aio_mmap_read_sync(struct record *rec) 346static void record__aio_mmap_read_sync(struct record *rec)
347{ 347{
348 int i; 348 int i;
349 struct perf_evlist *evlist = rec->evlist; 349 struct evlist *evlist = rec->evlist;
350 struct perf_mmap *maps = evlist->mmap; 350 struct perf_mmap *maps = evlist->mmap;
351 351
352 if (!record__aio_enabled(rec)) 352 if (!record__aio_enabled(rec))
@@ -672,7 +672,7 @@ static int record__auxtrace_init(struct record *rec __maybe_unused)
672#endif 672#endif
673 673
674static int record__mmap_evlist(struct record *rec, 674static int record__mmap_evlist(struct record *rec,
675 struct perf_evlist *evlist) 675 struct evlist *evlist)
676{ 676{
677 struct record_opts *opts = &rec->opts; 677 struct record_opts *opts = &rec->opts;
678 char msg[512]; 678 char msg[512];
@@ -714,7 +714,7 @@ static int record__open(struct record *rec)
714{ 714{
715 char msg[BUFSIZ]; 715 char msg[BUFSIZ];
716 struct evsel *pos; 716 struct evsel *pos;
717 struct perf_evlist *evlist = rec->evlist; 717 struct evlist *evlist = rec->evlist;
718 struct perf_session *session = rec->session; 718 struct perf_session *session = rec->session;
719 struct record_opts *opts = &rec->opts; 719 struct record_opts *opts = &rec->opts;
720 int rc = 0; 720 int rc = 0;
@@ -904,7 +904,7 @@ static size_t zstd_compress(struct perf_session *session, void *dst, size_t dst_
904 return compressed; 904 return compressed;
905} 905}
906 906
907static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evlist, 907static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist,
908 bool overwrite, bool synch) 908 bool overwrite, bool synch)
909{ 909{
910 u64 bytes_written = rec->bytes_written; 910 u64 bytes_written = rec->bytes_written;
@@ -1165,7 +1165,7 @@ perf_event__synth_time_conv(const struct perf_event_mmap_page *pc __maybe_unused
1165} 1165}
1166 1166
1167static const struct perf_event_mmap_page * 1167static const struct perf_event_mmap_page *
1168perf_evlist__pick_pc(struct perf_evlist *evlist) 1168perf_evlist__pick_pc(struct evlist *evlist)
1169{ 1169{
1170 if (evlist) { 1170 if (evlist) {
1171 if (evlist->mmap && evlist->mmap[0].base) 1171 if (evlist->mmap && evlist->mmap[0].base)
@@ -1313,7 +1313,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
1313 struct perf_data *data = &rec->data; 1313 struct perf_data *data = &rec->data;
1314 struct perf_session *session; 1314 struct perf_session *session;
1315 bool disabled = false, draining = false; 1315 bool disabled = false, draining = false;
1316 struct perf_evlist *sb_evlist = NULL; 1316 struct evlist *sb_evlist = NULL;
1317 int fd; 1317 int fd;
1318 float ratio = 0; 1318 float ratio = 0;
1319 1319
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 96a506f0d4c1..e258e988c55b 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -193,7 +193,7 @@ out:
193} 193}
194 194
195static void setup_forced_leader(struct report *report, 195static void setup_forced_leader(struct report *report,
196 struct perf_evlist *evlist) 196 struct evlist *evlist)
197{ 197{
198 if (report->group_set) 198 if (report->group_set)
199 perf_evlist__force_leader(evlist); 199 perf_evlist__force_leader(evlist);
@@ -459,7 +459,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
459 return ret + fprintf(fp, "\n#\n"); 459 return ret + fprintf(fp, "\n#\n");
460} 460}
461 461
462static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist, 462static int perf_evlist__tty_browse_hists(struct evlist *evlist,
463 struct report *rep, 463 struct report *rep,
464 const char *help) 464 const char *help)
465{ 465{
@@ -532,7 +532,7 @@ static void report__warn_kptr_restrict(const struct report *rep)
532 532
533static int report__gtk_browse_hists(struct report *rep, const char *help) 533static int report__gtk_browse_hists(struct report *rep, const char *help)
534{ 534{
535 int (*hist_browser)(struct perf_evlist *evlist, const char *help, 535 int (*hist_browser)(struct evlist *evlist, const char *help,
536 struct hist_browser_timer *timer, float min_pcnt); 536 struct hist_browser_timer *timer, float min_pcnt);
537 537
538 hist_browser = dlsym(perf_gtk_handle, "perf_evlist__gtk_browse_hists"); 538 hist_browser = dlsym(perf_gtk_handle, "perf_evlist__gtk_browse_hists");
@@ -549,7 +549,7 @@ static int report__browse_hists(struct report *rep)
549{ 549{
550 int ret; 550 int ret;
551 struct perf_session *session = rep->session; 551 struct perf_session *session = rep->session;
552 struct perf_evlist *evlist = session->evlist; 552 struct evlist *evlist = session->evlist;
553 const char *help = perf_tip(system_path(TIPDIR)); 553 const char *help = perf_tip(system_path(TIPDIR));
554 554
555 if (help == NULL) { 555 if (help == NULL) {
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 55779f496d27..c02ecb295f23 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -2924,7 +2924,7 @@ static int perf_timehist__process_sample(struct perf_tool *tool,
2924} 2924}
2925 2925
2926static int timehist_check_attr(struct perf_sched *sched, 2926static int timehist_check_attr(struct perf_sched *sched,
2927 struct perf_evlist *evlist) 2927 struct evlist *evlist)
2928{ 2928{
2929 struct evsel *evsel; 2929 struct evsel *evsel;
2930 struct evsel_runtime *er; 2930 struct evsel_runtime *er;
@@ -2963,7 +2963,7 @@ static int perf_sched__timehist(struct perf_sched *sched)
2963 }; 2963 };
2964 2964
2965 struct perf_session *session; 2965 struct perf_session *session;
2966 struct perf_evlist *evlist; 2966 struct evlist *evlist;
2967 int err = -1; 2967 int err = -1;
2968 2968
2969 /* 2969 /*
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 4f9c8bb7620d..d741c0aa2750 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1636,7 +1636,7 @@ struct perf_script {
1636 int range_num; 1636 int range_num;
1637}; 1637};
1638 1638
1639static int perf_evlist__max_name_len(struct perf_evlist *evlist) 1639static int perf_evlist__max_name_len(struct evlist *evlist)
1640{ 1640{
1641 struct evsel *evsel; 1641 struct evsel *evsel;
1642 int max = 0; 1642 int max = 0;
@@ -2018,10 +2018,10 @@ out_put:
2018} 2018}
2019 2019
2020static int process_attr(struct perf_tool *tool, union perf_event *event, 2020static int process_attr(struct perf_tool *tool, union perf_event *event,
2021 struct perf_evlist **pevlist) 2021 struct evlist **pevlist)
2022{ 2022{
2023 struct perf_script *scr = container_of(tool, struct perf_script, tool); 2023 struct perf_script *scr = container_of(tool, struct perf_script, tool);
2024 struct perf_evlist *evlist; 2024 struct evlist *evlist;
2025 struct evsel *evsel, *pos; 2025 struct evsel *evsel, *pos;
2026 int err; 2026 int err;
2027 static struct evsel_script *es; 2027 static struct evsel_script *es;
@@ -2388,7 +2388,7 @@ static void sig_handler(int sig __maybe_unused)
2388 2388
2389static void perf_script__fclose_per_event_dump(struct perf_script *script) 2389static void perf_script__fclose_per_event_dump(struct perf_script *script)
2390{ 2390{
2391 struct perf_evlist *evlist = script->session->evlist; 2391 struct evlist *evlist = script->session->evlist;
2392 struct evsel *evsel; 2392 struct evsel *evsel;
2393 2393
2394 evlist__for_each_entry(evlist, evsel) { 2394 evlist__for_each_entry(evlist, evsel) {
@@ -3256,7 +3256,7 @@ static int process_stat_config_event(struct perf_session *session __maybe_unused
3256 3256
3257static int set_maps(struct perf_script *script) 3257static int set_maps(struct perf_script *script)
3258{ 3258{
3259 struct perf_evlist *evlist = script->session->evlist; 3259 struct evlist *evlist = script->session->evlist;
3260 3260
3261 if (!script->cpus || !script->threads) 3261 if (!script->cpus || !script->threads)
3262 return 0; 3262 return 0;
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index e0ba97018ad7..4e61f8a1d22b 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -130,7 +130,7 @@ static const char *smi_cost_attrs = {
130 "}" 130 "}"
131}; 131};
132 132
133static struct perf_evlist *evsel_list; 133static struct evlist *evsel_list;
134 134
135static struct target target = { 135static struct target target = {
136 .uid = UINT_MAX, 136 .uid = UINT_MAX,
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 2f22f313985e..c29fa1de854f 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -839,7 +839,7 @@ static u64 last_timestamp;
839static void perf_top__mmap_read_idx(struct perf_top *top, int idx) 839static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
840{ 840{
841 struct record_opts *opts = &top->record_opts; 841 struct record_opts *opts = &top->record_opts;
842 struct perf_evlist *evlist = top->evlist; 842 struct evlist *evlist = top->evlist;
843 struct perf_mmap *md; 843 struct perf_mmap *md;
844 union perf_event *event; 844 union perf_event *event;
845 845
@@ -874,7 +874,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
874static void perf_top__mmap_read(struct perf_top *top) 874static void perf_top__mmap_read(struct perf_top *top)
875{ 875{
876 bool overwrite = top->record_opts.overwrite; 876 bool overwrite = top->record_opts.overwrite;
877 struct perf_evlist *evlist = top->evlist; 877 struct evlist *evlist = top->evlist;
878 int i; 878 int i;
879 879
880 if (overwrite) 880 if (overwrite)
@@ -909,7 +909,7 @@ static void perf_top__mmap_read(struct perf_top *top)
909static int perf_top__overwrite_check(struct perf_top *top) 909static int perf_top__overwrite_check(struct perf_top *top)
910{ 910{
911 struct record_opts *opts = &top->record_opts; 911 struct record_opts *opts = &top->record_opts;
912 struct perf_evlist *evlist = top->evlist; 912 struct evlist *evlist = top->evlist;
913 struct perf_evsel_config_term *term; 913 struct perf_evsel_config_term *term;
914 struct list_head *config_terms; 914 struct list_head *config_terms;
915 struct evsel *evsel; 915 struct evsel *evsel;
@@ -955,7 +955,7 @@ static int perf_top_overwrite_fallback(struct perf_top *top,
955 struct evsel *evsel) 955 struct evsel *evsel)
956{ 956{
957 struct record_opts *opts = &top->record_opts; 957 struct record_opts *opts = &top->record_opts;
958 struct perf_evlist *evlist = top->evlist; 958 struct evlist *evlist = top->evlist;
959 struct evsel *counter; 959 struct evsel *counter;
960 960
961 if (!opts->overwrite) 961 if (!opts->overwrite)
@@ -976,7 +976,7 @@ static int perf_top__start_counters(struct perf_top *top)
976{ 976{
977 char msg[BUFSIZ]; 977 char msg[BUFSIZ];
978 struct evsel *counter; 978 struct evsel *counter;
979 struct perf_evlist *evlist = top->evlist; 979 struct evlist *evlist = top->evlist;
980 struct record_opts *opts = &top->record_opts; 980 struct record_opts *opts = &top->record_opts;
981 981
982 if (perf_top__overwrite_check(top)) { 982 if (perf_top__overwrite_check(top)) {
@@ -1100,7 +1100,7 @@ static int deliver_event(struct ordered_events *qe,
1100 struct ordered_event *qevent) 1100 struct ordered_event *qevent)
1101{ 1101{
1102 struct perf_top *top = qe->data; 1102 struct perf_top *top = qe->data;
1103 struct perf_evlist *evlist = top->evlist; 1103 struct evlist *evlist = top->evlist;
1104 struct perf_session *session = top->session; 1104 struct perf_session *session = top->session;
1105 union perf_event *event = qevent->event; 1105 union perf_event *event = qevent->event;
1106 struct perf_sample sample; 1106 struct perf_sample sample;
@@ -1511,7 +1511,7 @@ int cmd_top(int argc, const char **argv)
1511 "Record namespaces events"), 1511 "Record namespaces events"),
1512 OPT_END() 1512 OPT_END()
1513 }; 1513 };
1514 struct perf_evlist *sb_evlist = NULL; 1514 struct evlist *sb_evlist = NULL;
1515 const char * const top_usage[] = { 1515 const char * const top_usage[] = {
1516 "perf top [<options>]", 1516 "perf top [<options>]",
1517 NULL 1517 NULL
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index fde7eff811f9..f7e7daac3cbe 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -96,7 +96,7 @@ struct trace {
96 struct bpf_map *map; 96 struct bpf_map *map;
97 } dump; 97 } dump;
98 struct record_opts opts; 98 struct record_opts opts;
99 struct perf_evlist *evlist; 99 struct evlist *evlist;
100 struct machine *host; 100 struct machine *host;
101 struct thread *current; 101 struct thread *current;
102 struct bpf_object *bpf_obj; 102 struct bpf_object *bpf_obj;
@@ -1388,7 +1388,7 @@ static char *trace__machine__resolve_kernel_addr(void *vmachine, unsigned long l
1388 return machine__resolve_kernel_addr(vmachine, addrp, modp); 1388 return machine__resolve_kernel_addr(vmachine, addrp, modp);
1389} 1389}
1390 1390
1391static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist) 1391static int trace__symbols_init(struct trace *trace, struct evlist *evlist)
1392{ 1392{
1393 int err = symbol__init(NULL); 1393 int err = symbol__init(NULL);
1394 1394
@@ -2616,7 +2616,7 @@ static int trace__record(struct trace *trace, int argc, const char **argv)
2616 2616
2617static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp); 2617static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp);
2618 2618
2619static bool perf_evlist__add_vfs_getname(struct perf_evlist *evlist) 2619static bool perf_evlist__add_vfs_getname(struct evlist *evlist)
2620{ 2620{
2621 bool found = false; 2621 bool found = false;
2622 struct evsel *evsel, *tmp; 2622 struct evsel *evsel, *tmp;
@@ -2699,7 +2699,7 @@ static void trace__handle_event(struct trace *trace, union perf_event *event, st
2699static int trace__add_syscall_newtp(struct trace *trace) 2699static int trace__add_syscall_newtp(struct trace *trace)
2700{ 2700{
2701 int ret = -1; 2701 int ret = -1;
2702 struct perf_evlist *evlist = trace->evlist; 2702 struct evlist *evlist = trace->evlist;
2703 struct evsel *sys_enter, *sys_exit; 2703 struct evsel *sys_enter, *sys_exit;
2704 2704
2705 sys_enter = perf_evsel__raw_syscall_newtp("sys_enter", trace__sys_enter); 2705 sys_enter = perf_evsel__raw_syscall_newtp("sys_enter", trace__sys_enter);
@@ -3192,7 +3192,7 @@ static int trace__set_filter_pids(struct trace *trace)
3192 3192
3193static int __trace__deliver_event(struct trace *trace, union perf_event *event) 3193static int __trace__deliver_event(struct trace *trace, union perf_event *event)
3194{ 3194{
3195 struct perf_evlist *evlist = trace->evlist; 3195 struct evlist *evlist = trace->evlist;
3196 struct perf_sample sample; 3196 struct perf_sample sample;
3197 int err; 3197 int err;
3198 3198
@@ -3250,7 +3250,7 @@ static int ordered_events__deliver_event(struct ordered_events *oe,
3250 3250
3251static int trace__run(struct trace *trace, int argc, const char **argv) 3251static int trace__run(struct trace *trace, int argc, const char **argv)
3252{ 3252{
3253 struct perf_evlist *evlist = trace->evlist; 3253 struct evlist *evlist = trace->evlist;
3254 struct evsel *evsel, *pgfault_maj = NULL, *pgfault_min = NULL; 3254 struct evsel *evsel, *pgfault_maj = NULL, *pgfault_min = NULL;
3255 int err = -1, i; 3255 int err = -1, i;
3256 unsigned long before; 3256 unsigned long before;
@@ -3843,7 +3843,7 @@ static int parse_pagefaults(const struct option *opt, const char *str,
3843 return 0; 3843 return 0;
3844} 3844}
3845 3845
3846static void evlist__set_evsel_handler(struct perf_evlist *evlist, void *handler) 3846static void evlist__set_evsel_handler(struct evlist *evlist, void *handler)
3847{ 3847{
3848 struct evsel *evsel; 3848 struct evsel *evsel;
3849 3849
@@ -3851,7 +3851,7 @@ static void evlist__set_evsel_handler(struct perf_evlist *evlist, void *handler)
3851 evsel->handler = handler; 3851 evsel->handler = handler;
3852} 3852}
3853 3853
3854static int evlist__set_syscall_tp_fields(struct perf_evlist *evlist) 3854static int evlist__set_syscall_tp_fields(struct evlist *evlist)
3855{ 3855{
3856 struct evsel *evsel; 3856 struct evsel *evsel;
3857 3857
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index 921af318507c..3f9c931069b0 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -25,7 +25,7 @@ static void testcase(void)
25 } 25 }
26} 26}
27 27
28static int count_samples(struct perf_evlist *evlist, int *sample_count, 28static int count_samples(struct evlist *evlist, int *sample_count,
29 int *comm_count) 29 int *comm_count)
30{ 30{
31 int i; 31 int i;
@@ -55,7 +55,7 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count,
55 return TEST_OK; 55 return TEST_OK;
56} 56}
57 57
58static int do_test(struct perf_evlist *evlist, int mmap_pages, 58static int do_test(struct evlist *evlist, int mmap_pages,
59 int *sample_count, int *comm_count) 59 int *sample_count, int *comm_count)
60{ 60{
61 int err; 61 int err;
@@ -82,7 +82,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
82{ 82{
83 int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0; 83 int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0;
84 char pid[16], sbuf[STRERR_BUFSIZE]; 84 char pid[16], sbuf[STRERR_BUFSIZE];
85 struct perf_evlist *evlist; 85 struct evlist *evlist;
86 struct evsel *evsel __maybe_unused; 86 struct evsel *evsel __maybe_unused;
87 struct parse_events_error parse_error; 87 struct parse_events_error parse_error;
88 struct record_opts opts = { 88 struct record_opts opts = {
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index c9e4cdc4c9c8..95a15b51f95c 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -118,7 +118,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
118 118
119 char pid[16]; 119 char pid[16];
120 char sbuf[STRERR_BUFSIZE]; 120 char sbuf[STRERR_BUFSIZE];
121 struct perf_evlist *evlist; 121 struct evlist *evlist;
122 int i, ret = TEST_FAIL, err = 0, count = 0; 122 int i, ret = TEST_FAIL, err = 0, count = 0;
123 123
124 struct parse_events_state parse_state; 124 struct parse_events_state parse_state;
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 062d23bba2df..168deb9c563e 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -362,7 +362,7 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,
362} 362}
363 363
364static int process_sample_event(struct machine *machine, 364static int process_sample_event(struct machine *machine,
365 struct perf_evlist *evlist, 365 struct evlist *evlist,
366 union perf_event *event, struct state *state) 366 union perf_event *event, struct state *state)
367{ 367{
368 struct perf_sample sample; 368 struct perf_sample sample;
@@ -385,7 +385,7 @@ static int process_sample_event(struct machine *machine,
385 return ret; 385 return ret;
386} 386}
387 387
388static int process_event(struct machine *machine, struct perf_evlist *evlist, 388static int process_event(struct machine *machine, struct evlist *evlist,
389 union perf_event *event, struct state *state) 389 union perf_event *event, struct state *state)
390{ 390{
391 if (event->header.type == PERF_RECORD_SAMPLE) 391 if (event->header.type == PERF_RECORD_SAMPLE)
@@ -408,7 +408,7 @@ static int process_event(struct machine *machine, struct perf_evlist *evlist,
408 return 0; 408 return 0;
409} 409}
410 410
411static int process_events(struct machine *machine, struct perf_evlist *evlist, 411static int process_events(struct machine *machine, struct evlist *evlist,
412 struct state *state) 412 struct state *state)
413{ 413{
414 union perf_event *event; 414 union perf_event *event;
@@ -554,7 +554,7 @@ static int do_test_code_reading(bool try_kcore)
554 }; 554 };
555 struct perf_thread_map *threads = NULL; 555 struct perf_thread_map *threads = NULL;
556 struct perf_cpu_map *cpus = NULL; 556 struct perf_cpu_map *cpus = NULL;
557 struct perf_evlist *evlist = NULL; 557 struct evlist *evlist = NULL;
558 struct evsel *evsel = NULL; 558 struct evsel *evsel = NULL;
559 int err = -1, ret; 559 int err = -1, ret;
560 pid_t pid; 560 pid_t pid;
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c
index 45fe674233d7..c3545a6efcbc 100644
--- a/tools/perf/tests/event-times.c
+++ b/tools/perf/tests/event-times.c
@@ -12,7 +12,7 @@
12#include "thread_map.h" 12#include "thread_map.h"
13#include "target.h" 13#include "target.h"
14 14
15static int attach__enable_on_exec(struct perf_evlist *evlist) 15static int attach__enable_on_exec(struct evlist *evlist)
16{ 16{
17 struct evsel *evsel = perf_evlist__last(evlist); 17 struct evsel *evsel = perf_evlist__last(evlist);
18 struct target target = { 18 struct target target = {
@@ -48,13 +48,13 @@ static int attach__enable_on_exec(struct perf_evlist *evlist)
48 return perf_evlist__start_workload(evlist) == 1 ? TEST_OK : TEST_FAIL; 48 return perf_evlist__start_workload(evlist) == 1 ? TEST_OK : TEST_FAIL;
49} 49}
50 50
51static int detach__enable_on_exec(struct perf_evlist *evlist) 51static int detach__enable_on_exec(struct evlist *evlist)
52{ 52{
53 waitpid(evlist->workload.pid, NULL, 0); 53 waitpid(evlist->workload.pid, NULL, 0);
54 return 0; 54 return 0;
55} 55}
56 56
57static int attach__current_disabled(struct perf_evlist *evlist) 57static int attach__current_disabled(struct evlist *evlist)
58{ 58{
59 struct evsel *evsel = perf_evlist__last(evlist); 59 struct evsel *evsel = perf_evlist__last(evlist);
60 struct perf_thread_map *threads; 60 struct perf_thread_map *threads;
@@ -80,7 +80,7 @@ static int attach__current_disabled(struct perf_evlist *evlist)
80 return perf_evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL; 80 return perf_evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL;
81} 81}
82 82
83static int attach__current_enabled(struct perf_evlist *evlist) 83static int attach__current_enabled(struct evlist *evlist)
84{ 84{
85 struct evsel *evsel = perf_evlist__last(evlist); 85 struct evsel *evsel = perf_evlist__last(evlist);
86 struct perf_thread_map *threads; 86 struct perf_thread_map *threads;
@@ -100,14 +100,14 @@ static int attach__current_enabled(struct perf_evlist *evlist)
100 return err == 0 ? TEST_OK : TEST_FAIL; 100 return err == 0 ? TEST_OK : TEST_FAIL;
101} 101}
102 102
103static int detach__disable(struct perf_evlist *evlist) 103static int detach__disable(struct evlist *evlist)
104{ 104{
105 struct evsel *evsel = perf_evlist__last(evlist); 105 struct evsel *evsel = perf_evlist__last(evlist);
106 106
107 return perf_evsel__enable(evsel); 107 return perf_evsel__enable(evsel);
108} 108}
109 109
110static int attach__cpu_disabled(struct perf_evlist *evlist) 110static int attach__cpu_disabled(struct evlist *evlist)
111{ 111{
112 struct evsel *evsel = perf_evlist__last(evlist); 112 struct evsel *evsel = perf_evlist__last(evlist);
113 struct perf_cpu_map *cpus; 113 struct perf_cpu_map *cpus;
@@ -136,7 +136,7 @@ static int attach__cpu_disabled(struct perf_evlist *evlist)
136 return perf_evsel__enable(evsel); 136 return perf_evsel__enable(evsel);
137} 137}
138 138
139static int attach__cpu_enabled(struct perf_evlist *evlist) 139static int attach__cpu_enabled(struct evlist *evlist)
140{ 140{
141 struct evsel *evsel = perf_evlist__last(evlist); 141 struct evsel *evsel = perf_evlist__last(evlist);
142 struct perf_cpu_map *cpus; 142 struct perf_cpu_map *cpus;
@@ -158,11 +158,11 @@ static int attach__cpu_enabled(struct perf_evlist *evlist)
158 return err ? TEST_FAIL : TEST_OK; 158 return err ? TEST_FAIL : TEST_OK;
159} 159}
160 160
161static int test_times(int (attach)(struct perf_evlist *), 161static int test_times(int (attach)(struct evlist *),
162 int (detach)(struct perf_evlist *)) 162 int (detach)(struct evlist *))
163{ 163{
164 struct perf_counts_values count; 164 struct perf_counts_values count;
165 struct perf_evlist *evlist = NULL; 165 struct evlist *evlist = NULL;
166 struct evsel *evsel; 166 struct evsel *evsel;
167 int err = -1, i; 167 int err = -1, i;
168 168
diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
index 0e5a2e8195e4..eb0dd359762d 100644
--- a/tools/perf/tests/event_update.c
+++ b/tools/perf/tests/event_update.c
@@ -79,7 +79,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
79 79
80int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused) 80int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused)
81{ 81{
82 struct perf_evlist *evlist; 82 struct evlist *evlist;
83 struct evsel *evsel; 83 struct evsel *evsel;
84 struct event_name tmp; 84 struct event_name tmp;
85 85
diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c
index bb38489eda1e..6cc408b23026 100644
--- a/tools/perf/tests/evsel-roundtrip-name.c
+++ b/tools/perf/tests/evsel-roundtrip-name.c
@@ -12,7 +12,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
12 char name[128]; 12 char name[128];
13 int type, op, err = 0, ret = 0, i, idx; 13 int type, op, err = 0, ret = 0, i, idx;
14 struct evsel *evsel; 14 struct evsel *evsel;
15 struct perf_evlist *evlist = perf_evlist__new(); 15 struct evlist *evlist = perf_evlist__new();
16 16
17 if (evlist == NULL) 17 if (evlist == NULL)
18 return -ENOMEM; 18 return -ENOMEM;
@@ -68,7 +68,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
68{ 68{
69 int i, err; 69 int i, err;
70 struct evsel *evsel; 70 struct evsel *evsel;
71 struct perf_evlist *evlist = perf_evlist__new(); 71 struct evlist *evlist = perf_evlist__new();
72 72
73 if (evlist == NULL) 73 if (evlist == NULL)
74 return -ENOMEM; 74 return -ENOMEM;
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index b62bf7c3bea2..d7a6b97683d6 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -695,7 +695,7 @@ int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_u
695 struct machines machines; 695 struct machines machines;
696 struct machine *machine; 696 struct machine *machine;
697 struct evsel *evsel; 697 struct evsel *evsel;
698 struct perf_evlist *evlist = perf_evlist__new(); 698 struct evlist *evlist = perf_evlist__new();
699 size_t i; 699 size_t i;
700 test_fn_t testcases[] = { 700 test_fn_t testcases[] = {
701 test1, 701 test1,
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c
index 3e679bb8da7f..9f0d6af839e9 100644
--- a/tools/perf/tests/hists_filter.c
+++ b/tools/perf/tests/hists_filter.c
@@ -47,7 +47,7 @@ static struct sample fake_samples[] = {
47 { .pid = FAKE_PID_BASH, .ip = FAKE_IP_KERNEL_PAGE_FAULT, .socket = 3 }, 47 { .pid = FAKE_PID_BASH, .ip = FAKE_IP_KERNEL_PAGE_FAULT, .socket = 3 },
48}; 48};
49 49
50static int add_hist_entries(struct perf_evlist *evlist, 50static int add_hist_entries(struct evlist *evlist,
51 struct machine *machine) 51 struct machine *machine)
52{ 52{
53 struct evsel *evsel; 53 struct evsel *evsel;
@@ -109,7 +109,7 @@ int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unu
109 struct machines machines; 109 struct machines machines;
110 struct machine *machine; 110 struct machine *machine;
111 struct evsel *evsel; 111 struct evsel *evsel;
112 struct perf_evlist *evlist = perf_evlist__new(); 112 struct evlist *evlist = perf_evlist__new();
113 113
114 TEST_ASSERT_VAL("No memory", evlist); 114 TEST_ASSERT_VAL("No memory", evlist);
115 115
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index 078ee9876980..6ab27dd3bf3f 100644
--- a/tools/perf/tests/hists_link.c
+++ b/tools/perf/tests/hists_link.c
@@ -62,7 +62,7 @@ static struct sample fake_samples[][5] = {
62 }, 62 },
63}; 63};
64 64
65static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine) 65static int add_hist_entries(struct evlist *evlist, struct machine *machine)
66{ 66{
67 struct evsel *evsel; 67 struct evsel *evsel;
68 struct addr_location al; 68 struct addr_location al;
@@ -272,7 +272,7 @@ int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unuse
272 struct machines machines; 272 struct machines machines;
273 struct machine *machine = NULL; 273 struct machine *machine = NULL;
274 struct evsel *evsel, *first; 274 struct evsel *evsel, *first;
275 struct perf_evlist *evlist = perf_evlist__new(); 275 struct evlist *evlist = perf_evlist__new();
276 276
277 if (evlist == NULL) 277 if (evlist == NULL)
278 return -ENOMEM; 278 return -ENOMEM;
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c
index 5cd4b1baa9d1..cd36e51cdf3b 100644
--- a/tools/perf/tests/hists_output.c
+++ b/tools/perf/tests/hists_output.c
@@ -581,7 +581,7 @@ int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unu
581 struct machines machines; 581 struct machines machines;
582 struct machine *machine; 582 struct machine *machine;
583 struct evsel *evsel; 583 struct evsel *evsel;
584 struct perf_evlist *evlist = perf_evlist__new(); 584 struct evlist *evlist = perf_evlist__new();
585 size_t i; 585 size_t i;
586 test_fn_t testcases[] = { 586 test_fn_t testcases[] = {
587 test1, 587 test1,
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index 8ada3e63f1ba..e0779f2a340c 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -24,7 +24,7 @@
24 } \ 24 } \
25} 25}
26 26
27static int find_comm(struct perf_evlist *evlist, const char *comm) 27static int find_comm(struct evlist *evlist, const char *comm)
28{ 28{
29 union perf_event *event; 29 union perf_event *event;
30 struct perf_mmap *md; 30 struct perf_mmap *md;
@@ -67,7 +67,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
67 }; 67 };
68 struct perf_thread_map *threads = NULL; 68 struct perf_thread_map *threads = NULL;
69 struct perf_cpu_map *cpus = NULL; 69 struct perf_cpu_map *cpus = NULL;
70 struct perf_evlist *evlist = NULL; 70 struct evlist *evlist = NULL;
71 struct evsel *evsel = NULL; 71 struct evsel *evsel = NULL;
72 int found, err = -1; 72 int found, err = -1;
73 const char *comm; 73 const char *comm;
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index 76ee42eb1355..749b580e9a92 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -29,7 +29,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
29 union perf_event *event; 29 union perf_event *event;
30 struct perf_thread_map *threads; 30 struct perf_thread_map *threads;
31 struct perf_cpu_map *cpus; 31 struct perf_cpu_map *cpus;
32 struct perf_evlist *evlist; 32 struct evlist *evlist;
33 cpu_set_t cpu_set; 33 cpu_set_t cpu_set;
34 const char *syscall_names[] = { "getsid", "getppid", "getpgid", }; 34 const char *syscall_names[] = { "getsid", "getppid", "getpgid", };
35 pid_t (*syscalls[])(void) = { (void *)getsid, getppid, (void*)getpgid }; 35 pid_t (*syscalls[])(void) = { (void *)getsid, getppid, (void*)getpgid };
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
index 2e467448e220..69bf0ec2fe5f 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -32,7 +32,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
32 }; 32 };
33 const char *filename = "/etc/passwd"; 33 const char *filename = "/etc/passwd";
34 int flags = O_RDONLY | O_DIRECTORY; 34 int flags = O_RDONLY | O_DIRECTORY;
35 struct perf_evlist *evlist = perf_evlist__new(); 35 struct evlist *evlist = perf_evlist__new();
36 struct evsel *evsel; 36 struct evsel *evsel;
37 int err = -1, i, nr_events = 0, nr_polls = 0; 37 int err = -1, i, nr_events = 0, nr_polls = 0;
38 char sbuf[STRERR_BUFSIZE]; 38 char sbuf[STRERR_BUFSIZE];
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index f55ab43d51bd..7409eed11b65 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -44,7 +44,7 @@ static bool kvm_s390_create_vm_valid(void)
44} 44}
45#endif 45#endif
46 46
47static int test__checkevent_tracepoint(struct perf_evlist *evlist) 47static int test__checkevent_tracepoint(struct evlist *evlist)
48{ 48{
49 struct evsel *evsel = perf_evlist__first(evlist); 49 struct evsel *evsel = perf_evlist__first(evlist);
50 50
@@ -57,7 +57,7 @@ static int test__checkevent_tracepoint(struct perf_evlist *evlist)
57 return 0; 57 return 0;
58} 58}
59 59
60static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist) 60static int test__checkevent_tracepoint_multi(struct evlist *evlist)
61{ 61{
62 struct evsel *evsel; 62 struct evsel *evsel;
63 63
@@ -75,7 +75,7 @@ static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist)
75 return 0; 75 return 0;
76} 76}
77 77
78static int test__checkevent_raw(struct perf_evlist *evlist) 78static int test__checkevent_raw(struct evlist *evlist)
79{ 79{
80 struct evsel *evsel = perf_evlist__first(evlist); 80 struct evsel *evsel = perf_evlist__first(evlist);
81 81
@@ -85,7 +85,7 @@ static int test__checkevent_raw(struct perf_evlist *evlist)
85 return 0; 85 return 0;
86} 86}
87 87
88static int test__checkevent_numeric(struct perf_evlist *evlist) 88static int test__checkevent_numeric(struct evlist *evlist)
89{ 89{
90 struct evsel *evsel = perf_evlist__first(evlist); 90 struct evsel *evsel = perf_evlist__first(evlist);
91 91
@@ -95,7 +95,7 @@ static int test__checkevent_numeric(struct perf_evlist *evlist)
95 return 0; 95 return 0;
96} 96}
97 97
98static int test__checkevent_symbolic_name(struct perf_evlist *evlist) 98static int test__checkevent_symbolic_name(struct evlist *evlist)
99{ 99{
100 struct evsel *evsel = perf_evlist__first(evlist); 100 struct evsel *evsel = perf_evlist__first(evlist);
101 101
@@ -106,7 +106,7 @@ static int test__checkevent_symbolic_name(struct perf_evlist *evlist)
106 return 0; 106 return 0;
107} 107}
108 108
109static int test__checkevent_symbolic_name_config(struct perf_evlist *evlist) 109static int test__checkevent_symbolic_name_config(struct evlist *evlist)
110{ 110{
111 struct evsel *evsel = perf_evlist__first(evlist); 111 struct evsel *evsel = perf_evlist__first(evlist);
112 112
@@ -127,7 +127,7 @@ static int test__checkevent_symbolic_name_config(struct perf_evlist *evlist)
127 return 0; 127 return 0;
128} 128}
129 129
130static int test__checkevent_symbolic_alias(struct perf_evlist *evlist) 130static int test__checkevent_symbolic_alias(struct evlist *evlist)
131{ 131{
132 struct evsel *evsel = perf_evlist__first(evlist); 132 struct evsel *evsel = perf_evlist__first(evlist);
133 133
@@ -138,7 +138,7 @@ static int test__checkevent_symbolic_alias(struct perf_evlist *evlist)
138 return 0; 138 return 0;
139} 139}
140 140
141static int test__checkevent_genhw(struct perf_evlist *evlist) 141static int test__checkevent_genhw(struct evlist *evlist)
142{ 142{
143 struct evsel *evsel = perf_evlist__first(evlist); 143 struct evsel *evsel = perf_evlist__first(evlist);
144 144
@@ -148,7 +148,7 @@ static int test__checkevent_genhw(struct perf_evlist *evlist)
148 return 0; 148 return 0;
149} 149}
150 150
151static int test__checkevent_breakpoint(struct perf_evlist *evlist) 151static int test__checkevent_breakpoint(struct evlist *evlist)
152{ 152{
153 struct evsel *evsel = perf_evlist__first(evlist); 153 struct evsel *evsel = perf_evlist__first(evlist);
154 154
@@ -162,7 +162,7 @@ static int test__checkevent_breakpoint(struct perf_evlist *evlist)
162 return 0; 162 return 0;
163} 163}
164 164
165static int test__checkevent_breakpoint_x(struct perf_evlist *evlist) 165static int test__checkevent_breakpoint_x(struct evlist *evlist)
166{ 166{
167 struct evsel *evsel = perf_evlist__first(evlist); 167 struct evsel *evsel = perf_evlist__first(evlist);
168 168
@@ -175,7 +175,7 @@ static int test__checkevent_breakpoint_x(struct perf_evlist *evlist)
175 return 0; 175 return 0;
176} 176}
177 177
178static int test__checkevent_breakpoint_r(struct perf_evlist *evlist) 178static int test__checkevent_breakpoint_r(struct evlist *evlist)
179{ 179{
180 struct evsel *evsel = perf_evlist__first(evlist); 180 struct evsel *evsel = perf_evlist__first(evlist);
181 181
@@ -190,7 +190,7 @@ static int test__checkevent_breakpoint_r(struct perf_evlist *evlist)
190 return 0; 190 return 0;
191} 191}
192 192
193static int test__checkevent_breakpoint_w(struct perf_evlist *evlist) 193static int test__checkevent_breakpoint_w(struct evlist *evlist)
194{ 194{
195 struct evsel *evsel = perf_evlist__first(evlist); 195 struct evsel *evsel = perf_evlist__first(evlist);
196 196
@@ -205,7 +205,7 @@ static int test__checkevent_breakpoint_w(struct perf_evlist *evlist)
205 return 0; 205 return 0;
206} 206}
207 207
208static int test__checkevent_breakpoint_rw(struct perf_evlist *evlist) 208static int test__checkevent_breakpoint_rw(struct evlist *evlist)
209{ 209{
210 struct evsel *evsel = perf_evlist__first(evlist); 210 struct evsel *evsel = perf_evlist__first(evlist);
211 211
@@ -220,7 +220,7 @@ static int test__checkevent_breakpoint_rw(struct perf_evlist *evlist)
220 return 0; 220 return 0;
221} 221}
222 222
223static int test__checkevent_tracepoint_modifier(struct perf_evlist *evlist) 223static int test__checkevent_tracepoint_modifier(struct evlist *evlist)
224{ 224{
225 struct evsel *evsel = perf_evlist__first(evlist); 225 struct evsel *evsel = perf_evlist__first(evlist);
226 226
@@ -233,7 +233,7 @@ static int test__checkevent_tracepoint_modifier(struct perf_evlist *evlist)
233} 233}
234 234
235static int 235static int
236test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist) 236test__checkevent_tracepoint_multi_modifier(struct evlist *evlist)
237{ 237{
238 struct evsel *evsel; 238 struct evsel *evsel;
239 239
@@ -251,7 +251,7 @@ test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist)
251 return test__checkevent_tracepoint_multi(evlist); 251 return test__checkevent_tracepoint_multi(evlist);
252} 252}
253 253
254static int test__checkevent_raw_modifier(struct perf_evlist *evlist) 254static int test__checkevent_raw_modifier(struct evlist *evlist)
255{ 255{
256 struct evsel *evsel = perf_evlist__first(evlist); 256 struct evsel *evsel = perf_evlist__first(evlist);
257 257
@@ -263,7 +263,7 @@ static int test__checkevent_raw_modifier(struct perf_evlist *evlist)
263 return test__checkevent_raw(evlist); 263 return test__checkevent_raw(evlist);
264} 264}
265 265
266static int test__checkevent_numeric_modifier(struct perf_evlist *evlist) 266static int test__checkevent_numeric_modifier(struct evlist *evlist)
267{ 267{
268 struct evsel *evsel = perf_evlist__first(evlist); 268 struct evsel *evsel = perf_evlist__first(evlist);
269 269
@@ -275,7 +275,7 @@ static int test__checkevent_numeric_modifier(struct perf_evlist *evlist)
275 return test__checkevent_numeric(evlist); 275 return test__checkevent_numeric(evlist);
276} 276}
277 277
278static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist) 278static int test__checkevent_symbolic_name_modifier(struct evlist *evlist)
279{ 279{
280 struct evsel *evsel = perf_evlist__first(evlist); 280 struct evsel *evsel = perf_evlist__first(evlist);
281 281
@@ -287,7 +287,7 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist)
287 return test__checkevent_symbolic_name(evlist); 287 return test__checkevent_symbolic_name(evlist);
288} 288}
289 289
290static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist) 290static int test__checkevent_exclude_host_modifier(struct evlist *evlist)
291{ 291{
292 struct evsel *evsel = perf_evlist__first(evlist); 292 struct evsel *evsel = perf_evlist__first(evlist);
293 293
@@ -297,7 +297,7 @@ static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist)
297 return test__checkevent_symbolic_name(evlist); 297 return test__checkevent_symbolic_name(evlist);
298} 298}
299 299
300static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist) 300static int test__checkevent_exclude_guest_modifier(struct evlist *evlist)
301{ 301{
302 struct evsel *evsel = perf_evlist__first(evlist); 302 struct evsel *evsel = perf_evlist__first(evlist);
303 303
@@ -307,7 +307,7 @@ static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist)
307 return test__checkevent_symbolic_name(evlist); 307 return test__checkevent_symbolic_name(evlist);
308} 308}
309 309
310static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) 310static int test__checkevent_symbolic_alias_modifier(struct evlist *evlist)
311{ 311{
312 struct evsel *evsel = perf_evlist__first(evlist); 312 struct evsel *evsel = perf_evlist__first(evlist);
313 313
@@ -319,7 +319,7 @@ static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist)
319 return test__checkevent_symbolic_alias(evlist); 319 return test__checkevent_symbolic_alias(evlist);
320} 320}
321 321
322static int test__checkevent_genhw_modifier(struct perf_evlist *evlist) 322static int test__checkevent_genhw_modifier(struct evlist *evlist)
323{ 323{
324 struct evsel *evsel = perf_evlist__first(evlist); 324 struct evsel *evsel = perf_evlist__first(evlist);
325 325
@@ -331,7 +331,7 @@ static int test__checkevent_genhw_modifier(struct perf_evlist *evlist)
331 return test__checkevent_genhw(evlist); 331 return test__checkevent_genhw(evlist);
332} 332}
333 333
334static int test__checkevent_exclude_idle_modifier(struct perf_evlist *evlist) 334static int test__checkevent_exclude_idle_modifier(struct evlist *evlist)
335{ 335{
336 struct evsel *evsel = perf_evlist__first(evlist); 336 struct evsel *evsel = perf_evlist__first(evlist);
337 337
@@ -346,7 +346,7 @@ static int test__checkevent_exclude_idle_modifier(struct perf_evlist *evlist)
346 return test__checkevent_symbolic_name(evlist); 346 return test__checkevent_symbolic_name(evlist);
347} 347}
348 348
349static int test__checkevent_exclude_idle_modifier_1(struct perf_evlist *evlist) 349static int test__checkevent_exclude_idle_modifier_1(struct evlist *evlist)
350{ 350{
351 struct evsel *evsel = perf_evlist__first(evlist); 351 struct evsel *evsel = perf_evlist__first(evlist);
352 352
@@ -361,7 +361,7 @@ static int test__checkevent_exclude_idle_modifier_1(struct perf_evlist *evlist)
361 return test__checkevent_symbolic_name(evlist); 361 return test__checkevent_symbolic_name(evlist);
362} 362}
363 363
364static int test__checkevent_breakpoint_modifier(struct perf_evlist *evlist) 364static int test__checkevent_breakpoint_modifier(struct evlist *evlist)
365{ 365{
366 struct evsel *evsel = perf_evlist__first(evlist); 366 struct evsel *evsel = perf_evlist__first(evlist);
367 367
@@ -376,7 +376,7 @@ static int test__checkevent_breakpoint_modifier(struct perf_evlist *evlist)
376 return test__checkevent_breakpoint(evlist); 376 return test__checkevent_breakpoint(evlist);
377} 377}
378 378
379static int test__checkevent_breakpoint_x_modifier(struct perf_evlist *evlist) 379static int test__checkevent_breakpoint_x_modifier(struct evlist *evlist)
380{ 380{
381 struct evsel *evsel = perf_evlist__first(evlist); 381 struct evsel *evsel = perf_evlist__first(evlist);
382 382
@@ -390,7 +390,7 @@ static int test__checkevent_breakpoint_x_modifier(struct perf_evlist *evlist)
390 return test__checkevent_breakpoint_x(evlist); 390 return test__checkevent_breakpoint_x(evlist);
391} 391}
392 392
393static int test__checkevent_breakpoint_r_modifier(struct perf_evlist *evlist) 393static int test__checkevent_breakpoint_r_modifier(struct evlist *evlist)
394{ 394{
395 struct evsel *evsel = perf_evlist__first(evlist); 395 struct evsel *evsel = perf_evlist__first(evlist);
396 396
@@ -404,7 +404,7 @@ static int test__checkevent_breakpoint_r_modifier(struct perf_evlist *evlist)
404 return test__checkevent_breakpoint_r(evlist); 404 return test__checkevent_breakpoint_r(evlist);
405} 405}
406 406
407static int test__checkevent_breakpoint_w_modifier(struct perf_evlist *evlist) 407static int test__checkevent_breakpoint_w_modifier(struct evlist *evlist)
408{ 408{
409 struct evsel *evsel = perf_evlist__first(evlist); 409 struct evsel *evsel = perf_evlist__first(evlist);
410 410
@@ -418,7 +418,7 @@ static int test__checkevent_breakpoint_w_modifier(struct perf_evlist *evlist)
418 return test__checkevent_breakpoint_w(evlist); 418 return test__checkevent_breakpoint_w(evlist);
419} 419}
420 420
421static int test__checkevent_breakpoint_rw_modifier(struct perf_evlist *evlist) 421static int test__checkevent_breakpoint_rw_modifier(struct evlist *evlist)
422{ 422{
423 struct evsel *evsel = perf_evlist__first(evlist); 423 struct evsel *evsel = perf_evlist__first(evlist);
424 424
@@ -432,7 +432,7 @@ static int test__checkevent_breakpoint_rw_modifier(struct perf_evlist *evlist)
432 return test__checkevent_breakpoint_rw(evlist); 432 return test__checkevent_breakpoint_rw(evlist);
433} 433}
434 434
435static int test__checkevent_pmu(struct perf_evlist *evlist) 435static int test__checkevent_pmu(struct evlist *evlist)
436{ 436{
437 437
438 struct evsel *evsel = perf_evlist__first(evlist); 438 struct evsel *evsel = perf_evlist__first(evlist);
@@ -451,7 +451,7 @@ static int test__checkevent_pmu(struct perf_evlist *evlist)
451 return 0; 451 return 0;
452} 452}
453 453
454static int test__checkevent_list(struct perf_evlist *evlist) 454static int test__checkevent_list(struct evlist *evlist)
455{ 455{
456 struct evsel *evsel = perf_evlist__first(evlist); 456 struct evsel *evsel = perf_evlist__first(evlist);
457 457
@@ -490,7 +490,7 @@ static int test__checkevent_list(struct perf_evlist *evlist)
490 return 0; 490 return 0;
491} 491}
492 492
493static int test__checkevent_pmu_name(struct perf_evlist *evlist) 493static int test__checkevent_pmu_name(struct evlist *evlist)
494{ 494{
495 struct evsel *evsel = perf_evlist__first(evlist); 495 struct evsel *evsel = perf_evlist__first(evlist);
496 496
@@ -511,7 +511,7 @@ static int test__checkevent_pmu_name(struct perf_evlist *evlist)
511 return 0; 511 return 0;
512} 512}
513 513
514static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlist) 514static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist)
515{ 515{
516 struct evsel *evsel = perf_evlist__first(evlist); 516 struct evsel *evsel = perf_evlist__first(evlist);
517 517
@@ -544,7 +544,7 @@ static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlis
544 return 0; 544 return 0;
545} 545}
546 546
547static int test__checkevent_pmu_events(struct perf_evlist *evlist) 547static int test__checkevent_pmu_events(struct evlist *evlist)
548{ 548{
549 struct evsel *evsel = perf_evlist__first(evlist); 549 struct evsel *evsel = perf_evlist__first(evlist);
550 550
@@ -562,7 +562,7 @@ static int test__checkevent_pmu_events(struct perf_evlist *evlist)
562} 562}
563 563
564 564
565static int test__checkevent_pmu_events_mix(struct perf_evlist *evlist) 565static int test__checkevent_pmu_events_mix(struct evlist *evlist)
566{ 566{
567 struct evsel *evsel = perf_evlist__first(evlist); 567 struct evsel *evsel = perf_evlist__first(evlist);
568 568
@@ -634,7 +634,7 @@ static int test__checkterms_simple(struct list_head *terms)
634 return 0; 634 return 0;
635} 635}
636 636
637static int test__group1(struct perf_evlist *evlist) 637static int test__group1(struct evlist *evlist)
638{ 638{
639 struct evsel *evsel, *leader; 639 struct evsel *evsel, *leader;
640 640
@@ -676,7 +676,7 @@ static int test__group1(struct perf_evlist *evlist)
676 return 0; 676 return 0;
677} 677}
678 678
679static int test__group2(struct perf_evlist *evlist) 679static int test__group2(struct evlist *evlist)
680{ 680{
681 struct evsel *evsel, *leader; 681 struct evsel *evsel, *leader;
682 682
@@ -731,7 +731,7 @@ static int test__group2(struct perf_evlist *evlist)
731 return 0; 731 return 0;
732} 732}
733 733
734static int test__group3(struct perf_evlist *evlist __maybe_unused) 734static int test__group3(struct evlist *evlist __maybe_unused)
735{ 735{
736 struct evsel *evsel, *leader; 736 struct evsel *evsel, *leader;
737 737
@@ -823,7 +823,7 @@ static int test__group3(struct perf_evlist *evlist __maybe_unused)
823 return 0; 823 return 0;
824} 824}
825 825
826static int test__group4(struct perf_evlist *evlist __maybe_unused) 826static int test__group4(struct evlist *evlist __maybe_unused)
827{ 827{
828 struct evsel *evsel, *leader; 828 struct evsel *evsel, *leader;
829 829
@@ -867,7 +867,7 @@ static int test__group4(struct perf_evlist *evlist __maybe_unused)
867 return 0; 867 return 0;
868} 868}
869 869
870static int test__group5(struct perf_evlist *evlist __maybe_unused) 870static int test__group5(struct evlist *evlist __maybe_unused)
871{ 871{
872 struct evsel *evsel, *leader; 872 struct evsel *evsel, *leader;
873 873
@@ -953,7 +953,7 @@ static int test__group5(struct perf_evlist *evlist __maybe_unused)
953 return 0; 953 return 0;
954} 954}
955 955
956static int test__group_gh1(struct perf_evlist *evlist) 956static int test__group_gh1(struct evlist *evlist)
957{ 957{
958 struct evsel *evsel, *leader; 958 struct evsel *evsel, *leader;
959 959
@@ -993,7 +993,7 @@ static int test__group_gh1(struct perf_evlist *evlist)
993 return 0; 993 return 0;
994} 994}
995 995
996static int test__group_gh2(struct perf_evlist *evlist) 996static int test__group_gh2(struct evlist *evlist)
997{ 997{
998 struct evsel *evsel, *leader; 998 struct evsel *evsel, *leader;
999 999
@@ -1033,7 +1033,7 @@ static int test__group_gh2(struct perf_evlist *evlist)
1033 return 0; 1033 return 0;
1034} 1034}
1035 1035
1036static int test__group_gh3(struct perf_evlist *evlist) 1036static int test__group_gh3(struct evlist *evlist)
1037{ 1037{
1038 struct evsel *evsel, *leader; 1038 struct evsel *evsel, *leader;
1039 1039
@@ -1073,7 +1073,7 @@ static int test__group_gh3(struct perf_evlist *evlist)
1073 return 0; 1073 return 0;
1074} 1074}
1075 1075
1076static int test__group_gh4(struct perf_evlist *evlist) 1076static int test__group_gh4(struct evlist *evlist)
1077{ 1077{
1078 struct evsel *evsel, *leader; 1078 struct evsel *evsel, *leader;
1079 1079
@@ -1113,7 +1113,7 @@ static int test__group_gh4(struct perf_evlist *evlist)
1113 return 0; 1113 return 0;
1114} 1114}
1115 1115
1116static int test__leader_sample1(struct perf_evlist *evlist) 1116static int test__leader_sample1(struct evlist *evlist)
1117{ 1117{
1118 struct evsel *evsel, *leader; 1118 struct evsel *evsel, *leader;
1119 1119
@@ -1166,7 +1166,7 @@ static int test__leader_sample1(struct perf_evlist *evlist)
1166 return 0; 1166 return 0;
1167} 1167}
1168 1168
1169static int test__leader_sample2(struct perf_evlist *evlist __maybe_unused) 1169static int test__leader_sample2(struct evlist *evlist __maybe_unused)
1170{ 1170{
1171 struct evsel *evsel, *leader; 1171 struct evsel *evsel, *leader;
1172 1172
@@ -1205,7 +1205,7 @@ static int test__leader_sample2(struct perf_evlist *evlist __maybe_unused)
1205 return 0; 1205 return 0;
1206} 1206}
1207 1207
1208static int test__checkevent_pinned_modifier(struct perf_evlist *evlist) 1208static int test__checkevent_pinned_modifier(struct evlist *evlist)
1209{ 1209{
1210 struct evsel *evsel = perf_evlist__first(evlist); 1210 struct evsel *evsel = perf_evlist__first(evlist);
1211 1211
@@ -1218,7 +1218,7 @@ static int test__checkevent_pinned_modifier(struct perf_evlist *evlist)
1218 return test__checkevent_symbolic_name(evlist); 1218 return test__checkevent_symbolic_name(evlist);
1219} 1219}
1220 1220
1221static int test__pinned_group(struct perf_evlist *evlist) 1221static int test__pinned_group(struct evlist *evlist)
1222{ 1222{
1223 struct evsel *evsel, *leader; 1223 struct evsel *evsel, *leader;
1224 1224
@@ -1249,7 +1249,7 @@ static int test__pinned_group(struct perf_evlist *evlist)
1249 return 0; 1249 return 0;
1250} 1250}
1251 1251
1252static int test__checkevent_breakpoint_len(struct perf_evlist *evlist) 1252static int test__checkevent_breakpoint_len(struct evlist *evlist)
1253{ 1253{
1254 struct evsel *evsel = perf_evlist__first(evlist); 1254 struct evsel *evsel = perf_evlist__first(evlist);
1255 1255
@@ -1264,7 +1264,7 @@ static int test__checkevent_breakpoint_len(struct perf_evlist *evlist)
1264 return 0; 1264 return 0;
1265} 1265}
1266 1266
1267static int test__checkevent_breakpoint_len_w(struct perf_evlist *evlist) 1267static int test__checkevent_breakpoint_len_w(struct evlist *evlist)
1268{ 1268{
1269 struct evsel *evsel = perf_evlist__first(evlist); 1269 struct evsel *evsel = perf_evlist__first(evlist);
1270 1270
@@ -1280,7 +1280,7 @@ static int test__checkevent_breakpoint_len_w(struct perf_evlist *evlist)
1280} 1280}
1281 1281
1282static int 1282static int
1283test__checkevent_breakpoint_len_rw_modifier(struct perf_evlist *evlist) 1283test__checkevent_breakpoint_len_rw_modifier(struct evlist *evlist)
1284{ 1284{
1285 struct evsel *evsel = perf_evlist__first(evlist); 1285 struct evsel *evsel = perf_evlist__first(evlist);
1286 1286
@@ -1292,7 +1292,7 @@ test__checkevent_breakpoint_len_rw_modifier(struct perf_evlist *evlist)
1292 return test__checkevent_breakpoint_rw(evlist); 1292 return test__checkevent_breakpoint_rw(evlist);
1293} 1293}
1294 1294
1295static int test__checkevent_precise_max_modifier(struct perf_evlist *evlist) 1295static int test__checkevent_precise_max_modifier(struct evlist *evlist)
1296{ 1296{
1297 struct evsel *evsel = perf_evlist__first(evlist); 1297 struct evsel *evsel = perf_evlist__first(evlist);
1298 1298
@@ -1303,7 +1303,7 @@ static int test__checkevent_precise_max_modifier(struct perf_evlist *evlist)
1303 return 0; 1303 return 0;
1304} 1304}
1305 1305
1306static int test__checkevent_config_symbol(struct perf_evlist *evlist) 1306static int test__checkevent_config_symbol(struct evlist *evlist)
1307{ 1307{
1308 struct evsel *evsel = perf_evlist__first(evlist); 1308 struct evsel *evsel = perf_evlist__first(evlist);
1309 1309
@@ -1311,7 +1311,7 @@ static int test__checkevent_config_symbol(struct perf_evlist *evlist)
1311 return 0; 1311 return 0;
1312} 1312}
1313 1313
1314static int test__checkevent_config_raw(struct perf_evlist *evlist) 1314static int test__checkevent_config_raw(struct evlist *evlist)
1315{ 1315{
1316 struct evsel *evsel = perf_evlist__first(evlist); 1316 struct evsel *evsel = perf_evlist__first(evlist);
1317 1317
@@ -1319,7 +1319,7 @@ static int test__checkevent_config_raw(struct perf_evlist *evlist)
1319 return 0; 1319 return 0;
1320} 1320}
1321 1321
1322static int test__checkevent_config_num(struct perf_evlist *evlist) 1322static int test__checkevent_config_num(struct evlist *evlist)
1323{ 1323{
1324 struct evsel *evsel = perf_evlist__first(evlist); 1324 struct evsel *evsel = perf_evlist__first(evlist);
1325 1325
@@ -1327,7 +1327,7 @@ static int test__checkevent_config_num(struct perf_evlist *evlist)
1327 return 0; 1327 return 0;
1328} 1328}
1329 1329
1330static int test__checkevent_config_cache(struct perf_evlist *evlist) 1330static int test__checkevent_config_cache(struct evlist *evlist)
1331{ 1331{
1332 struct evsel *evsel = perf_evlist__first(evlist); 1332 struct evsel *evsel = perf_evlist__first(evlist);
1333 1333
@@ -1340,7 +1340,7 @@ static bool test__intel_pt_valid(void)
1340 return !!perf_pmu__find("intel_pt"); 1340 return !!perf_pmu__find("intel_pt");
1341} 1341}
1342 1342
1343static int test__intel_pt(struct perf_evlist *evlist) 1343static int test__intel_pt(struct evlist *evlist)
1344{ 1344{
1345 struct evsel *evsel = perf_evlist__first(evlist); 1345 struct evsel *evsel = perf_evlist__first(evlist);
1346 1346
@@ -1348,7 +1348,7 @@ static int test__intel_pt(struct perf_evlist *evlist)
1348 return 0; 1348 return 0;
1349} 1349}
1350 1350
1351static int test__checkevent_complex_name(struct perf_evlist *evlist) 1351static int test__checkevent_complex_name(struct evlist *evlist)
1352{ 1352{
1353 struct evsel *evsel = perf_evlist__first(evlist); 1353 struct evsel *evsel = perf_evlist__first(evlist);
1354 1354
@@ -1356,7 +1356,7 @@ static int test__checkevent_complex_name(struct perf_evlist *evlist)
1356 return 0; 1356 return 0;
1357} 1357}
1358 1358
1359static int test__sym_event_slash(struct perf_evlist *evlist) 1359static int test__sym_event_slash(struct evlist *evlist)
1360{ 1360{
1361 struct evsel *evsel = perf_evlist__first(evlist); 1361 struct evsel *evsel = perf_evlist__first(evlist);
1362 1362
@@ -1366,7 +1366,7 @@ static int test__sym_event_slash(struct perf_evlist *evlist)
1366 return 0; 1366 return 0;
1367} 1367}
1368 1368
1369static int test__sym_event_dc(struct perf_evlist *evlist) 1369static int test__sym_event_dc(struct evlist *evlist)
1370{ 1370{
1371 struct evsel *evsel = perf_evlist__first(evlist); 1371 struct evsel *evsel = perf_evlist__first(evlist);
1372 1372
@@ -1422,7 +1422,7 @@ static int count_tracepoints(void)
1422 return cnt; 1422 return cnt;
1423} 1423}
1424 1424
1425static int test__all_tracepoints(struct perf_evlist *evlist) 1425static int test__all_tracepoints(struct evlist *evlist)
1426{ 1426{
1427 TEST_ASSERT_VAL("wrong events count", 1427 TEST_ASSERT_VAL("wrong events count",
1428 count_tracepoints() == evlist->nr_entries); 1428 count_tracepoints() == evlist->nr_entries);
@@ -1435,7 +1435,7 @@ struct evlist_test {
1435 __u32 type; 1435 __u32 type;
1436 const int id; 1436 const int id;
1437 bool (*valid)(void); 1437 bool (*valid)(void);
1438 int (*check)(struct perf_evlist *evlist); 1438 int (*check)(struct evlist *evlist);
1439}; 1439};
1440 1440
1441static struct evlist_test test__events[] = { 1441static struct evlist_test test__events[] = {
@@ -1769,7 +1769,7 @@ static struct terms_test test__terms[] = {
1769static int test_event(struct evlist_test *e) 1769static int test_event(struct evlist_test *e)
1770{ 1770{
1771 struct parse_events_error err = { .idx = 0, }; 1771 struct parse_events_error err = { .idx = 0, };
1772 struct perf_evlist *evlist; 1772 struct evlist *evlist;
1773 int ret; 1773 int ret;
1774 1774
1775 if (e->valid && !e->valid()) { 1775 if (e->valid && !e->valid()) {
diff --git a/tools/perf/tests/parse-no-sample-id-all.c b/tools/perf/tests/parse-no-sample-id-all.c
index 2196d1497c0c..fc0213246aaf 100644
--- a/tools/perf/tests/parse-no-sample-id-all.c
+++ b/tools/perf/tests/parse-no-sample-id-all.c
@@ -11,7 +11,7 @@
11#include "util.h" 11#include "util.h"
12#include "debug.h" 12#include "debug.h"
13 13
14static int process_event(struct perf_evlist **pevlist, union perf_event *event) 14static int process_event(struct evlist **pevlist, union perf_event *event)
15{ 15{
16 struct perf_sample sample; 16 struct perf_sample sample;
17 17
@@ -39,7 +39,7 @@ static int process_event(struct perf_evlist **pevlist, union perf_event *event)
39 39
40static int process_events(union perf_event **events, size_t count) 40static int process_events(union perf_event **events, size_t count)
41{ 41{
42 struct perf_evlist *evlist = NULL; 42 struct evlist *evlist = NULL;
43 int err = 0; 43 int err = 0;
44 size_t i; 44 size_t i;
45 45
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 7e576c2db941..99b2d26881f9 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -50,7 +50,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
50 }; 50 };
51 cpu_set_t cpu_mask; 51 cpu_set_t cpu_mask;
52 size_t cpu_mask_size = sizeof(cpu_mask); 52 size_t cpu_mask_size = sizeof(cpu_mask);
53 struct perf_evlist *evlist = perf_evlist__new_dummy(); 53 struct evlist *evlist = perf_evlist__new_dummy();
54 struct evsel *evsel; 54 struct evsel *evsel;
55 struct perf_sample sample; 55 struct perf_sample sample;
56 const char *cmd = "sleep"; 56 const char *cmd = "sleep";
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index 620a99aad1e3..69b997eeb639 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -28,7 +28,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
28 char sbuf[STRERR_BUFSIZE]; 28 char sbuf[STRERR_BUFSIZE];
29 union perf_event *event; 29 union perf_event *event;
30 struct evsel *evsel; 30 struct evsel *evsel;
31 struct perf_evlist *evlist; 31 struct evlist *evlist;
32 struct perf_event_attr attr = { 32 struct perf_event_attr attr = {
33 .type = PERF_TYPE_SOFTWARE, 33 .type = PERF_TYPE_SOFTWARE,
34 .config = clock_id, 34 .config = clock_id,
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index a946b9fa60dd..3e26ea36ec29 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -113,7 +113,7 @@ static int check_cpu(struct switch_tracking *switch_tracking, int cpu)
113 return 0; 113 return 0;
114} 114}
115 115
116static int process_sample_event(struct perf_evlist *evlist, 116static int process_sample_event(struct evlist *evlist,
117 union perf_event *event, 117 union perf_event *event,
118 struct switch_tracking *switch_tracking) 118 struct switch_tracking *switch_tracking)
119{ 119{
@@ -163,7 +163,7 @@ static int process_sample_event(struct perf_evlist *evlist,
163 return 0; 163 return 0;
164} 164}
165 165
166static int process_event(struct perf_evlist *evlist, union perf_event *event, 166static int process_event(struct evlist *evlist, union perf_event *event,
167 struct switch_tracking *switch_tracking) 167 struct switch_tracking *switch_tracking)
168{ 168{
169 if (event->header.type == PERF_RECORD_SAMPLE) 169 if (event->header.type == PERF_RECORD_SAMPLE)
@@ -203,7 +203,7 @@ struct event_node {
203 u64 event_time; 203 u64 event_time;
204}; 204};
205 205
206static int add_event(struct perf_evlist *evlist, struct list_head *events, 206static int add_event(struct evlist *evlist, struct list_head *events,
207 union perf_event *event) 207 union perf_event *event)
208{ 208{
209 struct perf_sample sample; 209 struct perf_sample sample;
@@ -252,7 +252,7 @@ static int compar(const void *a, const void *b)
252 return cmp; 252 return cmp;
253} 253}
254 254
255static int process_events(struct perf_evlist *evlist, 255static int process_events(struct evlist *evlist,
256 struct switch_tracking *switch_tracking) 256 struct switch_tracking *switch_tracking)
257{ 257{
258 union perf_event *event; 258 union perf_event *event;
@@ -329,7 +329,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
329 }; 329 };
330 struct perf_thread_map *threads = NULL; 330 struct perf_thread_map *threads = NULL;
331 struct perf_cpu_map *cpus = NULL; 331 struct perf_cpu_map *cpus = NULL;
332 struct perf_evlist *evlist = NULL; 332 struct evlist *evlist = NULL;
333 struct evsel *evsel, *cpu_clocks_evsel, *cycles_evsel; 333 struct evsel *evsel, *cpu_clocks_evsel, *cycles_evsel;
334 struct evsel *switch_evsel, *tracking_evsel; 334 struct evsel *switch_evsel, *tracking_evsel;
335 const char *comm; 335 const char *comm;
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
index e6fb4b8d8bc2..5c2cdb0ccb96 100644
--- a/tools/perf/tests/task-exit.c
+++ b/tools/perf/tests/task-exit.c
@@ -38,7 +38,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
38 int err = -1; 38 int err = -1;
39 union perf_event *event; 39 union perf_event *event;
40 struct evsel *evsel; 40 struct evsel *evsel;
41 struct perf_evlist *evlist; 41 struct evlist *evlist;
42 struct target target = { 42 struct target target = {
43 .uid = UINT_MAX, 43 .uid = UINT_MAX,
44 .uses_mmap = true, 44 .uses_mmap = true,
diff --git a/tools/perf/tests/time-utils-test.c b/tools/perf/tests/time-utils-test.c
index 4f53006233a1..fe57ca3b6e54 100644
--- a/tools/perf/tests/time-utils-test.c
+++ b/tools/perf/tests/time-utils-test.c
@@ -69,7 +69,7 @@ struct test_data {
69 69
70static bool test__perf_time__parse_for_ranges(struct test_data *d) 70static bool test__perf_time__parse_for_ranges(struct test_data *d)
71{ 71{
72 struct perf_evlist evlist = { 72 struct evlist evlist = {
73 .first_sample_time = d->first, 73 .first_sample_time = d->first,
74 .last_sample_time = d->last, 74 .last_sample_time = d->last,
75 }; 75 };
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 9bc818621eb6..b83258bece05 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -3262,7 +3262,7 @@ static int perf_evsel_menu__run(struct evsel_menu *menu,
3262 struct hist_browser_timer *hbt, 3262 struct hist_browser_timer *hbt,
3263 bool warn_lost_event) 3263 bool warn_lost_event)
3264{ 3264{
3265 struct perf_evlist *evlist = menu->b.priv; 3265 struct evlist *evlist = menu->b.priv;
3266 struct evsel *pos; 3266 struct evsel *pos;
3267 const char *title = "Available samples"; 3267 const char *title = "Available samples";
3268 int delay_secs = hbt ? hbt->refresh : 0; 3268 int delay_secs = hbt ? hbt->refresh : 0;
@@ -3359,7 +3359,7 @@ static bool filter_group_entries(struct ui_browser *browser __maybe_unused,
3359 return false; 3359 return false;
3360} 3360}
3361 3361
3362static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, 3362static int __perf_evlist__tui_browse_hists(struct evlist *evlist,
3363 int nr_entries, const char *help, 3363 int nr_entries, const char *help,
3364 struct hist_browser_timer *hbt, 3364 struct hist_browser_timer *hbt,
3365 float min_pcnt, 3365 float min_pcnt,
@@ -3397,7 +3397,7 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist,
3397 hbt, warn_lost_event); 3397 hbt, warn_lost_event);
3398} 3398}
3399 3399
3400int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, 3400int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
3401 struct hist_browser_timer *hbt, 3401 struct hist_browser_timer *hbt,
3402 float min_pcnt, 3402 float min_pcnt,
3403 struct perf_env *env, 3403 struct perf_env *env,
diff --git a/tools/perf/ui/gtk/gtk.h b/tools/perf/ui/gtk/gtk.h
index e2f5fbef3c9a..a9563932fa04 100644
--- a/tools/perf/ui/gtk/gtk.h
+++ b/tools/perf/ui/gtk/gtk.h
@@ -53,11 +53,11 @@ static inline GtkWidget *perf_gtk__setup_info_bar(void)
53#endif 53#endif
54 54
55struct evsel; 55struct evsel;
56struct perf_evlist; 56struct evlist;
57struct hist_entry; 57struct hist_entry;
58struct hist_browser_timer; 58struct hist_browser_timer;
59 59
60int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help, 60int perf_evlist__gtk_browse_hists(struct evlist *evlist, const char *help,
61 struct hist_browser_timer *hbt, 61 struct hist_browser_timer *hbt,
62 float min_pcnt); 62 float min_pcnt);
63int hist_entry__gtk_annotate(struct hist_entry *he, 63int hist_entry__gtk_annotate(struct hist_entry *he,
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index d5c9fe230632..1b181d8ea953 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -590,7 +590,7 @@ static void perf_gtk__show_hierarchy(GtkWidget *window, struct hists *hists,
590 gtk_container_add(GTK_CONTAINER(window), view); 590 gtk_container_add(GTK_CONTAINER(window), view);
591} 591}
592 592
593int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, 593int perf_evlist__gtk_browse_hists(struct evlist *evlist,
594 const char *help, 594 const char *help,
595 struct hist_browser_timer *hbt __maybe_unused, 595 struct hist_browser_timer *hbt __maybe_unused,
596 float min_pcnt) 596 float min_pcnt)
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 214af526901b..8c7fb11edc60 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -795,7 +795,7 @@ static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt)
795} 795}
796 796
797int perf_hpp__setup_hists_formats(struct perf_hpp_list *list, 797int perf_hpp__setup_hists_formats(struct perf_hpp_list *list,
798 struct perf_evlist *evlist) 798 struct evlist *evlist)
799{ 799{
800 struct evsel *evsel; 800 struct evsel *evsel;
801 struct perf_hpp_fmt *fmt; 801 struct perf_hpp_fmt *fmt;
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 98b151bc9a36..9ec2841ddec4 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -124,7 +124,7 @@ void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
124} 124}
125 125
126void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp, 126void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
127 struct perf_evlist *evlist, int idx, 127 struct evlist *evlist, int idx,
128 bool per_cpu) 128 bool per_cpu)
129{ 129{
130 mp->idx = idx; 130 mp->idx = idx;
@@ -503,7 +503,7 @@ void auxtrace_heap__pop(struct auxtrace_heap *heap)
503} 503}
504 504
505size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr, 505size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr,
506 struct perf_evlist *evlist) 506 struct evlist *evlist)
507{ 507{
508 if (itr) 508 if (itr)
509 return itr->info_priv_size(itr, evlist); 509 return itr->info_priv_size(itr, evlist);
@@ -556,7 +556,7 @@ int auxtrace_record__find_snapshot(struct auxtrace_record *itr, int idx,
556} 556}
557 557
558int auxtrace_record__options(struct auxtrace_record *itr, 558int auxtrace_record__options(struct auxtrace_record *itr,
559 struct perf_evlist *evlist, 559 struct evlist *evlist,
560 struct record_opts *opts) 560 struct record_opts *opts)
561{ 561{
562 if (itr) 562 if (itr)
@@ -585,7 +585,7 @@ int auxtrace_parse_snapshot_options(struct auxtrace_record *itr,
585} 585}
586 586
587struct auxtrace_record *__weak 587struct auxtrace_record *__weak
588auxtrace_record__init(struct perf_evlist *evlist __maybe_unused, int *err) 588auxtrace_record__init(struct evlist *evlist __maybe_unused, int *err)
589{ 589{
590 *err = 0; 590 *err = 0;
591 return NULL; 591 return NULL;
@@ -2160,7 +2160,7 @@ static int perf_evsel__nr_addr_filter(struct evsel *evsel)
2160 return nr_addr_filters; 2160 return nr_addr_filters;
2161} 2161}
2162 2162
2163int auxtrace_parse_filters(struct perf_evlist *evlist) 2163int auxtrace_parse_filters(struct evlist *evlist)
2164{ 2164{
2165 struct evsel *evsel; 2165 struct evsel *evsel;
2166 char *filter; 2166 char *filter;
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index e9b4c5edf78b..17eb04a1da4d 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -23,7 +23,7 @@
23 23
24union perf_event; 24union perf_event;
25struct perf_session; 25struct perf_session;
26struct perf_evlist; 26struct evlist;
27struct perf_tool; 27struct perf_tool;
28struct perf_mmap; 28struct perf_mmap;
29struct option; 29struct option;
@@ -309,10 +309,10 @@ struct auxtrace_mmap_params {
309 */ 309 */
310struct auxtrace_record { 310struct auxtrace_record {
311 int (*recording_options)(struct auxtrace_record *itr, 311 int (*recording_options)(struct auxtrace_record *itr,
312 struct perf_evlist *evlist, 312 struct evlist *evlist,
313 struct record_opts *opts); 313 struct record_opts *opts);
314 size_t (*info_priv_size)(struct auxtrace_record *itr, 314 size_t (*info_priv_size)(struct auxtrace_record *itr,
315 struct perf_evlist *evlist); 315 struct evlist *evlist);
316 int (*info_fill)(struct auxtrace_record *itr, 316 int (*info_fill)(struct auxtrace_record *itr,
317 struct perf_session *session, 317 struct perf_session *session,
318 struct auxtrace_info_event *auxtrace_info, 318 struct auxtrace_info_event *auxtrace_info,
@@ -432,7 +432,7 @@ void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
432 unsigned int auxtrace_pages, 432 unsigned int auxtrace_pages,
433 bool auxtrace_overwrite); 433 bool auxtrace_overwrite);
434void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp, 434void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
435 struct perf_evlist *evlist, int idx, 435 struct evlist *evlist, int idx,
436 bool per_cpu); 436 bool per_cpu);
437 437
438typedef int (*process_auxtrace_t)(struct perf_tool *tool, 438typedef int (*process_auxtrace_t)(struct perf_tool *tool,
@@ -482,17 +482,17 @@ int auxtrace_cache__add(struct auxtrace_cache *c, u32 key,
482 struct auxtrace_cache_entry *entry); 482 struct auxtrace_cache_entry *entry);
483void *auxtrace_cache__lookup(struct auxtrace_cache *c, u32 key); 483void *auxtrace_cache__lookup(struct auxtrace_cache *c, u32 key);
484 484
485struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist, 485struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
486 int *err); 486 int *err);
487 487
488int auxtrace_parse_snapshot_options(struct auxtrace_record *itr, 488int auxtrace_parse_snapshot_options(struct auxtrace_record *itr,
489 struct record_opts *opts, 489 struct record_opts *opts,
490 const char *str); 490 const char *str);
491int auxtrace_record__options(struct auxtrace_record *itr, 491int auxtrace_record__options(struct auxtrace_record *itr,
492 struct perf_evlist *evlist, 492 struct evlist *evlist,
493 struct record_opts *opts); 493 struct record_opts *opts);
494size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr, 494size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr,
495 struct perf_evlist *evlist); 495 struct evlist *evlist);
496int auxtrace_record__info_fill(struct auxtrace_record *itr, 496int auxtrace_record__info_fill(struct auxtrace_record *itr,
497 struct perf_session *session, 497 struct perf_session *session,
498 struct auxtrace_info_event *auxtrace_info, 498 struct auxtrace_info_event *auxtrace_info,
@@ -540,7 +540,7 @@ void addr_filters__init(struct addr_filters *filts);
540void addr_filters__exit(struct addr_filters *filts); 540void addr_filters__exit(struct addr_filters *filts);
541int addr_filters__parse_bare_filter(struct addr_filters *filts, 541int addr_filters__parse_bare_filter(struct addr_filters *filts,
542 const char *filter); 542 const char *filter);
543int auxtrace_parse_filters(struct perf_evlist *evlist); 543int auxtrace_parse_filters(struct evlist *evlist);
544 544
545static inline int auxtrace__process_event(struct perf_session *session, 545static inline int auxtrace__process_event(struct perf_session *session,
546 union perf_event *event, 546 union perf_event *event,
@@ -613,7 +613,7 @@ void itrace_synth_opts__clear_time_range(struct itrace_synth_opts *opts)
613#else 613#else
614 614
615static inline struct auxtrace_record * 615static inline struct auxtrace_record *
616auxtrace_record__init(struct perf_evlist *evlist __maybe_unused, 616auxtrace_record__init(struct evlist *evlist __maybe_unused,
617 int *err) 617 int *err)
618{ 618{
619 *err = 0; 619 *err = 0;
@@ -636,7 +636,7 @@ perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr __maybe_unused,
636 636
637static inline 637static inline
638int auxtrace_record__options(struct auxtrace_record *itr __maybe_unused, 638int auxtrace_record__options(struct auxtrace_record *itr __maybe_unused,
639 struct perf_evlist *evlist __maybe_unused, 639 struct evlist *evlist __maybe_unused,
640 struct record_opts *opts __maybe_unused) 640 struct record_opts *opts __maybe_unused)
641{ 641{
642 return 0; 642 return 0;
@@ -733,7 +733,7 @@ void auxtrace_index__free(struct list_head *head __maybe_unused)
733} 733}
734 734
735static inline 735static inline
736int auxtrace_parse_filters(struct perf_evlist *evlist __maybe_unused) 736int auxtrace_parse_filters(struct evlist *evlist __maybe_unused)
737{ 737{
738 return 0; 738 return 0;
739} 739}
@@ -747,7 +747,7 @@ void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
747 unsigned int auxtrace_pages, 747 unsigned int auxtrace_pages,
748 bool auxtrace_overwrite); 748 bool auxtrace_overwrite);
749void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp, 749void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
750 struct perf_evlist *evlist, int idx, 750 struct evlist *evlist, int idx,
751 bool per_cpu); 751 bool per_cpu);
752 752
753#define ITRACE_HELP "" 753#define ITRACE_HELP ""
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index 2a4a0da35632..5a5dcc6d8f85 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -418,7 +418,7 @@ static int bpf_event__sb_cb(union perf_event *event, void *data)
418 return 0; 418 return 0;
419} 419}
420 420
421int bpf_event__add_sb_event(struct perf_evlist **evlist, 421int bpf_event__add_sb_event(struct evlist **evlist,
422 struct perf_env *env) 422 struct perf_env *env)
423{ 423{
424 struct perf_event_attr attr = { 424 struct perf_event_attr attr = {
diff --git a/tools/perf/util/bpf-event.h b/tools/perf/util/bpf-event.h
index 04c33b3bfe28..26ab9239f986 100644
--- a/tools/perf/util/bpf-event.h
+++ b/tools/perf/util/bpf-event.h
@@ -37,7 +37,7 @@ int perf_event__synthesize_bpf_events(struct perf_session *session,
37 perf_event__handler_t process, 37 perf_event__handler_t process,
38 struct machine *machine, 38 struct machine *machine,
39 struct record_opts *opts); 39 struct record_opts *opts);
40int bpf_event__add_sb_event(struct perf_evlist **evlist, 40int bpf_event__add_sb_event(struct evlist **evlist,
41 struct perf_env *env); 41 struct perf_env *env);
42void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info, 42void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
43 struct perf_env *env, 43 struct perf_env *env,
@@ -58,7 +58,7 @@ static inline int perf_event__synthesize_bpf_events(struct perf_session *session
58 return 0; 58 return 0;
59} 59}
60 60
61static inline int bpf_event__add_sb_event(struct perf_evlist **evlist __maybe_unused, 61static inline int bpf_event__add_sb_event(struct evlist **evlist __maybe_unused,
62 struct perf_env *env __maybe_unused) 62 struct perf_env *env __maybe_unused)
63{ 63{
64 return 0; 64 return 0;
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 594ea279e25b..b0696726ab76 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -1043,7 +1043,7 @@ __bpf_map__config_value(struct bpf_map *map,
1043static int 1043static int
1044bpf_map__config_value(struct bpf_map *map, 1044bpf_map__config_value(struct bpf_map *map,
1045 struct parse_events_term *term, 1045 struct parse_events_term *term,
1046 struct perf_evlist *evlist __maybe_unused) 1046 struct evlist *evlist __maybe_unused)
1047{ 1047{
1048 if (!term->err_val) { 1048 if (!term->err_val) {
1049 pr_debug("Config value not set\n"); 1049 pr_debug("Config value not set\n");
@@ -1061,7 +1061,7 @@ bpf_map__config_value(struct bpf_map *map,
1061static int 1061static int
1062__bpf_map__config_event(struct bpf_map *map, 1062__bpf_map__config_event(struct bpf_map *map,
1063 struct parse_events_term *term, 1063 struct parse_events_term *term,
1064 struct perf_evlist *evlist) 1064 struct evlist *evlist)
1065{ 1065{
1066 struct evsel *evsel; 1066 struct evsel *evsel;
1067 const struct bpf_map_def *def; 1067 const struct bpf_map_def *def;
@@ -1103,7 +1103,7 @@ __bpf_map__config_event(struct bpf_map *map,
1103static int 1103static int
1104bpf_map__config_event(struct bpf_map *map, 1104bpf_map__config_event(struct bpf_map *map,
1105 struct parse_events_term *term, 1105 struct parse_events_term *term,
1106 struct perf_evlist *evlist) 1106 struct evlist *evlist)
1107{ 1107{
1108 if (!term->err_val) { 1108 if (!term->err_val) {
1109 pr_debug("Config value not set\n"); 1109 pr_debug("Config value not set\n");
@@ -1121,7 +1121,7 @@ bpf_map__config_event(struct bpf_map *map,
1121struct bpf_obj_config__map_func { 1121struct bpf_obj_config__map_func {
1122 const char *config_opt; 1122 const char *config_opt;
1123 int (*config_func)(struct bpf_map *, struct parse_events_term *, 1123 int (*config_func)(struct bpf_map *, struct parse_events_term *,
1124 struct perf_evlist *); 1124 struct evlist *);
1125}; 1125};
1126 1126
1127struct bpf_obj_config__map_func bpf_obj_config__map_funcs[] = { 1127struct bpf_obj_config__map_func bpf_obj_config__map_funcs[] = {
@@ -1169,7 +1169,7 @@ config_map_indices_range_check(struct parse_events_term *term,
1169static int 1169static int
1170bpf__obj_config_map(struct bpf_object *obj, 1170bpf__obj_config_map(struct bpf_object *obj,
1171 struct parse_events_term *term, 1171 struct parse_events_term *term,
1172 struct perf_evlist *evlist, 1172 struct evlist *evlist,
1173 int *key_scan_pos) 1173 int *key_scan_pos)
1174{ 1174{
1175 /* key is "map:<mapname>.<config opt>" */ 1175 /* key is "map:<mapname>.<config opt>" */
@@ -1228,7 +1228,7 @@ out:
1228 1228
1229int bpf__config_obj(struct bpf_object *obj, 1229int bpf__config_obj(struct bpf_object *obj,
1230 struct parse_events_term *term, 1230 struct parse_events_term *term,
1231 struct perf_evlist *evlist, 1231 struct evlist *evlist,
1232 int *error_pos) 1232 int *error_pos)
1233{ 1233{
1234 int key_scan_pos = 0; 1234 int key_scan_pos = 0;
@@ -1523,7 +1523,7 @@ int bpf__apply_obj_config(void)
1523 (strcmp(name, \ 1523 (strcmp(name, \
1524 bpf_map__name(pos)) == 0)) 1524 bpf_map__name(pos)) == 0))
1525 1525
1526struct evsel *bpf__setup_output_event(struct perf_evlist *evlist, const char *name) 1526struct evsel *bpf__setup_output_event(struct evlist *evlist, const char *name)
1527{ 1527{
1528 struct bpf_map_priv *tmpl_priv = NULL; 1528 struct bpf_map_priv *tmpl_priv = NULL;
1529 struct bpf_object *obj, *tmp; 1529 struct bpf_object *obj, *tmp;
@@ -1600,7 +1600,7 @@ struct evsel *bpf__setup_output_event(struct perf_evlist *evlist, const char *na
1600 return evsel; 1600 return evsel;
1601} 1601}
1602 1602
1603int bpf__setup_stdout(struct perf_evlist *evlist) 1603int bpf__setup_stdout(struct evlist *evlist)
1604{ 1604{
1605 struct evsel *evsel = bpf__setup_output_event(evlist, "__bpf_stdout__"); 1605 struct evsel *evsel = bpf__setup_output_event(evlist, "__bpf_stdout__");
1606 return PTR_ERR_OR_ZERO(evsel); 1606 return PTR_ERR_OR_ZERO(evsel);
@@ -1756,7 +1756,7 @@ int bpf__strerror_load(struct bpf_object *obj,
1756 1756
1757int bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused, 1757int bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused,
1758 struct parse_events_term *term __maybe_unused, 1758 struct parse_events_term *term __maybe_unused,
1759 struct perf_evlist *evlist __maybe_unused, 1759 struct evlist *evlist __maybe_unused,
1760 int *error_pos __maybe_unused, int err, 1760 int *error_pos __maybe_unused, int err,
1761 char *buf, size_t size) 1761 char *buf, size_t size)
1762{ 1762{
@@ -1780,7 +1780,7 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size)
1780 return 0; 1780 return 0;
1781} 1781}
1782 1782
1783int bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused, 1783int bpf__strerror_setup_output_event(struct evlist *evlist __maybe_unused,
1784 int err, char *buf, size_t size) 1784 int err, char *buf, size_t size)
1785{ 1785{
1786 bpf__strerror_head(err, buf, size); 1786 bpf__strerror_head(err, buf, size);
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index e2048c978a24..25251d63164c 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -40,7 +40,7 @@ enum bpf_loader_errno {
40}; 40};
41 41
42struct evsel; 42struct evsel;
43struct perf_evlist; 43struct evlist;
44struct bpf_object; 44struct bpf_object;
45struct parse_events_term; 45struct parse_events_term;
46#define PERF_BPF_PROBE_GROUP "perf_bpf_probe" 46#define PERF_BPF_PROBE_GROUP "perf_bpf_probe"
@@ -70,18 +70,18 @@ int bpf__foreach_event(struct bpf_object *obj,
70 bpf_prog_iter_callback_t func, void *arg); 70 bpf_prog_iter_callback_t func, void *arg);
71 71
72int bpf__config_obj(struct bpf_object *obj, struct parse_events_term *term, 72int bpf__config_obj(struct bpf_object *obj, struct parse_events_term *term,
73 struct perf_evlist *evlist, int *error_pos); 73 struct evlist *evlist, int *error_pos);
74int bpf__strerror_config_obj(struct bpf_object *obj, 74int bpf__strerror_config_obj(struct bpf_object *obj,
75 struct parse_events_term *term, 75 struct parse_events_term *term,
76 struct perf_evlist *evlist, 76 struct evlist *evlist,
77 int *error_pos, int err, char *buf, 77 int *error_pos, int err, char *buf,
78 size_t size); 78 size_t size);
79int bpf__apply_obj_config(void); 79int bpf__apply_obj_config(void);
80int bpf__strerror_apply_obj_config(int err, char *buf, size_t size); 80int bpf__strerror_apply_obj_config(int err, char *buf, size_t size);
81 81
82int bpf__setup_stdout(struct perf_evlist *evlist); 82int bpf__setup_stdout(struct evlist *evlist);
83struct evsel *bpf__setup_output_event(struct perf_evlist *evlist, const char *name); 83struct evsel *bpf__setup_output_event(struct evlist *evlist, const char *name);
84int bpf__strerror_setup_output_event(struct perf_evlist *evlist, int err, char *buf, size_t size); 84int bpf__strerror_setup_output_event(struct evlist *evlist, int err, char *buf, size_t size);
85#else 85#else
86#include <errno.h> 86#include <errno.h>
87#include <string.h> 87#include <string.h>
@@ -119,7 +119,7 @@ bpf__foreach_event(struct bpf_object *obj __maybe_unused,
119static inline int 119static inline int
120bpf__config_obj(struct bpf_object *obj __maybe_unused, 120bpf__config_obj(struct bpf_object *obj __maybe_unused,
121 struct parse_events_term *term __maybe_unused, 121 struct parse_events_term *term __maybe_unused,
122 struct perf_evlist *evlist __maybe_unused, 122 struct evlist *evlist __maybe_unused,
123 int *error_pos __maybe_unused) 123 int *error_pos __maybe_unused)
124{ 124{
125 return 0; 125 return 0;
@@ -132,13 +132,13 @@ bpf__apply_obj_config(void)
132} 132}
133 133
134static inline int 134static inline int
135bpf__setup_stdout(struct perf_evlist *evlist __maybe_unused) 135bpf__setup_stdout(struct evlist *evlist __maybe_unused)
136{ 136{
137 return 0; 137 return 0;
138} 138}
139 139
140static inline struct evsel * 140static inline struct evsel *
141bpf__setup_output_event(struct perf_evlist *evlist __maybe_unused, const char *name __maybe_unused) 141bpf__setup_output_event(struct evlist *evlist __maybe_unused, const char *name __maybe_unused)
142{ 142{
143 return NULL; 143 return NULL;
144} 144}
@@ -182,7 +182,7 @@ static inline int bpf__strerror_load(struct bpf_object *obj __maybe_unused,
182static inline int 182static inline int
183bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused, 183bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused,
184 struct parse_events_term *term __maybe_unused, 184 struct parse_events_term *term __maybe_unused,
185 struct perf_evlist *evlist __maybe_unused, 185 struct evlist *evlist __maybe_unused,
186 int *error_pos __maybe_unused, 186 int *error_pos __maybe_unused,
187 int err __maybe_unused, 187 int err __maybe_unused,
188 char *buf, size_t size) 188 char *buf, size_t size)
@@ -198,7 +198,7 @@ bpf__strerror_apply_obj_config(int err __maybe_unused,
198} 198}
199 199
200static inline int 200static inline int
201bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused, 201bpf__strerror_setup_output_event(struct evlist *evlist __maybe_unused,
202 int err __maybe_unused, char *buf, size_t size) 202 int err __maybe_unused, char *buf, size_t size)
203{ 203{
204 return __bpf_strerror(buf, size); 204 return __bpf_strerror(buf, size);
@@ -206,7 +206,7 @@ bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused,
206 206
207#endif 207#endif
208 208
209static inline int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, char *buf, size_t size) 209static inline int bpf__strerror_setup_stdout(struct evlist *evlist, int err, char *buf, size_t size)
210{ 210{
211 return bpf__strerror_setup_output_event(evlist, err, buf, size); 211 return bpf__strerror_setup_output_event(evlist, err, buf, size);
212} 212}
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 4f5c326a9477..deb87ecd3671 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -90,7 +90,7 @@ static int open_cgroup(const char *name)
90 return fd; 90 return fd;
91} 91}
92 92
93static struct cgroup *evlist__find_cgroup(struct perf_evlist *evlist, const char *str) 93static struct cgroup *evlist__find_cgroup(struct evlist *evlist, const char *str)
94{ 94{
95 struct evsel *counter; 95 struct evsel *counter;
96 /* 96 /*
@@ -130,14 +130,14 @@ out_err:
130 return NULL; 130 return NULL;
131} 131}
132 132
133struct cgroup *evlist__findnew_cgroup(struct perf_evlist *evlist, const char *name) 133struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name)
134{ 134{
135 struct cgroup *cgroup = evlist__find_cgroup(evlist, name); 135 struct cgroup *cgroup = evlist__find_cgroup(evlist, name);
136 136
137 return cgroup ?: cgroup__new(name); 137 return cgroup ?: cgroup__new(name);
138} 138}
139 139
140static int add_cgroup(struct perf_evlist *evlist, const char *str) 140static int add_cgroup(struct evlist *evlist, const char *str)
141{ 141{
142 struct evsel *counter; 142 struct evsel *counter;
143 struct cgroup *cgrp = evlist__findnew_cgroup(evlist, str); 143 struct cgroup *cgrp = evlist__findnew_cgroup(evlist, str);
@@ -190,7 +190,7 @@ static void evsel__set_default_cgroup(struct evsel *evsel, struct cgroup *cgroup
190 evsel->cgrp = cgroup__get(cgroup); 190 evsel->cgrp = cgroup__get(cgroup);
191} 191}
192 192
193void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup) 193void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup)
194{ 194{
195 struct evsel *evsel; 195 struct evsel *evsel;
196 196
@@ -201,7 +201,7 @@ void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgrou
201int parse_cgroups(const struct option *opt, const char *str, 201int parse_cgroups(const struct option *opt, const char *str,
202 int unset __maybe_unused) 202 int unset __maybe_unused)
203{ 203{
204 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; 204 struct evlist *evlist = *(struct evlist **)opt->value;
205 struct evsel *counter; 205 struct evsel *counter;
206 struct cgroup *cgrp = NULL; 206 struct cgroup *cgrp = NULL;
207 const char *p, *e, *eos = str + strlen(str); 207 const char *p, *e, *eos = str + strlen(str);
diff --git a/tools/perf/util/cgroup.h b/tools/perf/util/cgroup.h
index f033a80c1b14..2ec11f01090d 100644
--- a/tools/perf/util/cgroup.h
+++ b/tools/perf/util/cgroup.h
@@ -18,11 +18,11 @@ extern int nr_cgroups; /* number of explicit cgroups defined */
18struct cgroup *cgroup__get(struct cgroup *cgroup); 18struct cgroup *cgroup__get(struct cgroup *cgroup);
19void cgroup__put(struct cgroup *cgroup); 19void cgroup__put(struct cgroup *cgroup);
20 20
21struct perf_evlist; 21struct evlist;
22 22
23struct cgroup *evlist__findnew_cgroup(struct perf_evlist *evlist, const char *name); 23struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
24 24
25void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup); 25void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
26 26
27int parse_cgroups(const struct option *opt, const char *str, int unset); 27int parse_cgroups(const struct option *opt, const char *str, int unset);
28 28
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 5a9fcb60ec88..c1df366f4519 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -1222,7 +1222,7 @@ static int cs_etm__synth_event(struct perf_session *session,
1222static int cs_etm__synth_events(struct cs_etm_auxtrace *etm, 1222static int cs_etm__synth_events(struct cs_etm_auxtrace *etm,
1223 struct perf_session *session) 1223 struct perf_session *session)
1224{ 1224{
1225 struct perf_evlist *evlist = session->evlist; 1225 struct evlist *evlist = session->evlist;
1226 struct evsel *evsel; 1226 struct evsel *evsel;
1227 struct perf_event_attr attr; 1227 struct perf_event_attr attr;
1228 bool found = false; 1228 bool found = false;
@@ -2295,7 +2295,7 @@ static int cs_etm__process_auxtrace_event(struct perf_session *session,
2295static bool cs_etm__is_timeless_decoding(struct cs_etm_auxtrace *etm) 2295static bool cs_etm__is_timeless_decoding(struct cs_etm_auxtrace *etm)
2296{ 2296{
2297 struct evsel *evsel; 2297 struct evsel *evsel;
2298 struct perf_evlist *evlist = etm->session->evlist; 2298 struct evlist *evlist = etm->session->evlist;
2299 bool timeless_decoding = true; 2299 bool timeless_decoding = true;
2300 2300
2301 /* 2301 /*
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index 042ee5b6f9f1..083101ae7b77 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -1201,7 +1201,7 @@ err:
1201 1201
1202static int setup_events(struct ctf_writer *cw, struct perf_session *session) 1202static int setup_events(struct ctf_writer *cw, struct perf_session *session)
1203{ 1203{
1204 struct perf_evlist *evlist = session->evlist; 1204 struct evlist *evlist = session->evlist;
1205 struct evsel *evsel; 1205 struct evsel *evsel;
1206 int ret; 1206 int ret;
1207 1207
@@ -1308,7 +1308,7 @@ static int setup_non_sample_events(struct ctf_writer *cw,
1308 1308
1309static void cleanup_events(struct perf_session *session) 1309static void cleanup_events(struct perf_session *session)
1310{ 1310{
1311 struct perf_evlist *evlist = session->evlist; 1311 struct evlist *evlist = session->evlist;
1312 struct evsel *evsel; 1312 struct evsel *evsel;
1313 1313
1314 evlist__for_each_entry(evlist, evsel) { 1314 evlist__for_each_entry(evlist, evsel) {
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 7e6066cb525b..c234fa4ba92a 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -41,7 +41,7 @@ int sigqueue(pid_t pid, int sig, const union sigval value);
41#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y)) 41#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
42#define SID(e, x, y) xyarray__entry(e->sample_id, x, y) 42#define SID(e, x, y) xyarray__entry(e->sample_id, x, y)
43 43
44void perf_evlist__init(struct perf_evlist *evlist, struct perf_cpu_map *cpus, 44void perf_evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
45 struct perf_thread_map *threads) 45 struct perf_thread_map *threads)
46{ 46{
47 int i; 47 int i;
@@ -55,9 +55,9 @@ void perf_evlist__init(struct perf_evlist *evlist, struct perf_cpu_map *cpus,
55 evlist->bkw_mmap_state = BKW_MMAP_NOTREADY; 55 evlist->bkw_mmap_state = BKW_MMAP_NOTREADY;
56} 56}
57 57
58struct perf_evlist *perf_evlist__new(void) 58struct evlist *perf_evlist__new(void)
59{ 59{
60 struct perf_evlist *evlist = zalloc(sizeof(*evlist)); 60 struct evlist *evlist = zalloc(sizeof(*evlist));
61 61
62 if (evlist != NULL) 62 if (evlist != NULL)
63 perf_evlist__init(evlist, NULL, NULL); 63 perf_evlist__init(evlist, NULL, NULL);
@@ -65,9 +65,9 @@ struct perf_evlist *perf_evlist__new(void)
65 return evlist; 65 return evlist;
66} 66}
67 67
68struct perf_evlist *perf_evlist__new_default(void) 68struct evlist *perf_evlist__new_default(void)
69{ 69{
70 struct perf_evlist *evlist = perf_evlist__new(); 70 struct evlist *evlist = perf_evlist__new();
71 71
72 if (evlist && perf_evlist__add_default(evlist)) { 72 if (evlist && perf_evlist__add_default(evlist)) {
73 perf_evlist__delete(evlist); 73 perf_evlist__delete(evlist);
@@ -77,9 +77,9 @@ struct perf_evlist *perf_evlist__new_default(void)
77 return evlist; 77 return evlist;
78} 78}
79 79
80struct perf_evlist *perf_evlist__new_dummy(void) 80struct evlist *perf_evlist__new_dummy(void)
81{ 81{
82 struct perf_evlist *evlist = perf_evlist__new(); 82 struct evlist *evlist = perf_evlist__new();
83 83
84 if (evlist && perf_evlist__add_dummy(evlist)) { 84 if (evlist && perf_evlist__add_dummy(evlist)) {
85 perf_evlist__delete(evlist); 85 perf_evlist__delete(evlist);
@@ -96,7 +96,7 @@ struct perf_evlist *perf_evlist__new_dummy(void)
96 * Events with compatible sample types all have the same id_pos 96 * Events with compatible sample types all have the same id_pos
97 * and is_pos. For convenience, put a copy on evlist. 97 * and is_pos. For convenience, put a copy on evlist.
98 */ 98 */
99void perf_evlist__set_id_pos(struct perf_evlist *evlist) 99void perf_evlist__set_id_pos(struct evlist *evlist)
100{ 100{
101 struct evsel *first = perf_evlist__first(evlist); 101 struct evsel *first = perf_evlist__first(evlist);
102 102
@@ -104,7 +104,7 @@ void perf_evlist__set_id_pos(struct perf_evlist *evlist)
104 evlist->is_pos = first->is_pos; 104 evlist->is_pos = first->is_pos;
105} 105}
106 106
107static void perf_evlist__update_id_pos(struct perf_evlist *evlist) 107static void perf_evlist__update_id_pos(struct evlist *evlist)
108{ 108{
109 struct evsel *evsel; 109 struct evsel *evsel;
110 110
@@ -114,7 +114,7 @@ static void perf_evlist__update_id_pos(struct perf_evlist *evlist)
114 perf_evlist__set_id_pos(evlist); 114 perf_evlist__set_id_pos(evlist);
115} 115}
116 116
117static void perf_evlist__purge(struct perf_evlist *evlist) 117static void perf_evlist__purge(struct evlist *evlist)
118{ 118{
119 struct evsel *pos, *n; 119 struct evsel *pos, *n;
120 120
@@ -127,14 +127,14 @@ static void perf_evlist__purge(struct perf_evlist *evlist)
127 evlist->nr_entries = 0; 127 evlist->nr_entries = 0;
128} 128}
129 129
130void perf_evlist__exit(struct perf_evlist *evlist) 130void perf_evlist__exit(struct evlist *evlist)
131{ 131{
132 zfree(&evlist->mmap); 132 zfree(&evlist->mmap);
133 zfree(&evlist->overwrite_mmap); 133 zfree(&evlist->overwrite_mmap);
134 fdarray__exit(&evlist->pollfd); 134 fdarray__exit(&evlist->pollfd);
135} 135}
136 136
137void perf_evlist__delete(struct perf_evlist *evlist) 137void perf_evlist__delete(struct evlist *evlist)
138{ 138{
139 if (evlist == NULL) 139 if (evlist == NULL)
140 return; 140 return;
@@ -150,7 +150,7 @@ void perf_evlist__delete(struct perf_evlist *evlist)
150 free(evlist); 150 free(evlist);
151} 151}
152 152
153static void __perf_evlist__propagate_maps(struct perf_evlist *evlist, 153static void __perf_evlist__propagate_maps(struct evlist *evlist,
154 struct evsel *evsel) 154 struct evsel *evsel)
155{ 155{
156 /* 156 /*
@@ -169,7 +169,7 @@ static void __perf_evlist__propagate_maps(struct perf_evlist *evlist,
169 evsel->threads = thread_map__get(evlist->threads); 169 evsel->threads = thread_map__get(evlist->threads);
170} 170}
171 171
172static void perf_evlist__propagate_maps(struct perf_evlist *evlist) 172static void perf_evlist__propagate_maps(struct evlist *evlist)
173{ 173{
174 struct evsel *evsel; 174 struct evsel *evsel;
175 175
@@ -177,7 +177,7 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist)
177 __perf_evlist__propagate_maps(evlist, evsel); 177 __perf_evlist__propagate_maps(evlist, evsel);
178} 178}
179 179
180void perf_evlist__add(struct perf_evlist *evlist, struct evsel *entry) 180void perf_evlist__add(struct evlist *evlist, struct evsel *entry)
181{ 181{
182 entry->evlist = evlist; 182 entry->evlist = evlist;
183 list_add_tail(&entry->node, &evlist->entries); 183 list_add_tail(&entry->node, &evlist->entries);
@@ -190,14 +190,14 @@ void perf_evlist__add(struct perf_evlist *evlist, struct evsel *entry)
190 __perf_evlist__propagate_maps(evlist, entry); 190 __perf_evlist__propagate_maps(evlist, entry);
191} 191}
192 192
193void perf_evlist__remove(struct perf_evlist *evlist, struct evsel *evsel) 193void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel)
194{ 194{
195 evsel->evlist = NULL; 195 evsel->evlist = NULL;
196 list_del_init(&evsel->node); 196 list_del_init(&evsel->node);
197 evlist->nr_entries -= 1; 197 evlist->nr_entries -= 1;
198} 198}
199 199
200void perf_evlist__splice_list_tail(struct perf_evlist *evlist, 200void perf_evlist__splice_list_tail(struct evlist *evlist,
201 struct list_head *list) 201 struct list_head *list)
202{ 202{
203 struct evsel *evsel, *temp; 203 struct evsel *evsel, *temp;
@@ -222,7 +222,7 @@ void __perf_evlist__set_leader(struct list_head *list)
222 } 222 }
223} 223}
224 224
225void perf_evlist__set_leader(struct perf_evlist *evlist) 225void perf_evlist__set_leader(struct evlist *evlist)
226{ 226{
227 if (evlist->nr_entries) { 227 if (evlist->nr_entries) {
228 evlist->nr_groups = evlist->nr_entries > 1 ? 1 : 0; 228 evlist->nr_groups = evlist->nr_entries > 1 ? 1 : 0;
@@ -230,7 +230,7 @@ void perf_evlist__set_leader(struct perf_evlist *evlist)
230 } 230 }
231} 231}
232 232
233int __perf_evlist__add_default(struct perf_evlist *evlist, bool precise) 233int __perf_evlist__add_default(struct evlist *evlist, bool precise)
234{ 234{
235 struct evsel *evsel = perf_evsel__new_cycles(precise); 235 struct evsel *evsel = perf_evsel__new_cycles(precise);
236 236
@@ -241,7 +241,7 @@ int __perf_evlist__add_default(struct perf_evlist *evlist, bool precise)
241 return 0; 241 return 0;
242} 242}
243 243
244int perf_evlist__add_dummy(struct perf_evlist *evlist) 244int perf_evlist__add_dummy(struct evlist *evlist)
245{ 245{
246 struct perf_event_attr attr = { 246 struct perf_event_attr attr = {
247 .type = PERF_TYPE_SOFTWARE, 247 .type = PERF_TYPE_SOFTWARE,
@@ -257,7 +257,7 @@ int perf_evlist__add_dummy(struct perf_evlist *evlist)
257 return 0; 257 return 0;
258} 258}
259 259
260static int perf_evlist__add_attrs(struct perf_evlist *evlist, 260static int perf_evlist__add_attrs(struct evlist *evlist,
261 struct perf_event_attr *attrs, size_t nr_attrs) 261 struct perf_event_attr *attrs, size_t nr_attrs)
262{ 262{
263 struct evsel *evsel, *n; 263 struct evsel *evsel, *n;
@@ -281,7 +281,7 @@ out_delete_partial_list:
281 return -1; 281 return -1;
282} 282}
283 283
284int __perf_evlist__add_default_attrs(struct perf_evlist *evlist, 284int __perf_evlist__add_default_attrs(struct evlist *evlist,
285 struct perf_event_attr *attrs, size_t nr_attrs) 285 struct perf_event_attr *attrs, size_t nr_attrs)
286{ 286{
287 size_t i; 287 size_t i;
@@ -293,7 +293,7 @@ int __perf_evlist__add_default_attrs(struct perf_evlist *evlist,
293} 293}
294 294
295struct evsel * 295struct evsel *
296perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id) 296perf_evlist__find_tracepoint_by_id(struct evlist *evlist, int id)
297{ 297{
298 struct evsel *evsel; 298 struct evsel *evsel;
299 299
@@ -307,7 +307,7 @@ perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id)
307} 307}
308 308
309struct evsel * 309struct evsel *
310perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist, 310perf_evlist__find_tracepoint_by_name(struct evlist *evlist,
311 const char *name) 311 const char *name)
312{ 312{
313 struct evsel *evsel; 313 struct evsel *evsel;
@@ -321,7 +321,7 @@ perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist,
321 return NULL; 321 return NULL;
322} 322}
323 323
324int perf_evlist__add_newtp(struct perf_evlist *evlist, 324int perf_evlist__add_newtp(struct evlist *evlist,
325 const char *sys, const char *name, void *handler) 325 const char *sys, const char *name, void *handler)
326{ 326{
327 struct evsel *evsel = perf_evsel__newtp(sys, name); 327 struct evsel *evsel = perf_evsel__newtp(sys, name);
@@ -334,7 +334,7 @@ int perf_evlist__add_newtp(struct perf_evlist *evlist,
334 return 0; 334 return 0;
335} 335}
336 336
337static int perf_evlist__nr_threads(struct perf_evlist *evlist, 337static int perf_evlist__nr_threads(struct evlist *evlist,
338 struct evsel *evsel) 338 struct evsel *evsel)
339{ 339{
340 if (evsel->system_wide) 340 if (evsel->system_wide)
@@ -343,7 +343,7 @@ static int perf_evlist__nr_threads(struct perf_evlist *evlist,
343 return thread_map__nr(evlist->threads); 343 return thread_map__nr(evlist->threads);
344} 344}
345 345
346void perf_evlist__disable(struct perf_evlist *evlist) 346void perf_evlist__disable(struct evlist *evlist)
347{ 347{
348 struct evsel *pos; 348 struct evsel *pos;
349 349
@@ -356,7 +356,7 @@ void perf_evlist__disable(struct perf_evlist *evlist)
356 evlist->enabled = false; 356 evlist->enabled = false;
357} 357}
358 358
359void perf_evlist__enable(struct perf_evlist *evlist) 359void perf_evlist__enable(struct evlist *evlist)
360{ 360{
361 struct evsel *pos; 361 struct evsel *pos;
362 362
@@ -369,12 +369,12 @@ void perf_evlist__enable(struct perf_evlist *evlist)
369 evlist->enabled = true; 369 evlist->enabled = true;
370} 370}
371 371
372void perf_evlist__toggle_enable(struct perf_evlist *evlist) 372void perf_evlist__toggle_enable(struct evlist *evlist)
373{ 373{
374 (evlist->enabled ? perf_evlist__disable : perf_evlist__enable)(evlist); 374 (evlist->enabled ? perf_evlist__disable : perf_evlist__enable)(evlist);
375} 375}
376 376
377static int perf_evlist__enable_event_cpu(struct perf_evlist *evlist, 377static int perf_evlist__enable_event_cpu(struct evlist *evlist,
378 struct evsel *evsel, int cpu) 378 struct evsel *evsel, int cpu)
379{ 379{
380 int thread; 380 int thread;
@@ -391,7 +391,7 @@ static int perf_evlist__enable_event_cpu(struct perf_evlist *evlist,
391 return 0; 391 return 0;
392} 392}
393 393
394static int perf_evlist__enable_event_thread(struct perf_evlist *evlist, 394static int perf_evlist__enable_event_thread(struct evlist *evlist,
395 struct evsel *evsel, 395 struct evsel *evsel,
396 int thread) 396 int thread)
397{ 397{
@@ -409,7 +409,7 @@ static int perf_evlist__enable_event_thread(struct perf_evlist *evlist,
409 return 0; 409 return 0;
410} 410}
411 411
412int perf_evlist__enable_event_idx(struct perf_evlist *evlist, 412int perf_evlist__enable_event_idx(struct evlist *evlist,
413 struct evsel *evsel, int idx) 413 struct evsel *evsel, int idx)
414{ 414{
415 bool per_cpu_mmaps = !cpu_map__empty(evlist->cpus); 415 bool per_cpu_mmaps = !cpu_map__empty(evlist->cpus);
@@ -420,7 +420,7 @@ int perf_evlist__enable_event_idx(struct perf_evlist *evlist,
420 return perf_evlist__enable_event_thread(evlist, evsel, idx); 420 return perf_evlist__enable_event_thread(evlist, evsel, idx);
421} 421}
422 422
423int perf_evlist__alloc_pollfd(struct perf_evlist *evlist) 423int perf_evlist__alloc_pollfd(struct evlist *evlist)
424{ 424{
425 int nr_cpus = cpu_map__nr(evlist->cpus); 425 int nr_cpus = cpu_map__nr(evlist->cpus);
426 int nr_threads = thread_map__nr(evlist->threads); 426 int nr_threads = thread_map__nr(evlist->threads);
@@ -441,7 +441,7 @@ int perf_evlist__alloc_pollfd(struct perf_evlist *evlist)
441 return 0; 441 return 0;
442} 442}
443 443
444static int __perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd, 444static int __perf_evlist__add_pollfd(struct evlist *evlist, int fd,
445 struct perf_mmap *map, short revent) 445 struct perf_mmap *map, short revent)
446{ 446{
447 int pos = fdarray__add(&evlist->pollfd, fd, revent | POLLERR | POLLHUP); 447 int pos = fdarray__add(&evlist->pollfd, fd, revent | POLLERR | POLLHUP);
@@ -458,7 +458,7 @@ static int __perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd,
458 return pos; 458 return pos;
459} 459}
460 460
461int perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd) 461int perf_evlist__add_pollfd(struct evlist *evlist, int fd)
462{ 462{
463 return __perf_evlist__add_pollfd(evlist, fd, NULL, POLLIN); 463 return __perf_evlist__add_pollfd(evlist, fd, NULL, POLLIN);
464} 464}
@@ -472,18 +472,18 @@ static void perf_evlist__munmap_filtered(struct fdarray *fda, int fd,
472 perf_mmap__put(map); 472 perf_mmap__put(map);
473} 473}
474 474
475int perf_evlist__filter_pollfd(struct perf_evlist *evlist, short revents_and_mask) 475int perf_evlist__filter_pollfd(struct evlist *evlist, short revents_and_mask)
476{ 476{
477 return fdarray__filter(&evlist->pollfd, revents_and_mask, 477 return fdarray__filter(&evlist->pollfd, revents_and_mask,
478 perf_evlist__munmap_filtered, NULL); 478 perf_evlist__munmap_filtered, NULL);
479} 479}
480 480
481int perf_evlist__poll(struct perf_evlist *evlist, int timeout) 481int perf_evlist__poll(struct evlist *evlist, int timeout)
482{ 482{
483 return fdarray__poll(&evlist->pollfd, timeout); 483 return fdarray__poll(&evlist->pollfd, timeout);
484} 484}
485 485
486static void perf_evlist__id_hash(struct perf_evlist *evlist, 486static void perf_evlist__id_hash(struct evlist *evlist,
487 struct evsel *evsel, 487 struct evsel *evsel,
488 int cpu, int thread, u64 id) 488 int cpu, int thread, u64 id)
489{ 489{
@@ -496,14 +496,14 @@ static void perf_evlist__id_hash(struct perf_evlist *evlist,
496 hlist_add_head(&sid->node, &evlist->heads[hash]); 496 hlist_add_head(&sid->node, &evlist->heads[hash]);
497} 497}
498 498
499void perf_evlist__id_add(struct perf_evlist *evlist, struct evsel *evsel, 499void perf_evlist__id_add(struct evlist *evlist, struct evsel *evsel,
500 int cpu, int thread, u64 id) 500 int cpu, int thread, u64 id)
501{ 501{
502 perf_evlist__id_hash(evlist, evsel, cpu, thread, id); 502 perf_evlist__id_hash(evlist, evsel, cpu, thread, id);
503 evsel->id[evsel->ids++] = id; 503 evsel->id[evsel->ids++] = id;
504} 504}
505 505
506int perf_evlist__id_add_fd(struct perf_evlist *evlist, 506int perf_evlist__id_add_fd(struct evlist *evlist,
507 struct evsel *evsel, 507 struct evsel *evsel,
508 int cpu, int thread, int fd) 508 int cpu, int thread, int fd)
509{ 509{
@@ -544,7 +544,7 @@ int perf_evlist__id_add_fd(struct perf_evlist *evlist,
544 return 0; 544 return 0;
545} 545}
546 546
547static void perf_evlist__set_sid_idx(struct perf_evlist *evlist, 547static void perf_evlist__set_sid_idx(struct evlist *evlist,
548 struct evsel *evsel, int idx, int cpu, 548 struct evsel *evsel, int idx, int cpu,
549 int thread) 549 int thread)
550{ 550{
@@ -560,7 +560,7 @@ static void perf_evlist__set_sid_idx(struct perf_evlist *evlist,
560 sid->tid = -1; 560 sid->tid = -1;
561} 561}
562 562
563struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id) 563struct perf_sample_id *perf_evlist__id2sid(struct evlist *evlist, u64 id)
564{ 564{
565 struct hlist_head *head; 565 struct hlist_head *head;
566 struct perf_sample_id *sid; 566 struct perf_sample_id *sid;
@@ -576,7 +576,7 @@ struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id)
576 return NULL; 576 return NULL;
577} 577}
578 578
579struct evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id) 579struct evsel *perf_evlist__id2evsel(struct evlist *evlist, u64 id)
580{ 580{
581 struct perf_sample_id *sid; 581 struct perf_sample_id *sid;
582 582
@@ -593,7 +593,7 @@ struct evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id)
593 return NULL; 593 return NULL;
594} 594}
595 595
596struct evsel *perf_evlist__id2evsel_strict(struct perf_evlist *evlist, 596struct evsel *perf_evlist__id2evsel_strict(struct evlist *evlist,
597 u64 id) 597 u64 id)
598{ 598{
599 struct perf_sample_id *sid; 599 struct perf_sample_id *sid;
@@ -608,7 +608,7 @@ struct evsel *perf_evlist__id2evsel_strict(struct perf_evlist *evlist,
608 return NULL; 608 return NULL;
609} 609}
610 610
611static int perf_evlist__event2id(struct perf_evlist *evlist, 611static int perf_evlist__event2id(struct evlist *evlist,
612 union perf_event *event, u64 *id) 612 union perf_event *event, u64 *id)
613{ 613{
614 const u64 *array = event->sample.array; 614 const u64 *array = event->sample.array;
@@ -629,7 +629,7 @@ static int perf_evlist__event2id(struct perf_evlist *evlist,
629 return 0; 629 return 0;
630} 630}
631 631
632struct evsel *perf_evlist__event2evsel(struct perf_evlist *evlist, 632struct evsel *perf_evlist__event2evsel(struct evlist *evlist,
633 union perf_event *event) 633 union perf_event *event)
634{ 634{
635 struct evsel *first = perf_evlist__first(evlist); 635 struct evsel *first = perf_evlist__first(evlist);
@@ -662,7 +662,7 @@ struct evsel *perf_evlist__event2evsel(struct perf_evlist *evlist,
662 return NULL; 662 return NULL;
663} 663}
664 664
665static int perf_evlist__set_paused(struct perf_evlist *evlist, bool value) 665static int perf_evlist__set_paused(struct evlist *evlist, bool value)
666{ 666{
667 int i; 667 int i;
668 668
@@ -682,17 +682,17 @@ static int perf_evlist__set_paused(struct perf_evlist *evlist, bool value)
682 return 0; 682 return 0;
683} 683}
684 684
685static int perf_evlist__pause(struct perf_evlist *evlist) 685static int perf_evlist__pause(struct evlist *evlist)
686{ 686{
687 return perf_evlist__set_paused(evlist, true); 687 return perf_evlist__set_paused(evlist, true);
688} 688}
689 689
690static int perf_evlist__resume(struct perf_evlist *evlist) 690static int perf_evlist__resume(struct evlist *evlist)
691{ 691{
692 return perf_evlist__set_paused(evlist, false); 692 return perf_evlist__set_paused(evlist, false);
693} 693}
694 694
695static void perf_evlist__munmap_nofree(struct perf_evlist *evlist) 695static void perf_evlist__munmap_nofree(struct evlist *evlist)
696{ 696{
697 int i; 697 int i;
698 698
@@ -705,14 +705,14 @@ static void perf_evlist__munmap_nofree(struct perf_evlist *evlist)
705 perf_mmap__munmap(&evlist->overwrite_mmap[i]); 705 perf_mmap__munmap(&evlist->overwrite_mmap[i]);
706} 706}
707 707
708void perf_evlist__munmap(struct perf_evlist *evlist) 708void perf_evlist__munmap(struct evlist *evlist)
709{ 709{
710 perf_evlist__munmap_nofree(evlist); 710 perf_evlist__munmap_nofree(evlist);
711 zfree(&evlist->mmap); 711 zfree(&evlist->mmap);
712 zfree(&evlist->overwrite_mmap); 712 zfree(&evlist->overwrite_mmap);
713} 713}
714 714
715static struct perf_mmap *perf_evlist__alloc_mmap(struct perf_evlist *evlist, 715static struct perf_mmap *perf_evlist__alloc_mmap(struct evlist *evlist,
716 bool overwrite) 716 bool overwrite)
717{ 717{
718 int i; 718 int i;
@@ -743,7 +743,7 @@ static struct perf_mmap *perf_evlist__alloc_mmap(struct perf_evlist *evlist,
743} 743}
744 744
745static bool 745static bool
746perf_evlist__should_poll(struct perf_evlist *evlist __maybe_unused, 746perf_evlist__should_poll(struct evlist *evlist __maybe_unused,
747 struct evsel *evsel) 747 struct evsel *evsel)
748{ 748{
749 if (evsel->attr.write_backward) 749 if (evsel->attr.write_backward)
@@ -751,7 +751,7 @@ perf_evlist__should_poll(struct perf_evlist *evlist __maybe_unused,
751 return true; 751 return true;
752} 752}
753 753
754static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx, 754static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx,
755 struct mmap_params *mp, int cpu_idx, 755 struct mmap_params *mp, int cpu_idx,
756 int thread, int *_output, int *_output_overwrite) 756 int thread, int *_output, int *_output_overwrite)
757{ 757{
@@ -829,7 +829,7 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
829 return 0; 829 return 0;
830} 830}
831 831
832static int perf_evlist__mmap_per_cpu(struct perf_evlist *evlist, 832static int perf_evlist__mmap_per_cpu(struct evlist *evlist,
833 struct mmap_params *mp) 833 struct mmap_params *mp)
834{ 834{
835 int cpu, thread; 835 int cpu, thread;
@@ -858,7 +858,7 @@ out_unmap:
858 return -1; 858 return -1;
859} 859}
860 860
861static int perf_evlist__mmap_per_thread(struct perf_evlist *evlist, 861static int perf_evlist__mmap_per_thread(struct evlist *evlist,
862 struct mmap_params *mp) 862 struct mmap_params *mp)
863{ 863{
864 int thread; 864 int thread;
@@ -1006,7 +1006,7 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
1006 * 1006 *
1007 * Return: %0 on success, negative error code otherwise. 1007 * Return: %0 on success, negative error code otherwise.
1008 */ 1008 */
1009int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, 1009int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
1010 unsigned int auxtrace_pages, 1010 unsigned int auxtrace_pages,
1011 bool auxtrace_overwrite, int nr_cblocks, int affinity, int flush, 1011 bool auxtrace_overwrite, int nr_cblocks, int affinity, int flush,
1012 int comp_level) 1012 int comp_level)
@@ -1050,12 +1050,12 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
1050 return perf_evlist__mmap_per_cpu(evlist, &mp); 1050 return perf_evlist__mmap_per_cpu(evlist, &mp);
1051} 1051}
1052 1052
1053int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages) 1053int perf_evlist__mmap(struct evlist *evlist, unsigned int pages)
1054{ 1054{
1055 return perf_evlist__mmap_ex(evlist, pages, 0, false, 0, PERF_AFFINITY_SYS, 1, 0); 1055 return perf_evlist__mmap_ex(evlist, pages, 0, false, 0, PERF_AFFINITY_SYS, 1, 0);
1056} 1056}
1057 1057
1058int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) 1058int perf_evlist__create_maps(struct evlist *evlist, struct target *target)
1059{ 1059{
1060 bool all_threads = (target->per_thread && target->system_wide); 1060 bool all_threads = (target->per_thread && target->system_wide);
1061 struct perf_cpu_map *cpus; 1061 struct perf_cpu_map *cpus;
@@ -1104,7 +1104,7 @@ out_delete_threads:
1104 return -1; 1104 return -1;
1105} 1105}
1106 1106
1107void perf_evlist__set_maps(struct perf_evlist *evlist, struct perf_cpu_map *cpus, 1107void perf_evlist__set_maps(struct evlist *evlist, struct perf_cpu_map *cpus,
1108 struct perf_thread_map *threads) 1108 struct perf_thread_map *threads)
1109{ 1109{
1110 /* 1110 /*
@@ -1127,7 +1127,7 @@ void perf_evlist__set_maps(struct perf_evlist *evlist, struct perf_cpu_map *cpus
1127 perf_evlist__propagate_maps(evlist); 1127 perf_evlist__propagate_maps(evlist);
1128} 1128}
1129 1129
1130void __perf_evlist__set_sample_bit(struct perf_evlist *evlist, 1130void __perf_evlist__set_sample_bit(struct evlist *evlist,
1131 enum perf_event_sample_format bit) 1131 enum perf_event_sample_format bit)
1132{ 1132{
1133 struct evsel *evsel; 1133 struct evsel *evsel;
@@ -1136,7 +1136,7 @@ void __perf_evlist__set_sample_bit(struct perf_evlist *evlist,
1136 __perf_evsel__set_sample_bit(evsel, bit); 1136 __perf_evsel__set_sample_bit(evsel, bit);
1137} 1137}
1138 1138
1139void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist, 1139void __perf_evlist__reset_sample_bit(struct evlist *evlist,
1140 enum perf_event_sample_format bit) 1140 enum perf_event_sample_format bit)
1141{ 1141{
1142 struct evsel *evsel; 1142 struct evsel *evsel;
@@ -1145,7 +1145,7 @@ void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist,
1145 __perf_evsel__reset_sample_bit(evsel, bit); 1145 __perf_evsel__reset_sample_bit(evsel, bit);
1146} 1146}
1147 1147
1148int perf_evlist__apply_filters(struct perf_evlist *evlist, struct evsel **err_evsel) 1148int perf_evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel)
1149{ 1149{
1150 struct evsel *evsel; 1150 struct evsel *evsel;
1151 int err = 0; 1151 int err = 0;
@@ -1168,7 +1168,7 @@ int perf_evlist__apply_filters(struct perf_evlist *evlist, struct evsel **err_ev
1168 return err; 1168 return err;
1169} 1169}
1170 1170
1171int perf_evlist__set_tp_filter(struct perf_evlist *evlist, const char *filter) 1171int perf_evlist__set_tp_filter(struct evlist *evlist, const char *filter)
1172{ 1172{
1173 struct evsel *evsel; 1173 struct evsel *evsel;
1174 int err = 0; 1174 int err = 0;
@@ -1185,7 +1185,7 @@ int perf_evlist__set_tp_filter(struct perf_evlist *evlist, const char *filter)
1185 return err; 1185 return err;
1186} 1186}
1187 1187
1188int perf_evlist__set_tp_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids) 1188int perf_evlist__set_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids)
1189{ 1189{
1190 char *filter; 1190 char *filter;
1191 int ret = -1; 1191 int ret = -1;
@@ -1212,12 +1212,12 @@ out_free:
1212 return ret; 1212 return ret;
1213} 1213}
1214 1214
1215int perf_evlist__set_tp_filter_pid(struct perf_evlist *evlist, pid_t pid) 1215int perf_evlist__set_tp_filter_pid(struct evlist *evlist, pid_t pid)
1216{ 1216{
1217 return perf_evlist__set_tp_filter_pids(evlist, 1, &pid); 1217 return perf_evlist__set_tp_filter_pids(evlist, 1, &pid);
1218} 1218}
1219 1219
1220bool perf_evlist__valid_sample_type(struct perf_evlist *evlist) 1220bool perf_evlist__valid_sample_type(struct evlist *evlist)
1221{ 1221{
1222 struct evsel *pos; 1222 struct evsel *pos;
1223 1223
@@ -1236,7 +1236,7 @@ bool perf_evlist__valid_sample_type(struct perf_evlist *evlist)
1236 return true; 1236 return true;
1237} 1237}
1238 1238
1239u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist) 1239u64 __perf_evlist__combined_sample_type(struct evlist *evlist)
1240{ 1240{
1241 struct evsel *evsel; 1241 struct evsel *evsel;
1242 1242
@@ -1249,13 +1249,13 @@ u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist)
1249 return evlist->combined_sample_type; 1249 return evlist->combined_sample_type;
1250} 1250}
1251 1251
1252u64 perf_evlist__combined_sample_type(struct perf_evlist *evlist) 1252u64 perf_evlist__combined_sample_type(struct evlist *evlist)
1253{ 1253{
1254 evlist->combined_sample_type = 0; 1254 evlist->combined_sample_type = 0;
1255 return __perf_evlist__combined_sample_type(evlist); 1255 return __perf_evlist__combined_sample_type(evlist);
1256} 1256}
1257 1257
1258u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist) 1258u64 perf_evlist__combined_branch_type(struct evlist *evlist)
1259{ 1259{
1260 struct evsel *evsel; 1260 struct evsel *evsel;
1261 u64 branch_type = 0; 1261 u64 branch_type = 0;
@@ -1265,7 +1265,7 @@ u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist)
1265 return branch_type; 1265 return branch_type;
1266} 1266}
1267 1267
1268bool perf_evlist__valid_read_format(struct perf_evlist *evlist) 1268bool perf_evlist__valid_read_format(struct evlist *evlist)
1269{ 1269{
1270 struct evsel *first = perf_evlist__first(evlist), *pos = first; 1270 struct evsel *first = perf_evlist__first(evlist), *pos = first;
1271 u64 read_format = first->attr.read_format; 1271 u64 read_format = first->attr.read_format;
@@ -1285,13 +1285,13 @@ bool perf_evlist__valid_read_format(struct perf_evlist *evlist)
1285 return true; 1285 return true;
1286} 1286}
1287 1287
1288u64 perf_evlist__read_format(struct perf_evlist *evlist) 1288u64 perf_evlist__read_format(struct evlist *evlist)
1289{ 1289{
1290 struct evsel *first = perf_evlist__first(evlist); 1290 struct evsel *first = perf_evlist__first(evlist);
1291 return first->attr.read_format; 1291 return first->attr.read_format;
1292} 1292}
1293 1293
1294u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist) 1294u16 perf_evlist__id_hdr_size(struct evlist *evlist)
1295{ 1295{
1296 struct evsel *first = perf_evlist__first(evlist); 1296 struct evsel *first = perf_evlist__first(evlist);
1297 struct perf_sample *data; 1297 struct perf_sample *data;
@@ -1324,7 +1324,7 @@ out:
1324 return size; 1324 return size;
1325} 1325}
1326 1326
1327bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist) 1327bool perf_evlist__valid_sample_id_all(struct evlist *evlist)
1328{ 1328{
1329 struct evsel *first = perf_evlist__first(evlist), *pos = first; 1329 struct evsel *first = perf_evlist__first(evlist), *pos = first;
1330 1330
@@ -1336,19 +1336,19 @@ bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist)
1336 return true; 1336 return true;
1337} 1337}
1338 1338
1339bool perf_evlist__sample_id_all(struct perf_evlist *evlist) 1339bool perf_evlist__sample_id_all(struct evlist *evlist)
1340{ 1340{
1341 struct evsel *first = perf_evlist__first(evlist); 1341 struct evsel *first = perf_evlist__first(evlist);
1342 return first->attr.sample_id_all; 1342 return first->attr.sample_id_all;
1343} 1343}
1344 1344
1345void perf_evlist__set_selected(struct perf_evlist *evlist, 1345void perf_evlist__set_selected(struct evlist *evlist,
1346 struct evsel *evsel) 1346 struct evsel *evsel)
1347{ 1347{
1348 evlist->selected = evsel; 1348 evlist->selected = evsel;
1349} 1349}
1350 1350
1351void perf_evlist__close(struct perf_evlist *evlist) 1351void perf_evlist__close(struct evlist *evlist)
1352{ 1352{
1353 struct evsel *evsel; 1353 struct evsel *evsel;
1354 1354
@@ -1356,7 +1356,7 @@ void perf_evlist__close(struct perf_evlist *evlist)
1356 perf_evsel__close(evsel); 1356 perf_evsel__close(evsel);
1357} 1357}
1358 1358
1359static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist) 1359static int perf_evlist__create_syswide_maps(struct evlist *evlist)
1360{ 1360{
1361 struct perf_cpu_map *cpus; 1361 struct perf_cpu_map *cpus;
1362 struct perf_thread_map *threads; 1362 struct perf_thread_map *threads;
@@ -1387,7 +1387,7 @@ out_put:
1387 goto out; 1387 goto out;
1388} 1388}
1389 1389
1390int perf_evlist__open(struct perf_evlist *evlist) 1390int perf_evlist__open(struct evlist *evlist)
1391{ 1391{
1392 struct evsel *evsel; 1392 struct evsel *evsel;
1393 int err; 1393 int err;
@@ -1417,7 +1417,7 @@ out_err:
1417 return err; 1417 return err;
1418} 1418}
1419 1419
1420int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct target *target, 1420int perf_evlist__prepare_workload(struct evlist *evlist, struct target *target,
1421 const char *argv[], bool pipe_output, 1421 const char *argv[], bool pipe_output,
1422 void (*exec_error)(int signo, siginfo_t *info, void *ucontext)) 1422 void (*exec_error)(int signo, siginfo_t *info, void *ucontext))
1423{ 1423{
@@ -1531,7 +1531,7 @@ out_close_ready_pipe:
1531 return -1; 1531 return -1;
1532} 1532}
1533 1533
1534int perf_evlist__start_workload(struct perf_evlist *evlist) 1534int perf_evlist__start_workload(struct evlist *evlist)
1535{ 1535{
1536 if (evlist->workload.cork_fd > 0) { 1536 if (evlist->workload.cork_fd > 0) {
1537 char bf = 0; 1537 char bf = 0;
@@ -1550,7 +1550,7 @@ int perf_evlist__start_workload(struct perf_evlist *evlist)
1550 return 0; 1550 return 0;
1551} 1551}
1552 1552
1553int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event, 1553int perf_evlist__parse_sample(struct evlist *evlist, union perf_event *event,
1554 struct perf_sample *sample) 1554 struct perf_sample *sample)
1555{ 1555{
1556 struct evsel *evsel = perf_evlist__event2evsel(evlist, event); 1556 struct evsel *evsel = perf_evlist__event2evsel(evlist, event);
@@ -1560,7 +1560,7 @@ int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *even
1560 return perf_evsel__parse_sample(evsel, event, sample); 1560 return perf_evsel__parse_sample(evsel, event, sample);
1561} 1561}
1562 1562
1563int perf_evlist__parse_sample_timestamp(struct perf_evlist *evlist, 1563int perf_evlist__parse_sample_timestamp(struct evlist *evlist,
1564 union perf_event *event, 1564 union perf_event *event,
1565 u64 *timestamp) 1565 u64 *timestamp)
1566{ 1566{
@@ -1571,7 +1571,7 @@ int perf_evlist__parse_sample_timestamp(struct perf_evlist *evlist,
1571 return perf_evsel__parse_sample_timestamp(evsel, event, timestamp); 1571 return perf_evsel__parse_sample_timestamp(evsel, event, timestamp);
1572} 1572}
1573 1573
1574size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp) 1574size_t perf_evlist__fprintf(struct evlist *evlist, FILE *fp)
1575{ 1575{
1576 struct evsel *evsel; 1576 struct evsel *evsel;
1577 size_t printed = 0; 1577 size_t printed = 0;
@@ -1584,7 +1584,7 @@ size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp)
1584 return printed + fprintf(fp, "\n"); 1584 return printed + fprintf(fp, "\n");
1585} 1585}
1586 1586
1587int perf_evlist__strerror_open(struct perf_evlist *evlist, 1587int perf_evlist__strerror_open(struct evlist *evlist,
1588 int err, char *buf, size_t size) 1588 int err, char *buf, size_t size)
1589{ 1589{
1590 int printed, value; 1590 int printed, value;
@@ -1638,7 +1638,7 @@ out_default:
1638 return 0; 1638 return 0;
1639} 1639}
1640 1640
1641int perf_evlist__strerror_mmap(struct perf_evlist *evlist, int err, char *buf, size_t size) 1641int perf_evlist__strerror_mmap(struct evlist *evlist, int err, char *buf, size_t size)
1642{ 1642{
1643 char sbuf[STRERR_BUFSIZE], *emsg = str_error_r(err, sbuf, sizeof(sbuf)); 1643 char sbuf[STRERR_BUFSIZE], *emsg = str_error_r(err, sbuf, sizeof(sbuf));
1644 int pages_attempted = evlist->mmap_len / 1024, pages_max_per_user, printed = 0; 1644 int pages_attempted = evlist->mmap_len / 1024, pages_max_per_user, printed = 0;
@@ -1669,7 +1669,7 @@ int perf_evlist__strerror_mmap(struct perf_evlist *evlist, int err, char *buf, s
1669 return 0; 1669 return 0;
1670} 1670}
1671 1671
1672void perf_evlist__to_front(struct perf_evlist *evlist, 1672void perf_evlist__to_front(struct evlist *evlist,
1673 struct evsel *move_evsel) 1673 struct evsel *move_evsel)
1674{ 1674{
1675 struct evsel *evsel, *n; 1675 struct evsel *evsel, *n;
@@ -1686,7 +1686,7 @@ void perf_evlist__to_front(struct perf_evlist *evlist,
1686 list_splice(&move, &evlist->entries); 1686 list_splice(&move, &evlist->entries);
1687} 1687}
1688 1688
1689void perf_evlist__set_tracking_event(struct perf_evlist *evlist, 1689void perf_evlist__set_tracking_event(struct evlist *evlist,
1690 struct evsel *tracking_evsel) 1690 struct evsel *tracking_evsel)
1691{ 1691{
1692 struct evsel *evsel; 1692 struct evsel *evsel;
@@ -1703,7 +1703,7 @@ void perf_evlist__set_tracking_event(struct perf_evlist *evlist,
1703} 1703}
1704 1704
1705struct evsel * 1705struct evsel *
1706perf_evlist__find_evsel_by_str(struct perf_evlist *evlist, 1706perf_evlist__find_evsel_by_str(struct evlist *evlist,
1707 const char *str) 1707 const char *str)
1708{ 1708{
1709 struct evsel *evsel; 1709 struct evsel *evsel;
@@ -1718,7 +1718,7 @@ perf_evlist__find_evsel_by_str(struct perf_evlist *evlist,
1718 return NULL; 1718 return NULL;
1719} 1719}
1720 1720
1721void perf_evlist__toggle_bkw_mmap(struct perf_evlist *evlist, 1721void perf_evlist__toggle_bkw_mmap(struct evlist *evlist,
1722 enum bkw_mmap_state state) 1722 enum bkw_mmap_state state)
1723{ 1723{
1724 enum bkw_mmap_state old_state = evlist->bkw_mmap_state; 1724 enum bkw_mmap_state old_state = evlist->bkw_mmap_state;
@@ -1776,7 +1776,7 @@ state_err:
1776 return; 1776 return;
1777} 1777}
1778 1778
1779bool perf_evlist__exclude_kernel(struct perf_evlist *evlist) 1779bool perf_evlist__exclude_kernel(struct evlist *evlist)
1780{ 1780{
1781 struct evsel *evsel; 1781 struct evsel *evsel;
1782 1782
@@ -1793,7 +1793,7 @@ bool perf_evlist__exclude_kernel(struct perf_evlist *evlist)
1793 * the group display. Set the artificial group and set the leader's 1793 * the group display. Set the artificial group and set the leader's
1794 * forced_leader flag to notify the display code. 1794 * forced_leader flag to notify the display code.
1795 */ 1795 */
1796void perf_evlist__force_leader(struct perf_evlist *evlist) 1796void perf_evlist__force_leader(struct evlist *evlist)
1797{ 1797{
1798 if (!evlist->nr_groups) { 1798 if (!evlist->nr_groups) {
1799 struct evsel *leader = perf_evlist__first(evlist); 1799 struct evsel *leader = perf_evlist__first(evlist);
@@ -1803,7 +1803,7 @@ void perf_evlist__force_leader(struct perf_evlist *evlist)
1803 } 1803 }
1804} 1804}
1805 1805
1806struct evsel *perf_evlist__reset_weak_group(struct perf_evlist *evsel_list, 1806struct evsel *perf_evlist__reset_weak_group(struct evlist *evsel_list,
1807 struct evsel *evsel) 1807 struct evsel *evsel)
1808{ 1808{
1809 struct evsel *c2, *leader; 1809 struct evsel *c2, *leader;
@@ -1830,7 +1830,7 @@ struct evsel *perf_evlist__reset_weak_group(struct perf_evlist *evsel_list,
1830 return leader; 1830 return leader;
1831} 1831}
1832 1832
1833int perf_evlist__add_sb_event(struct perf_evlist **evlist, 1833int perf_evlist__add_sb_event(struct evlist **evlist,
1834 struct perf_event_attr *attr, 1834 struct perf_event_attr *attr,
1835 perf_evsel__sb_cb_t cb, 1835 perf_evsel__sb_cb_t cb,
1836 void *data) 1836 void *data)
@@ -1867,7 +1867,7 @@ out_err:
1867 1867
1868static void *perf_evlist__poll_thread(void *arg) 1868static void *perf_evlist__poll_thread(void *arg)
1869{ 1869{
1870 struct perf_evlist *evlist = arg; 1870 struct evlist *evlist = arg;
1871 bool draining = false; 1871 bool draining = false;
1872 int i, done = 0; 1872 int i, done = 0;
1873 1873
@@ -1906,7 +1906,7 @@ static void *perf_evlist__poll_thread(void *arg)
1906 return NULL; 1906 return NULL;
1907} 1907}
1908 1908
1909int perf_evlist__start_sb_thread(struct perf_evlist *evlist, 1909int perf_evlist__start_sb_thread(struct evlist *evlist,
1910 struct target *target) 1910 struct target *target)
1911{ 1911{
1912 struct evsel *counter; 1912 struct evsel *counter;
@@ -1943,7 +1943,7 @@ out_delete_evlist:
1943 return -1; 1943 return -1;
1944} 1944}
1945 1945
1946void perf_evlist__stop_sb_thread(struct perf_evlist *evlist) 1946void perf_evlist__stop_sb_thread(struct evlist *evlist)
1947{ 1947{
1948 if (!evlist) 1948 if (!evlist)
1949 return; 1949 return;
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 576d59a0d8cf..54f1c3e2b721 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -24,7 +24,7 @@ struct record_opts;
24#define PERF_EVLIST__HLIST_BITS 8 24#define PERF_EVLIST__HLIST_BITS 8
25#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS) 25#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
26 26
27struct perf_evlist { 27struct evlist {
28 struct list_head entries; 28 struct list_head entries;
29 struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]; 29 struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
30 int nr_entries; 30 int nr_entries;
@@ -49,7 +49,7 @@ struct perf_evlist {
49 struct evsel *selected; 49 struct evsel *selected;
50 struct events_stats stats; 50 struct events_stats stats;
51 struct perf_env *env; 51 struct perf_env *env;
52 void (*trace_event_sample_raw)(struct perf_evlist *evlist, 52 void (*trace_event_sample_raw)(struct evlist *evlist,
53 union perf_event *event, 53 union perf_event *event,
54 struct perf_sample *sample); 54 struct perf_sample *sample);
55 u64 first_sample_time; 55 u64 first_sample_time;
@@ -65,46 +65,46 @@ struct evsel_str_handler {
65 void *handler; 65 void *handler;
66}; 66};
67 67
68struct perf_evlist *perf_evlist__new(void); 68struct evlist *perf_evlist__new(void);
69struct perf_evlist *perf_evlist__new_default(void); 69struct evlist *perf_evlist__new_default(void);
70struct perf_evlist *perf_evlist__new_dummy(void); 70struct evlist *perf_evlist__new_dummy(void);
71void perf_evlist__init(struct perf_evlist *evlist, struct perf_cpu_map *cpus, 71void perf_evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
72 struct perf_thread_map *threads); 72 struct perf_thread_map *threads);
73void perf_evlist__exit(struct perf_evlist *evlist); 73void perf_evlist__exit(struct evlist *evlist);
74void perf_evlist__delete(struct perf_evlist *evlist); 74void perf_evlist__delete(struct evlist *evlist);
75 75
76void perf_evlist__add(struct perf_evlist *evlist, struct evsel *entry); 76void perf_evlist__add(struct evlist *evlist, struct evsel *entry);
77void perf_evlist__remove(struct perf_evlist *evlist, struct evsel *evsel); 77void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
78 78
79int __perf_evlist__add_default(struct perf_evlist *evlist, bool precise); 79int __perf_evlist__add_default(struct evlist *evlist, bool precise);
80 80
81static inline int perf_evlist__add_default(struct perf_evlist *evlist) 81static inline int perf_evlist__add_default(struct evlist *evlist)
82{ 82{
83 return __perf_evlist__add_default(evlist, true); 83 return __perf_evlist__add_default(evlist, true);
84} 84}
85 85
86int __perf_evlist__add_default_attrs(struct perf_evlist *evlist, 86int __perf_evlist__add_default_attrs(struct evlist *evlist,
87 struct perf_event_attr *attrs, size_t nr_attrs); 87 struct perf_event_attr *attrs, size_t nr_attrs);
88 88
89#define perf_evlist__add_default_attrs(evlist, array) \ 89#define perf_evlist__add_default_attrs(evlist, array) \
90 __perf_evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array)) 90 __perf_evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array))
91 91
92int perf_evlist__add_dummy(struct perf_evlist *evlist); 92int perf_evlist__add_dummy(struct evlist *evlist);
93 93
94int perf_evlist__add_sb_event(struct perf_evlist **evlist, 94int perf_evlist__add_sb_event(struct evlist **evlist,
95 struct perf_event_attr *attr, 95 struct perf_event_attr *attr,
96 perf_evsel__sb_cb_t cb, 96 perf_evsel__sb_cb_t cb,
97 void *data); 97 void *data);
98int perf_evlist__start_sb_thread(struct perf_evlist *evlist, 98int perf_evlist__start_sb_thread(struct evlist *evlist,
99 struct target *target); 99 struct target *target);
100void perf_evlist__stop_sb_thread(struct perf_evlist *evlist); 100void perf_evlist__stop_sb_thread(struct evlist *evlist);
101 101
102int perf_evlist__add_newtp(struct perf_evlist *evlist, 102int perf_evlist__add_newtp(struct evlist *evlist,
103 const char *sys, const char *name, void *handler); 103 const char *sys, const char *name, void *handler);
104 104
105void __perf_evlist__set_sample_bit(struct perf_evlist *evlist, 105void __perf_evlist__set_sample_bit(struct evlist *evlist,
106 enum perf_event_sample_format bit); 106 enum perf_event_sample_format bit);
107void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist, 107void __perf_evlist__reset_sample_bit(struct evlist *evlist,
108 enum perf_event_sample_format bit); 108 enum perf_event_sample_format bit);
109 109
110#define perf_evlist__set_sample_bit(evlist, bit) \ 110#define perf_evlist__set_sample_bit(evlist, bit) \
@@ -113,58 +113,58 @@ void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist,
113#define perf_evlist__reset_sample_bit(evlist, bit) \ 113#define perf_evlist__reset_sample_bit(evlist, bit) \
114 __perf_evlist__reset_sample_bit(evlist, PERF_SAMPLE_##bit) 114 __perf_evlist__reset_sample_bit(evlist, PERF_SAMPLE_##bit)
115 115
116int perf_evlist__set_tp_filter(struct perf_evlist *evlist, const char *filter); 116int perf_evlist__set_tp_filter(struct evlist *evlist, const char *filter);
117int perf_evlist__set_tp_filter_pid(struct perf_evlist *evlist, pid_t pid); 117int perf_evlist__set_tp_filter_pid(struct evlist *evlist, pid_t pid);
118int perf_evlist__set_tp_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids); 118int perf_evlist__set_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids);
119 119
120struct evsel * 120struct evsel *
121perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id); 121perf_evlist__find_tracepoint_by_id(struct evlist *evlist, int id);
122 122
123struct evsel * 123struct evsel *
124perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist, 124perf_evlist__find_tracepoint_by_name(struct evlist *evlist,
125 const char *name); 125 const char *name);
126 126
127void perf_evlist__id_add(struct perf_evlist *evlist, struct evsel *evsel, 127void perf_evlist__id_add(struct evlist *evlist, struct evsel *evsel,
128 int cpu, int thread, u64 id); 128 int cpu, int thread, u64 id);
129int perf_evlist__id_add_fd(struct perf_evlist *evlist, 129int perf_evlist__id_add_fd(struct evlist *evlist,
130 struct evsel *evsel, 130 struct evsel *evsel,
131 int cpu, int thread, int fd); 131 int cpu, int thread, int fd);
132 132
133int perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd); 133int perf_evlist__add_pollfd(struct evlist *evlist, int fd);
134int perf_evlist__alloc_pollfd(struct perf_evlist *evlist); 134int perf_evlist__alloc_pollfd(struct evlist *evlist);
135int perf_evlist__filter_pollfd(struct perf_evlist *evlist, short revents_and_mask); 135int perf_evlist__filter_pollfd(struct evlist *evlist, short revents_and_mask);
136 136
137int perf_evlist__poll(struct perf_evlist *evlist, int timeout); 137int perf_evlist__poll(struct evlist *evlist, int timeout);
138 138
139struct evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id); 139struct evsel *perf_evlist__id2evsel(struct evlist *evlist, u64 id);
140struct evsel *perf_evlist__id2evsel_strict(struct perf_evlist *evlist, 140struct evsel *perf_evlist__id2evsel_strict(struct evlist *evlist,
141 u64 id); 141 u64 id);
142 142
143struct perf_sample_id *perf_evlist__id2sid(struct perf_evlist *evlist, u64 id); 143struct perf_sample_id *perf_evlist__id2sid(struct evlist *evlist, u64 id);
144 144
145void perf_evlist__toggle_bkw_mmap(struct perf_evlist *evlist, enum bkw_mmap_state state); 145void perf_evlist__toggle_bkw_mmap(struct evlist *evlist, enum bkw_mmap_state state);
146 146
147void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx); 147void perf_evlist__mmap_consume(struct evlist *evlist, int idx);
148 148
149int perf_evlist__open(struct perf_evlist *evlist); 149int perf_evlist__open(struct evlist *evlist);
150void perf_evlist__close(struct perf_evlist *evlist); 150void perf_evlist__close(struct evlist *evlist);
151 151
152struct callchain_param; 152struct callchain_param;
153 153
154void perf_evlist__set_id_pos(struct perf_evlist *evlist); 154void perf_evlist__set_id_pos(struct evlist *evlist);
155bool perf_can_sample_identifier(void); 155bool perf_can_sample_identifier(void);
156bool perf_can_record_switch_events(void); 156bool perf_can_record_switch_events(void);
157bool perf_can_record_cpu_wide(void); 157bool perf_can_record_cpu_wide(void);
158void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts, 158void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
159 struct callchain_param *callchain); 159 struct callchain_param *callchain);
160int record_opts__config(struct record_opts *opts); 160int record_opts__config(struct record_opts *opts);
161 161
162int perf_evlist__prepare_workload(struct perf_evlist *evlist, 162int perf_evlist__prepare_workload(struct evlist *evlist,
163 struct target *target, 163 struct target *target,
164 const char *argv[], bool pipe_output, 164 const char *argv[], bool pipe_output,
165 void (*exec_error)(int signo, siginfo_t *info, 165 void (*exec_error)(int signo, siginfo_t *info,
166 void *ucontext)); 166 void *ucontext));
167int perf_evlist__start_workload(struct perf_evlist *evlist); 167int perf_evlist__start_workload(struct evlist *evlist);
168 168
169struct option; 169struct option;
170 170
@@ -175,76 +175,76 @@ int perf_evlist__parse_mmap_pages(const struct option *opt,
175 175
176unsigned long perf_event_mlock_kb_in_pages(void); 176unsigned long perf_event_mlock_kb_in_pages(void);
177 177
178int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, 178int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
179 unsigned int auxtrace_pages, 179 unsigned int auxtrace_pages,
180 bool auxtrace_overwrite, int nr_cblocks, 180 bool auxtrace_overwrite, int nr_cblocks,
181 int affinity, int flush, int comp_level); 181 int affinity, int flush, int comp_level);
182int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages); 182int perf_evlist__mmap(struct evlist *evlist, unsigned int pages);
183void perf_evlist__munmap(struct perf_evlist *evlist); 183void perf_evlist__munmap(struct evlist *evlist);
184 184
185size_t perf_evlist__mmap_size(unsigned long pages); 185size_t perf_evlist__mmap_size(unsigned long pages);
186 186
187void perf_evlist__disable(struct perf_evlist *evlist); 187void perf_evlist__disable(struct evlist *evlist);
188void perf_evlist__enable(struct perf_evlist *evlist); 188void perf_evlist__enable(struct evlist *evlist);
189void perf_evlist__toggle_enable(struct perf_evlist *evlist); 189void perf_evlist__toggle_enable(struct evlist *evlist);
190 190
191int perf_evlist__enable_event_idx(struct perf_evlist *evlist, 191int perf_evlist__enable_event_idx(struct evlist *evlist,
192 struct evsel *evsel, int idx); 192 struct evsel *evsel, int idx);
193 193
194void perf_evlist__set_selected(struct perf_evlist *evlist, 194void perf_evlist__set_selected(struct evlist *evlist,
195 struct evsel *evsel); 195 struct evsel *evsel);
196 196
197void perf_evlist__set_maps(struct perf_evlist *evlist, struct perf_cpu_map *cpus, 197void perf_evlist__set_maps(struct evlist *evlist, struct perf_cpu_map *cpus,
198 struct perf_thread_map *threads); 198 struct perf_thread_map *threads);
199int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target); 199int perf_evlist__create_maps(struct evlist *evlist, struct target *target);
200int perf_evlist__apply_filters(struct perf_evlist *evlist, struct evsel **err_evsel); 200int perf_evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel);
201 201
202void __perf_evlist__set_leader(struct list_head *list); 202void __perf_evlist__set_leader(struct list_head *list);
203void perf_evlist__set_leader(struct perf_evlist *evlist); 203void perf_evlist__set_leader(struct evlist *evlist);
204 204
205u64 perf_evlist__read_format(struct perf_evlist *evlist); 205u64 perf_evlist__read_format(struct evlist *evlist);
206u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist); 206u64 __perf_evlist__combined_sample_type(struct evlist *evlist);
207u64 perf_evlist__combined_sample_type(struct perf_evlist *evlist); 207u64 perf_evlist__combined_sample_type(struct evlist *evlist);
208u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist); 208u64 perf_evlist__combined_branch_type(struct evlist *evlist);
209bool perf_evlist__sample_id_all(struct perf_evlist *evlist); 209bool perf_evlist__sample_id_all(struct evlist *evlist);
210u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist); 210u16 perf_evlist__id_hdr_size(struct evlist *evlist);
211 211
212int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event, 212int perf_evlist__parse_sample(struct evlist *evlist, union perf_event *event,
213 struct perf_sample *sample); 213 struct perf_sample *sample);
214 214
215int perf_evlist__parse_sample_timestamp(struct perf_evlist *evlist, 215int perf_evlist__parse_sample_timestamp(struct evlist *evlist,
216 union perf_event *event, 216 union perf_event *event,
217 u64 *timestamp); 217 u64 *timestamp);
218 218
219bool perf_evlist__valid_sample_type(struct perf_evlist *evlist); 219bool perf_evlist__valid_sample_type(struct evlist *evlist);
220bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist); 220bool perf_evlist__valid_sample_id_all(struct evlist *evlist);
221bool perf_evlist__valid_read_format(struct perf_evlist *evlist); 221bool perf_evlist__valid_read_format(struct evlist *evlist);
222 222
223void perf_evlist__splice_list_tail(struct perf_evlist *evlist, 223void perf_evlist__splice_list_tail(struct evlist *evlist,
224 struct list_head *list); 224 struct list_head *list);
225 225
226static inline bool perf_evlist__empty(struct perf_evlist *evlist) 226static inline bool perf_evlist__empty(struct evlist *evlist)
227{ 227{
228 return list_empty(&evlist->entries); 228 return list_empty(&evlist->entries);
229} 229}
230 230
231static inline struct evsel *perf_evlist__first(struct perf_evlist *evlist) 231static inline struct evsel *perf_evlist__first(struct evlist *evlist)
232{ 232{
233 return list_entry(evlist->entries.next, struct evsel, node); 233 return list_entry(evlist->entries.next, struct evsel, node);
234} 234}
235 235
236static inline struct evsel *perf_evlist__last(struct perf_evlist *evlist) 236static inline struct evsel *perf_evlist__last(struct evlist *evlist)
237{ 237{
238 return list_entry(evlist->entries.prev, struct evsel, node); 238 return list_entry(evlist->entries.prev, struct evsel, node);
239} 239}
240 240
241size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp); 241size_t perf_evlist__fprintf(struct evlist *evlist, FILE *fp);
242 242
243int perf_evlist__strerror_open(struct perf_evlist *evlist, int err, char *buf, size_t size); 243int perf_evlist__strerror_open(struct evlist *evlist, int err, char *buf, size_t size);
244int perf_evlist__strerror_mmap(struct perf_evlist *evlist, int err, char *buf, size_t size); 244int perf_evlist__strerror_mmap(struct evlist *evlist, int err, char *buf, size_t size);
245 245
246bool perf_evlist__can_select_event(struct perf_evlist *evlist, const char *str); 246bool perf_evlist__can_select_event(struct evlist *evlist, const char *str);
247void perf_evlist__to_front(struct perf_evlist *evlist, 247void perf_evlist__to_front(struct evlist *evlist,
248 struct evsel *move_evsel); 248 struct evsel *move_evsel);
249 249
250/** 250/**
@@ -313,19 +313,19 @@ void perf_evlist__to_front(struct perf_evlist *evlist,
313#define evlist__for_each_entry_safe(evlist, tmp, evsel) \ 313#define evlist__for_each_entry_safe(evlist, tmp, evsel) \
314 __evlist__for_each_entry_safe(&(evlist)->entries, tmp, evsel) 314 __evlist__for_each_entry_safe(&(evlist)->entries, tmp, evsel)
315 315
316void perf_evlist__set_tracking_event(struct perf_evlist *evlist, 316void perf_evlist__set_tracking_event(struct evlist *evlist,
317 struct evsel *tracking_evsel); 317 struct evsel *tracking_evsel);
318 318
319struct evsel * 319struct evsel *
320perf_evlist__find_evsel_by_str(struct perf_evlist *evlist, const char *str); 320perf_evlist__find_evsel_by_str(struct evlist *evlist, const char *str);
321 321
322struct evsel *perf_evlist__event2evsel(struct perf_evlist *evlist, 322struct evsel *perf_evlist__event2evsel(struct evlist *evlist,
323 union perf_event *event); 323 union perf_event *event);
324 324
325bool perf_evlist__exclude_kernel(struct perf_evlist *evlist); 325bool perf_evlist__exclude_kernel(struct evlist *evlist);
326 326
327void perf_evlist__force_leader(struct perf_evlist *evlist); 327void perf_evlist__force_leader(struct evlist *evlist);
328 328
329struct evsel *perf_evlist__reset_weak_group(struct perf_evlist *evlist, 329struct evsel *perf_evlist__reset_weak_group(struct evlist *evlist,
330 struct evsel *evsel); 330 struct evsel *evsel);
331#endif /* __PERF_EVLIST_H */ 331#endif /* __PERF_EVLIST_H */
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 44421bbebd64..f7f97ca6e96d 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -3044,7 +3044,7 @@ struct perf_env *perf_evsel__env(struct evsel *evsel)
3044 return NULL; 3044 return NULL;
3045} 3045}
3046 3046
3047static int store_evsel_ids(struct evsel *evsel, struct perf_evlist *evlist) 3047static int store_evsel_ids(struct evsel *evsel, struct evlist *evlist)
3048{ 3048{
3049 int cpu, thread; 3049 int cpu, thread;
3050 3050
@@ -3062,7 +3062,7 @@ static int store_evsel_ids(struct evsel *evsel, struct perf_evlist *evlist)
3062 return 0; 3062 return 0;
3063} 3063}
3064 3064
3065int perf_evsel__store_ids(struct evsel *evsel, struct perf_evlist *evlist) 3065int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist)
3066{ 3066{
3067 struct perf_cpu_map *cpus = evsel->cpus; 3067 struct perf_cpu_map *cpus = evsel->cpus;
3068 struct perf_thread_map *threads = evsel->threads; 3068 struct perf_thread_map *threads = evsel->threads;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 2c31c5e99524..3caabd8a4aa6 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -102,7 +102,7 @@ struct bpf_object;
102 */ 102 */
103struct evsel { 103struct evsel {
104 struct list_head node; 104 struct list_head node;
105 struct perf_evlist *evlist; 105 struct evlist *evlist;
106 struct perf_event_attr attr; 106 struct perf_event_attr attr;
107 char *filter; 107 char *filter;
108 struct xyarray *fd; 108 struct xyarray *fd;
@@ -506,5 +506,5 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
506 506
507struct perf_env *perf_evsel__env(struct evsel *evsel); 507struct perf_env *perf_evsel__env(struct evsel *evsel);
508 508
509int perf_evsel__store_ids(struct evsel *evsel, struct perf_evlist *evlist); 509int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist);
510#endif /* __PERF_EVSEL_H */ 510#endif /* __PERF_EVSEL_H */
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 132bbc29f977..692fe8ac12ae 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -299,7 +299,7 @@ static int do_read_bitmap(struct feat_fd *ff, unsigned long **pset, u64 *psize)
299} 299}
300 300
301static int write_tracing_data(struct feat_fd *ff, 301static int write_tracing_data(struct feat_fd *ff,
302 struct perf_evlist *evlist) 302 struct evlist *evlist)
303{ 303{
304 if (WARN(ff->buf, "Error: calling %s in pipe-mode.\n", __func__)) 304 if (WARN(ff->buf, "Error: calling %s in pipe-mode.\n", __func__))
305 return -1; 305 return -1;
@@ -308,7 +308,7 @@ static int write_tracing_data(struct feat_fd *ff,
308} 308}
309 309
310static int write_build_id(struct feat_fd *ff, 310static int write_build_id(struct feat_fd *ff,
311 struct perf_evlist *evlist __maybe_unused) 311 struct evlist *evlist __maybe_unused)
312{ 312{
313 struct perf_session *session; 313 struct perf_session *session;
314 int err; 314 int err;
@@ -332,7 +332,7 @@ static int write_build_id(struct feat_fd *ff,
332} 332}
333 333
334static int write_hostname(struct feat_fd *ff, 334static int write_hostname(struct feat_fd *ff,
335 struct perf_evlist *evlist __maybe_unused) 335 struct evlist *evlist __maybe_unused)
336{ 336{
337 struct utsname uts; 337 struct utsname uts;
338 int ret; 338 int ret;
@@ -345,7 +345,7 @@ static int write_hostname(struct feat_fd *ff,
345} 345}
346 346
347static int write_osrelease(struct feat_fd *ff, 347static int write_osrelease(struct feat_fd *ff,
348 struct perf_evlist *evlist __maybe_unused) 348 struct evlist *evlist __maybe_unused)
349{ 349{
350 struct utsname uts; 350 struct utsname uts;
351 int ret; 351 int ret;
@@ -358,7 +358,7 @@ static int write_osrelease(struct feat_fd *ff,
358} 358}
359 359
360static int write_arch(struct feat_fd *ff, 360static int write_arch(struct feat_fd *ff,
361 struct perf_evlist *evlist __maybe_unused) 361 struct evlist *evlist __maybe_unused)
362{ 362{
363 struct utsname uts; 363 struct utsname uts;
364 int ret; 364 int ret;
@@ -371,7 +371,7 @@ static int write_arch(struct feat_fd *ff,
371} 371}
372 372
373static int write_version(struct feat_fd *ff, 373static int write_version(struct feat_fd *ff,
374 struct perf_evlist *evlist __maybe_unused) 374 struct evlist *evlist __maybe_unused)
375{ 375{
376 return do_write_string(ff, perf_version_string); 376 return do_write_string(ff, perf_version_string);
377} 377}
@@ -432,7 +432,7 @@ done:
432} 432}
433 433
434static int write_cpudesc(struct feat_fd *ff, 434static int write_cpudesc(struct feat_fd *ff,
435 struct perf_evlist *evlist __maybe_unused) 435 struct evlist *evlist __maybe_unused)
436{ 436{
437 const char *cpuinfo_procs[] = CPUINFO_PROC; 437 const char *cpuinfo_procs[] = CPUINFO_PROC;
438 unsigned int i; 438 unsigned int i;
@@ -448,7 +448,7 @@ static int write_cpudesc(struct feat_fd *ff,
448 448
449 449
450static int write_nrcpus(struct feat_fd *ff, 450static int write_nrcpus(struct feat_fd *ff,
451 struct perf_evlist *evlist __maybe_unused) 451 struct evlist *evlist __maybe_unused)
452{ 452{
453 long nr; 453 long nr;
454 u32 nrc, nra; 454 u32 nrc, nra;
@@ -470,7 +470,7 @@ static int write_nrcpus(struct feat_fd *ff,
470} 470}
471 471
472static int write_event_desc(struct feat_fd *ff, 472static int write_event_desc(struct feat_fd *ff,
473 struct perf_evlist *evlist) 473 struct evlist *evlist)
474{ 474{
475 struct evsel *evsel; 475 struct evsel *evsel;
476 u32 nre, nri, sz; 476 u32 nre, nri, sz;
@@ -526,7 +526,7 @@ static int write_event_desc(struct feat_fd *ff,
526} 526}
527 527
528static int write_cmdline(struct feat_fd *ff, 528static int write_cmdline(struct feat_fd *ff,
529 struct perf_evlist *evlist __maybe_unused) 529 struct evlist *evlist __maybe_unused)
530{ 530{
531 char pbuf[MAXPATHLEN], *buf; 531 char pbuf[MAXPATHLEN], *buf;
532 int i, ret, n; 532 int i, ret, n;
@@ -555,7 +555,7 @@ static int write_cmdline(struct feat_fd *ff,
555 555
556 556
557static int write_cpu_topology(struct feat_fd *ff, 557static int write_cpu_topology(struct feat_fd *ff,
558 struct perf_evlist *evlist __maybe_unused) 558 struct evlist *evlist __maybe_unused)
559{ 559{
560 struct cpu_topology *tp; 560 struct cpu_topology *tp;
561 u32 i; 561 u32 i;
@@ -627,7 +627,7 @@ done:
627 627
628 628
629static int write_total_mem(struct feat_fd *ff, 629static int write_total_mem(struct feat_fd *ff,
630 struct perf_evlist *evlist __maybe_unused) 630 struct evlist *evlist __maybe_unused)
631{ 631{
632 char *buf = NULL; 632 char *buf = NULL;
633 FILE *fp; 633 FILE *fp;
@@ -656,7 +656,7 @@ static int write_total_mem(struct feat_fd *ff,
656} 656}
657 657
658static int write_numa_topology(struct feat_fd *ff, 658static int write_numa_topology(struct feat_fd *ff,
659 struct perf_evlist *evlist __maybe_unused) 659 struct evlist *evlist __maybe_unused)
660{ 660{
661 struct numa_topology *tp; 661 struct numa_topology *tp;
662 int ret = -1; 662 int ret = -1;
@@ -710,7 +710,7 @@ err:
710 */ 710 */
711 711
712static int write_pmu_mappings(struct feat_fd *ff, 712static int write_pmu_mappings(struct feat_fd *ff,
713 struct perf_evlist *evlist __maybe_unused) 713 struct evlist *evlist __maybe_unused)
714{ 714{
715 struct perf_pmu *pmu = NULL; 715 struct perf_pmu *pmu = NULL;
716 u32 pmu_num = 0; 716 u32 pmu_num = 0;
@@ -759,7 +759,7 @@ static int write_pmu_mappings(struct feat_fd *ff,
759 * }; 759 * };
760 */ 760 */
761static int write_group_desc(struct feat_fd *ff, 761static int write_group_desc(struct feat_fd *ff,
762 struct perf_evlist *evlist) 762 struct evlist *evlist)
763{ 763{
764 u32 nr_groups = evlist->nr_groups; 764 u32 nr_groups = evlist->nr_groups;
765 struct evsel *evsel; 765 struct evsel *evsel;
@@ -841,7 +841,7 @@ int __weak get_cpuid(char *buffer __maybe_unused, size_t sz __maybe_unused)
841} 841}
842 842
843static int write_cpuid(struct feat_fd *ff, 843static int write_cpuid(struct feat_fd *ff,
844 struct perf_evlist *evlist __maybe_unused) 844 struct evlist *evlist __maybe_unused)
845{ 845{
846 char buffer[64]; 846 char buffer[64];
847 int ret; 847 int ret;
@@ -854,13 +854,13 @@ static int write_cpuid(struct feat_fd *ff,
854} 854}
855 855
856static int write_branch_stack(struct feat_fd *ff __maybe_unused, 856static int write_branch_stack(struct feat_fd *ff __maybe_unused,
857 struct perf_evlist *evlist __maybe_unused) 857 struct evlist *evlist __maybe_unused)
858{ 858{
859 return 0; 859 return 0;
860} 860}
861 861
862static int write_auxtrace(struct feat_fd *ff, 862static int write_auxtrace(struct feat_fd *ff,
863 struct perf_evlist *evlist __maybe_unused) 863 struct evlist *evlist __maybe_unused)
864{ 864{
865 struct perf_session *session; 865 struct perf_session *session;
866 int err; 866 int err;
@@ -877,14 +877,14 @@ static int write_auxtrace(struct feat_fd *ff,
877} 877}
878 878
879static int write_clockid(struct feat_fd *ff, 879static int write_clockid(struct feat_fd *ff,
880 struct perf_evlist *evlist __maybe_unused) 880 struct evlist *evlist __maybe_unused)
881{ 881{
882 return do_write(ff, &ff->ph->env.clockid_res_ns, 882 return do_write(ff, &ff->ph->env.clockid_res_ns,
883 sizeof(ff->ph->env.clockid_res_ns)); 883 sizeof(ff->ph->env.clockid_res_ns));
884} 884}
885 885
886static int write_dir_format(struct feat_fd *ff, 886static int write_dir_format(struct feat_fd *ff,
887 struct perf_evlist *evlist __maybe_unused) 887 struct evlist *evlist __maybe_unused)
888{ 888{
889 struct perf_session *session; 889 struct perf_session *session;
890 struct perf_data *data; 890 struct perf_data *data;
@@ -900,7 +900,7 @@ static int write_dir_format(struct feat_fd *ff,
900 900
901#ifdef HAVE_LIBBPF_SUPPORT 901#ifdef HAVE_LIBBPF_SUPPORT
902static int write_bpf_prog_info(struct feat_fd *ff, 902static int write_bpf_prog_info(struct feat_fd *ff,
903 struct perf_evlist *evlist __maybe_unused) 903 struct evlist *evlist __maybe_unused)
904{ 904{
905 struct perf_env *env = &ff->ph->env; 905 struct perf_env *env = &ff->ph->env;
906 struct rb_root *root; 906 struct rb_root *root;
@@ -942,14 +942,14 @@ out:
942} 942}
943#else // HAVE_LIBBPF_SUPPORT 943#else // HAVE_LIBBPF_SUPPORT
944static int write_bpf_prog_info(struct feat_fd *ff __maybe_unused, 944static int write_bpf_prog_info(struct feat_fd *ff __maybe_unused,
945 struct perf_evlist *evlist __maybe_unused) 945 struct evlist *evlist __maybe_unused)
946{ 946{
947 return 0; 947 return 0;
948} 948}
949#endif // HAVE_LIBBPF_SUPPORT 949#endif // HAVE_LIBBPF_SUPPORT
950 950
951static int write_bpf_btf(struct feat_fd *ff, 951static int write_bpf_btf(struct feat_fd *ff,
952 struct perf_evlist *evlist __maybe_unused) 952 struct evlist *evlist __maybe_unused)
953{ 953{
954 struct perf_env *env = &ff->ph->env; 954 struct perf_env *env = &ff->ph->env;
955 struct rb_root *root; 955 struct rb_root *root;
@@ -1123,7 +1123,7 @@ static int build_caches(struct cpu_cache_level caches[], u32 size, u32 *cntp)
1123#define MAX_CACHES (MAX_NR_CPUS * 4) 1123#define MAX_CACHES (MAX_NR_CPUS * 4)
1124 1124
1125static int write_cache(struct feat_fd *ff, 1125static int write_cache(struct feat_fd *ff,
1126 struct perf_evlist *evlist __maybe_unused) 1126 struct evlist *evlist __maybe_unused)
1127{ 1127{
1128 struct cpu_cache_level caches[MAX_CACHES]; 1128 struct cpu_cache_level caches[MAX_CACHES];
1129 u32 cnt = 0, i, version = 1; 1129 u32 cnt = 0, i, version = 1;
@@ -1175,13 +1175,13 @@ out:
1175} 1175}
1176 1176
1177static int write_stat(struct feat_fd *ff __maybe_unused, 1177static int write_stat(struct feat_fd *ff __maybe_unused,
1178 struct perf_evlist *evlist __maybe_unused) 1178 struct evlist *evlist __maybe_unused)
1179{ 1179{
1180 return 0; 1180 return 0;
1181} 1181}
1182 1182
1183static int write_sample_time(struct feat_fd *ff, 1183static int write_sample_time(struct feat_fd *ff,
1184 struct perf_evlist *evlist) 1184 struct evlist *evlist)
1185{ 1185{
1186 int ret; 1186 int ret;
1187 1187
@@ -1315,7 +1315,7 @@ static int build_mem_topology(struct memory_node *nodes, u64 size, u64 *cntp)
1315 * 48 - bitmap | bitmap of memory indexes that belongs to node 1315 * 48 - bitmap | bitmap of memory indexes that belongs to node
1316 */ 1316 */
1317static int write_mem_topology(struct feat_fd *ff __maybe_unused, 1317static int write_mem_topology(struct feat_fd *ff __maybe_unused,
1318 struct perf_evlist *evlist __maybe_unused) 1318 struct evlist *evlist __maybe_unused)
1319{ 1319{
1320 static struct memory_node nodes[MAX_MEMORY_NODES]; 1320 static struct memory_node nodes[MAX_MEMORY_NODES];
1321 u64 bsize, version = 1, i, nr; 1321 u64 bsize, version = 1, i, nr;
@@ -1365,7 +1365,7 @@ out:
1365} 1365}
1366 1366
1367static int write_compressed(struct feat_fd *ff __maybe_unused, 1367static int write_compressed(struct feat_fd *ff __maybe_unused,
1368 struct perf_evlist *evlist __maybe_unused) 1368 struct evlist *evlist __maybe_unused)
1369{ 1369{
1370 int ret; 1370 int ret;
1371 1371
@@ -2090,7 +2090,7 @@ static int process_total_mem(struct feat_fd *ff, void *data __maybe_unused)
2090} 2090}
2091 2091
2092static struct evsel * 2092static struct evsel *
2093perf_evlist__find_by_index(struct perf_evlist *evlist, int idx) 2093perf_evlist__find_by_index(struct evlist *evlist, int idx)
2094{ 2094{
2095 struct evsel *evsel; 2095 struct evsel *evsel;
2096 2096
@@ -2103,7 +2103,7 @@ perf_evlist__find_by_index(struct perf_evlist *evlist, int idx)
2103} 2103}
2104 2104
2105static void 2105static void
2106perf_evlist__set_event_name(struct perf_evlist *evlist, 2106perf_evlist__set_event_name(struct evlist *evlist,
2107 struct evsel *event) 2107 struct evsel *event)
2108{ 2108{
2109 struct evsel *evsel; 2109 struct evsel *evsel;
@@ -2801,7 +2801,7 @@ static int process_compressed(struct feat_fd *ff,
2801} 2801}
2802 2802
2803struct feature_ops { 2803struct feature_ops {
2804 int (*write)(struct feat_fd *ff, struct perf_evlist *evlist); 2804 int (*write)(struct feat_fd *ff, struct evlist *evlist);
2805 void (*print)(struct feat_fd *ff, FILE *fp); 2805 void (*print)(struct feat_fd *ff, FILE *fp);
2806 int (*process)(struct feat_fd *ff, void *data); 2806 int (*process)(struct feat_fd *ff, void *data);
2807 const char *name; 2807 const char *name;
@@ -2946,7 +2946,7 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full)
2946 2946
2947static int do_write_feat(struct feat_fd *ff, int type, 2947static int do_write_feat(struct feat_fd *ff, int type,
2948 struct perf_file_section **p, 2948 struct perf_file_section **p,
2949 struct perf_evlist *evlist) 2949 struct evlist *evlist)
2950{ 2950{
2951 int err; 2951 int err;
2952 int ret = 0; 2952 int ret = 0;
@@ -2976,7 +2976,7 @@ static int do_write_feat(struct feat_fd *ff, int type,
2976} 2976}
2977 2977
2978static int perf_header__adds_write(struct perf_header *header, 2978static int perf_header__adds_write(struct perf_header *header,
2979 struct perf_evlist *evlist, int fd) 2979 struct evlist *evlist, int fd)
2980{ 2980{
2981 int nr_sections; 2981 int nr_sections;
2982 struct feat_fd ff; 2982 struct feat_fd ff;
@@ -3044,7 +3044,7 @@ int perf_header__write_pipe(int fd)
3044} 3044}
3045 3045
3046int perf_session__write_header(struct perf_session *session, 3046int perf_session__write_header(struct perf_session *session,
3047 struct perf_evlist *evlist, 3047 struct evlist *evlist,
3048 int fd, bool at_exit) 3048 int fd, bool at_exit)
3049{ 3049{
3050 struct perf_file_header f_header; 3050 struct perf_file_header f_header;
@@ -3511,7 +3511,7 @@ static int perf_evsel__prepare_tracepoint_event(struct evsel *evsel,
3511 return 0; 3511 return 0;
3512} 3512}
3513 3513
3514static int perf_evlist__prepare_tracepoint_events(struct perf_evlist *evlist, 3514static int perf_evlist__prepare_tracepoint_events(struct evlist *evlist,
3515 struct tep_handle *pevent) 3515 struct tep_handle *pevent)
3516{ 3516{
3517 struct evsel *pos; 3517 struct evsel *pos;
@@ -3669,7 +3669,7 @@ int perf_event__synthesize_attr(struct perf_tool *tool,
3669 3669
3670int perf_event__synthesize_features(struct perf_tool *tool, 3670int perf_event__synthesize_features(struct perf_tool *tool,
3671 struct perf_session *session, 3671 struct perf_session *session,
3672 struct perf_evlist *evlist, 3672 struct evlist *evlist,
3673 perf_event__handler_t process) 3673 perf_event__handler_t process)
3674{ 3674{
3675 struct perf_header *header = &session->header; 3675 struct perf_header *header = &session->header;
@@ -3921,7 +3921,7 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)
3921} 3921}
3922 3922
3923int perf_event__synthesize_attrs(struct perf_tool *tool, 3923int perf_event__synthesize_attrs(struct perf_tool *tool,
3924 struct perf_evlist *evlist, 3924 struct evlist *evlist,
3925 perf_event__handler_t process) 3925 perf_event__handler_t process)
3926{ 3926{
3927 struct evsel *evsel; 3927 struct evsel *evsel;
@@ -3950,7 +3950,7 @@ static bool has_scale(struct evsel *counter)
3950} 3950}
3951 3951
3952int perf_event__synthesize_extra_attr(struct perf_tool *tool, 3952int perf_event__synthesize_extra_attr(struct perf_tool *tool,
3953 struct perf_evlist *evsel_list, 3953 struct evlist *evsel_list,
3954 perf_event__handler_t process, 3954 perf_event__handler_t process,
3955 bool is_pipe) 3955 bool is_pipe)
3956{ 3956{
@@ -4009,11 +4009,11 @@ int perf_event__synthesize_extra_attr(struct perf_tool *tool,
4009 4009
4010int perf_event__process_attr(struct perf_tool *tool __maybe_unused, 4010int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
4011 union perf_event *event, 4011 union perf_event *event,
4012 struct perf_evlist **pevlist) 4012 struct evlist **pevlist)
4013{ 4013{
4014 u32 i, ids, n_ids; 4014 u32 i, ids, n_ids;
4015 struct evsel *evsel; 4015 struct evsel *evsel;
4016 struct perf_evlist *evlist = *pevlist; 4016 struct evlist *evlist = *pevlist;
4017 4017
4018 if (evlist == NULL) { 4018 if (evlist == NULL) {
4019 *pevlist = evlist = perf_evlist__new(); 4019 *pevlist = evlist = perf_evlist__new();
@@ -4047,12 +4047,12 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
4047 4047
4048int perf_event__process_event_update(struct perf_tool *tool __maybe_unused, 4048int perf_event__process_event_update(struct perf_tool *tool __maybe_unused,
4049 union perf_event *event, 4049 union perf_event *event,
4050 struct perf_evlist **pevlist) 4050 struct evlist **pevlist)
4051{ 4051{
4052 struct event_update_event *ev = &event->event_update; 4052 struct event_update_event *ev = &event->event_update;
4053 struct event_update_event_scale *ev_scale; 4053 struct event_update_event_scale *ev_scale;
4054 struct event_update_event_cpus *ev_cpus; 4054 struct event_update_event_cpus *ev_cpus;
4055 struct perf_evlist *evlist; 4055 struct evlist *evlist;
4056 struct evsel *evsel; 4056 struct evsel *evsel;
4057 struct perf_cpu_map *map; 4057 struct perf_cpu_map *map;
4058 4058
@@ -4092,7 +4092,7 @@ int perf_event__process_event_update(struct perf_tool *tool __maybe_unused,
4092} 4092}
4093 4093
4094int perf_event__synthesize_tracing_data(struct perf_tool *tool, int fd, 4094int perf_event__synthesize_tracing_data(struct perf_tool *tool, int fd,
4095 struct perf_evlist *evlist, 4095 struct evlist *evlist,
4096 perf_event__handler_t process) 4096 perf_event__handler_t process)
4097{ 4097{
4098 union perf_event ev; 4098 union perf_event ev;
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 437d8617de27..3e48ae3c49b1 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -92,12 +92,12 @@ struct perf_header {
92 struct perf_env env; 92 struct perf_env env;
93}; 93};
94 94
95struct perf_evlist; 95struct evlist;
96struct perf_session; 96struct perf_session;
97 97
98int perf_session__read_header(struct perf_session *session); 98int perf_session__read_header(struct perf_session *session);
99int perf_session__write_header(struct perf_session *session, 99int perf_session__write_header(struct perf_session *session,
100 struct perf_evlist *evlist, 100 struct evlist *evlist,
101 int fd, bool at_exit); 101 int fd, bool at_exit);
102int perf_header__write_pipe(int fd); 102int perf_header__write_pipe(int fd);
103 103
@@ -117,11 +117,11 @@ int perf_header__fprintf_info(struct perf_session *s, FILE *fp, bool full);
117 117
118int perf_event__synthesize_features(struct perf_tool *tool, 118int perf_event__synthesize_features(struct perf_tool *tool,
119 struct perf_session *session, 119 struct perf_session *session,
120 struct perf_evlist *evlist, 120 struct evlist *evlist,
121 perf_event__handler_t process); 121 perf_event__handler_t process);
122 122
123int perf_event__synthesize_extra_attr(struct perf_tool *tool, 123int perf_event__synthesize_extra_attr(struct perf_tool *tool,
124 struct perf_evlist *evsel_list, 124 struct evlist *evsel_list,
125 perf_event__handler_t process, 125 perf_event__handler_t process,
126 bool is_pipe); 126 bool is_pipe);
127 127
@@ -132,7 +132,7 @@ int perf_event__synthesize_attr(struct perf_tool *tool,
132 struct perf_event_attr *attr, u32 ids, u64 *id, 132 struct perf_event_attr *attr, u32 ids, u64 *id,
133 perf_event__handler_t process); 133 perf_event__handler_t process);
134int perf_event__synthesize_attrs(struct perf_tool *tool, 134int perf_event__synthesize_attrs(struct perf_tool *tool,
135 struct perf_evlist *evlist, 135 struct evlist *evlist,
136 perf_event__handler_t process); 136 perf_event__handler_t process);
137int perf_event__synthesize_event_update_unit(struct perf_tool *tool, 137int perf_event__synthesize_event_update_unit(struct perf_tool *tool,
138 struct evsel *evsel, 138 struct evsel *evsel,
@@ -147,14 +147,14 @@ int perf_event__synthesize_event_update_cpus(struct perf_tool *tool,
147 struct evsel *evsel, 147 struct evsel *evsel,
148 perf_event__handler_t process); 148 perf_event__handler_t process);
149int perf_event__process_attr(struct perf_tool *tool, union perf_event *event, 149int perf_event__process_attr(struct perf_tool *tool, union perf_event *event,
150 struct perf_evlist **pevlist); 150 struct evlist **pevlist);
151int perf_event__process_event_update(struct perf_tool *tool, 151int perf_event__process_event_update(struct perf_tool *tool,
152 union perf_event *event, 152 union perf_event *event,
153 struct perf_evlist **pevlist); 153 struct evlist **pevlist);
154size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp); 154size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp);
155 155
156int perf_event__synthesize_tracing_data(struct perf_tool *tool, 156int perf_event__synthesize_tracing_data(struct perf_tool *tool,
157 int fd, struct perf_evlist *evlist, 157 int fd, struct evlist *evlist,
158 perf_event__handler_t process); 158 perf_event__handler_t process);
159int perf_event__process_tracing_data(struct perf_session *session, 159int perf_event__process_tracing_data(struct perf_session *session,
160 union perf_event *event); 160 union perf_event *event);
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 3da49c479880..bb5437f549b6 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -2573,7 +2573,7 @@ void hist__account_cycles(struct branch_stack *bs, struct addr_location *al,
2573 } 2573 }
2574} 2574}
2575 2575
2576size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp) 2576size_t perf_evlist__fprintf_nr_events(struct evlist *evlist, FILE *fp)
2577{ 2577{
2578 struct evsel *pos; 2578 struct evsel *pos;
2579 size_t ret = 0; 2579 size_t ret = 0;
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 9bf247c638b8..83d5fc15429c 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -196,7 +196,7 @@ size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
196size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, 196size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
197 int max_cols, float min_pcnt, FILE *fp, 197 int max_cols, float min_pcnt, FILE *fp,
198 bool ignore_callchains); 198 bool ignore_callchains);
199size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp); 199size_t perf_evlist__fprintf_nr_events(struct evlist *evlist, FILE *fp);
200 200
201void hists__filter_by_dso(struct hists *hists); 201void hists__filter_by_dso(struct hists *hists);
202void hists__filter_by_thread(struct hists *hists); 202void hists__filter_by_thread(struct hists *hists);
@@ -367,7 +367,7 @@ void perf_hpp__setup_output_field(struct perf_hpp_list *list);
367void perf_hpp__reset_output_field(struct perf_hpp_list *list); 367void perf_hpp__reset_output_field(struct perf_hpp_list *list);
368void perf_hpp__append_sort_keys(struct perf_hpp_list *list); 368void perf_hpp__append_sort_keys(struct perf_hpp_list *list);
369int perf_hpp__setup_hists_formats(struct perf_hpp_list *list, 369int perf_hpp__setup_hists_formats(struct perf_hpp_list *list,
370 struct perf_evlist *evlist); 370 struct evlist *evlist);
371 371
372 372
373bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format); 373bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format);
@@ -432,7 +432,7 @@ static inline size_t perf_hpp__color_overhead(void)
432 : 0; 432 : 0;
433} 433}
434 434
435struct perf_evlist; 435struct evlist;
436 436
437struct hist_browser_timer { 437struct hist_browser_timer {
438 void (*timer)(void *arg); 438 void (*timer)(void *arg);
@@ -461,7 +461,7 @@ int hist_entry__tui_annotate(struct hist_entry *he, struct evsel *evsel,
461 struct hist_browser_timer *hbt, 461 struct hist_browser_timer *hbt,
462 struct annotation_options *annotation_opts); 462 struct annotation_options *annotation_opts);
463 463
464int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, 464int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
465 struct hist_browser_timer *hbt, 465 struct hist_browser_timer *hbt,
466 float min_pcnt, 466 float min_pcnt,
467 struct perf_env *env, 467 struct perf_env *env,
@@ -476,7 +476,7 @@ int res_sample_browse(struct res_sample *res_samples, int num_res,
476void res_sample_init(void); 476void res_sample_init(void);
477#else 477#else
478static inline 478static inline
479int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, 479int perf_evlist__tui_browse_hists(struct evlist *evlist __maybe_unused,
480 const char *help __maybe_unused, 480 const char *help __maybe_unused,
481 struct hist_browser_timer *hbt __maybe_unused, 481 struct hist_browser_timer *hbt __maybe_unused,
482 float min_pcnt __maybe_unused, 482 float min_pcnt __maybe_unused,
diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c
index 8fd46d5f4b39..849a5b713b04 100644
--- a/tools/perf/util/intel-bts.c
+++ b/tools/perf/util/intel-bts.c
@@ -760,7 +760,7 @@ static int intel_bts_synth_event(struct perf_session *session,
760static int intel_bts_synth_events(struct intel_bts *bts, 760static int intel_bts_synth_events(struct intel_bts *bts,
761 struct perf_session *session) 761 struct perf_session *session)
762{ 762{
763 struct perf_evlist *evlist = session->evlist; 763 struct evlist *evlist = session->evlist;
764 struct evsel *evsel; 764 struct evsel *evsel;
765 struct perf_event_attr attr; 765 struct perf_event_attr attr;
766 bool found = false; 766 bool found = false;
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index f1595b86d7c7..c88e3d1ee9c7 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2713,7 +2713,7 @@ static int intel_pt_synth_event(struct perf_session *session, const char *name,
2713 return err; 2713 return err;
2714} 2714}
2715 2715
2716static void intel_pt_set_event_name(struct perf_evlist *evlist, u64 id, 2716static void intel_pt_set_event_name(struct evlist *evlist, u64 id,
2717 const char *name) 2717 const char *name)
2718{ 2718{
2719 struct evsel *evsel; 2719 struct evsel *evsel;
@@ -2729,7 +2729,7 @@ static void intel_pt_set_event_name(struct perf_evlist *evlist, u64 id,
2729} 2729}
2730 2730
2731static struct evsel *intel_pt_evsel(struct intel_pt *pt, 2731static struct evsel *intel_pt_evsel(struct intel_pt *pt,
2732 struct perf_evlist *evlist) 2732 struct evlist *evlist)
2733{ 2733{
2734 struct evsel *evsel; 2734 struct evsel *evsel;
2735 2735
@@ -2744,7 +2744,7 @@ static struct evsel *intel_pt_evsel(struct intel_pt *pt,
2744static int intel_pt_synth_events(struct intel_pt *pt, 2744static int intel_pt_synth_events(struct intel_pt *pt,
2745 struct perf_session *session) 2745 struct perf_session *session)
2746{ 2746{
2747 struct perf_evlist *evlist = session->evlist; 2747 struct evlist *evlist = session->evlist;
2748 struct evsel *evsel = intel_pt_evsel(pt, evlist); 2748 struct evsel *evsel = intel_pt_evsel(pt, evlist);
2749 struct perf_event_attr attr; 2749 struct perf_event_attr attr;
2750 u64 id; 2750 u64 id;
@@ -2894,7 +2894,7 @@ static int intel_pt_synth_events(struct intel_pt *pt,
2894 return 0; 2894 return 0;
2895} 2895}
2896 2896
2897static struct evsel *intel_pt_find_sched_switch(struct perf_evlist *evlist) 2897static struct evsel *intel_pt_find_sched_switch(struct evlist *evlist)
2898{ 2898{
2899 struct evsel *evsel; 2899 struct evsel *evsel;
2900 2900
@@ -2908,7 +2908,7 @@ static struct evsel *intel_pt_find_sched_switch(struct perf_evlist *evlist)
2908 return NULL; 2908 return NULL;
2909} 2909}
2910 2910
2911static bool intel_pt_find_switch(struct perf_evlist *evlist) 2911static bool intel_pt_find_switch(struct evlist *evlist)
2912{ 2912{
2913 struct evsel *evsel; 2913 struct evsel *evsel;
2914 2914
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h
index 299edd32d3d4..a09c495f866b 100644
--- a/tools/perf/util/kvm-stat.h
+++ b/tools/perf/util/kvm-stat.h
@@ -7,7 +7,7 @@
7#include "stat.h" 7#include "stat.h"
8 8
9struct evsel; 9struct evsel;
10struct perf_evlist; 10struct evlist;
11struct perf_session; 11struct perf_session;
12 12
13struct event_key { 13struct event_key {
@@ -74,7 +74,7 @@ struct exit_reasons_table {
74struct perf_kvm_stat { 74struct perf_kvm_stat {
75 struct perf_tool tool; 75 struct perf_tool tool;
76 struct record_opts opts; 76 struct record_opts opts;
77 struct perf_evlist *evlist; 77 struct evlist *evlist;
78 struct perf_session *session; 78 struct perf_session *session;
79 79
80 const char *file_name; 80 const char *file_name;
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 14c423974d63..fdb0d1c5c5cf 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -101,7 +101,7 @@ static bool record_evsel(int *ind, struct evsel **start,
101 return false; 101 return false;
102} 102}
103 103
104static struct evsel *find_evsel_group(struct perf_evlist *perf_evlist, 104static struct evsel *find_evsel_group(struct evlist *perf_evlist,
105 const char **ids, 105 const char **ids,
106 int idnum, 106 int idnum,
107 struct evsel **metric_events) 107 struct evsel **metric_events)
@@ -140,7 +140,7 @@ static struct evsel *find_evsel_group(struct perf_evlist *perf_evlist,
140} 140}
141 141
142static int metricgroup__setup_events(struct list_head *groups, 142static int metricgroup__setup_events(struct list_head *groups,
143 struct perf_evlist *perf_evlist, 143 struct evlist *perf_evlist,
144 struct rblist *metric_events_list) 144 struct rblist *metric_events_list)
145{ 145{
146 struct metric_event *me; 146 struct metric_event *me;
@@ -502,7 +502,7 @@ int metricgroup__parse_groups(const struct option *opt,
502 struct rblist *metric_events) 502 struct rblist *metric_events)
503{ 503{
504 struct parse_events_error parse_error; 504 struct parse_events_error parse_error;
505 struct perf_evlist *perf_evlist = *(struct perf_evlist **)opt->value; 505 struct evlist *perf_evlist = *(struct evlist **)opt->value;
506 struct strbuf extra_events; 506 struct strbuf extra_events;
507 LIST_HEAD(group_list); 507 LIST_HEAD(group_list);
508 int ret; 508 int ret;
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 177c41fc9842..42a5971146ae 100644
--- a/tools/perf/util/mmap.c
+++ b/tools/perf/util/mmap.c
@@ -150,7 +150,7 @@ void __weak auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp __maybe_u
150} 150}
151 151
152void __weak auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp __maybe_unused, 152void __weak auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp __maybe_unused,
153 struct perf_evlist *evlist __maybe_unused, 153 struct evlist *evlist __maybe_unused,
154 int idx __maybe_unused, 154 int idx __maybe_unused,
155 bool per_cpu __maybe_unused) 155 bool per_cpu __maybe_unused)
156{ 156{
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index dfde9cb31562..d341b11fb141 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1904,7 +1904,7 @@ int parse_events_terms(struct list_head *terms, const char *str)
1904 return ret; 1904 return ret;
1905} 1905}
1906 1906
1907int parse_events(struct perf_evlist *evlist, const char *str, 1907int parse_events(struct evlist *evlist, const char *str,
1908 struct parse_events_error *err) 1908 struct parse_events_error *err)
1909{ 1909{
1910 struct parse_events_state parse_state = { 1910 struct parse_events_state parse_state = {
@@ -2013,7 +2013,7 @@ void parse_events_print_error(struct parse_events_error *err,
2013int parse_events_option(const struct option *opt, const char *str, 2013int parse_events_option(const struct option *opt, const char *str,
2014 int unset __maybe_unused) 2014 int unset __maybe_unused)
2015{ 2015{
2016 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; 2016 struct evlist *evlist = *(struct evlist **)opt->value;
2017 struct parse_events_error err = { .idx = 0, }; 2017 struct parse_events_error err = { .idx = 0, };
2018 int ret = parse_events(evlist, str, &err); 2018 int ret = parse_events(evlist, str, &err);
2019 2019
@@ -2026,7 +2026,7 @@ int parse_events_option(const struct option *opt, const char *str,
2026} 2026}
2027 2027
2028static int 2028static int
2029foreach_evsel_in_last_glob(struct perf_evlist *evlist, 2029foreach_evsel_in_last_glob(struct evlist *evlist,
2030 int (*func)(struct evsel *evsel, 2030 int (*func)(struct evsel *evsel,
2031 const void *arg), 2031 const void *arg),
2032 const void *arg) 2032 const void *arg)
@@ -2109,7 +2109,7 @@ static int set_filter(struct evsel *evsel, const void *arg)
2109int parse_filter(const struct option *opt, const char *str, 2109int parse_filter(const struct option *opt, const char *str,
2110 int unset __maybe_unused) 2110 int unset __maybe_unused)
2111{ 2111{
2112 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; 2112 struct evlist *evlist = *(struct evlist **)opt->value;
2113 2113
2114 return foreach_evsel_in_last_glob(evlist, set_filter, 2114 return foreach_evsel_in_last_glob(evlist, set_filter,
2115 (const void *)str); 2115 (const void *)str);
@@ -2141,7 +2141,7 @@ int exclude_perf(const struct option *opt,
2141 const char *arg __maybe_unused, 2141 const char *arg __maybe_unused,
2142 int unset __maybe_unused) 2142 int unset __maybe_unused)
2143{ 2143{
2144 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; 2144 struct evlist *evlist = *(struct evlist **)opt->value;
2145 2145
2146 return foreach_evsel_in_last_glob(evlist, add_exclude_perf_filter, 2146 return foreach_evsel_in_last_glob(evlist, add_exclude_perf_filter,
2147 NULL); 2147 NULL);
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index 99e206598b60..48111b8fc232 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -13,7 +13,7 @@
13 13
14struct list_head; 14struct list_head;
15struct evsel; 15struct evsel;
16struct perf_evlist; 16struct evlist;
17struct parse_events_error; 17struct parse_events_error;
18 18
19struct option; 19struct option;
@@ -31,7 +31,7 @@ bool have_tracepoints(struct list_head *evlist);
31const char *event_type(int type); 31const char *event_type(int type);
32 32
33int parse_events_option(const struct option *opt, const char *str, int unset); 33int parse_events_option(const struct option *opt, const char *str, int unset);
34int parse_events(struct perf_evlist *evlist, const char *str, 34int parse_events(struct evlist *evlist, const char *str,
35 struct parse_events_error *error); 35 struct parse_events_error *error);
36int parse_events_terms(struct list_head *terms, const char *str); 36int parse_events_terms(struct list_head *terms, const char *str);
37int parse_filter(const struct option *opt, const char *str, int unset); 37int parse_filter(const struct option *opt, const char *str, int unset);
@@ -119,7 +119,7 @@ struct parse_events_state {
119 int idx; 119 int idx;
120 int nr_groups; 120 int nr_groups;
121 struct parse_events_error *error; 121 struct parse_events_error *error;
122 struct perf_evlist *evlist; 122 struct evlist *evlist;
123 struct list_head *terms; 123 struct list_head *terms;
124}; 124};
125 125
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index beafbd469b0c..ed57b6b5ed91 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -858,7 +858,7 @@ static int pyrf_evsel__setup_types(void)
858struct pyrf_evlist { 858struct pyrf_evlist {
859 PyObject_HEAD 859 PyObject_HEAD
860 860
861 struct perf_evlist evlist; 861 struct evlist evlist;
862}; 862};
863 863
864static int pyrf_evlist__init(struct pyrf_evlist *pevlist, 864static int pyrf_evlist__init(struct pyrf_evlist *pevlist,
@@ -886,7 +886,7 @@ static void pyrf_evlist__delete(struct pyrf_evlist *pevlist)
886static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist, 886static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
887 PyObject *args, PyObject *kwargs) 887 PyObject *args, PyObject *kwargs)
888{ 888{
889 struct perf_evlist *evlist = &pevlist->evlist; 889 struct evlist *evlist = &pevlist->evlist;
890 static char *kwlist[] = { "pages", "overwrite", NULL }; 890 static char *kwlist[] = { "pages", "overwrite", NULL };
891 int pages = 128, overwrite = false; 891 int pages = 128, overwrite = false;
892 892
@@ -906,7 +906,7 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
906static PyObject *pyrf_evlist__poll(struct pyrf_evlist *pevlist, 906static PyObject *pyrf_evlist__poll(struct pyrf_evlist *pevlist,
907 PyObject *args, PyObject *kwargs) 907 PyObject *args, PyObject *kwargs)
908{ 908{
909 struct perf_evlist *evlist = &pevlist->evlist; 909 struct evlist *evlist = &pevlist->evlist;
910 static char *kwlist[] = { "timeout", NULL }; 910 static char *kwlist[] = { "timeout", NULL };
911 int timeout = -1, n; 911 int timeout = -1, n;
912 912
@@ -926,7 +926,7 @@ static PyObject *pyrf_evlist__get_pollfd(struct pyrf_evlist *pevlist,
926 PyObject *args __maybe_unused, 926 PyObject *args __maybe_unused,
927 PyObject *kwargs __maybe_unused) 927 PyObject *kwargs __maybe_unused)
928{ 928{
929 struct perf_evlist *evlist = &pevlist->evlist; 929 struct evlist *evlist = &pevlist->evlist;
930 PyObject *list = PyList_New(0); 930 PyObject *list = PyList_New(0);
931 int i; 931 int i;
932 932
@@ -964,7 +964,7 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist,
964 PyObject *args, 964 PyObject *args,
965 PyObject *kwargs __maybe_unused) 965 PyObject *kwargs __maybe_unused)
966{ 966{
967 struct perf_evlist *evlist = &pevlist->evlist; 967 struct evlist *evlist = &pevlist->evlist;
968 PyObject *pevsel; 968 PyObject *pevsel;
969 struct evsel *evsel; 969 struct evsel *evsel;
970 970
@@ -979,7 +979,7 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist,
979 return Py_BuildValue("i", evlist->nr_entries); 979 return Py_BuildValue("i", evlist->nr_entries);
980} 980}
981 981
982static struct perf_mmap *get_md(struct perf_evlist *evlist, int cpu) 982static struct perf_mmap *get_md(struct evlist *evlist, int cpu)
983{ 983{
984 int i; 984 int i;
985 985
@@ -996,7 +996,7 @@ static struct perf_mmap *get_md(struct perf_evlist *evlist, int cpu)
996static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, 996static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist,
997 PyObject *args, PyObject *kwargs) 997 PyObject *args, PyObject *kwargs)
998{ 998{
999 struct perf_evlist *evlist = &pevlist->evlist; 999 struct evlist *evlist = &pevlist->evlist;
1000 union perf_event *event; 1000 union perf_event *event;
1001 int sample_id_all = 1, cpu; 1001 int sample_id_all = 1, cpu;
1002 static char *kwlist[] = { "cpu", "sample_id_all", NULL }; 1002 static char *kwlist[] = { "cpu", "sample_id_all", NULL };
@@ -1049,7 +1049,7 @@ end:
1049static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist, 1049static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist,
1050 PyObject *args, PyObject *kwargs) 1050 PyObject *args, PyObject *kwargs)
1051{ 1051{
1052 struct perf_evlist *evlist = &pevlist->evlist; 1052 struct evlist *evlist = &pevlist->evlist;
1053 int group = 0; 1053 int group = 0;
1054 static char *kwlist[] = { "group", NULL }; 1054 static char *kwlist[] = { "group", NULL };
1055 1055
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
index ef8f686729fd..a550d78a0b4d 100644
--- a/tools/perf/util/record.c
+++ b/tools/perf/util/record.c
@@ -13,7 +13,7 @@ typedef void (*setup_probe_fn_t)(struct evsel *evsel);
13 13
14static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str) 14static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str)
15{ 15{
16 struct perf_evlist *evlist; 16 struct evlist *evlist;
17 struct evsel *evsel; 17 struct evsel *evsel;
18 unsigned long flags = perf_event_open_cloexec_flag(); 18 unsigned long flags = perf_event_open_cloexec_flag();
19 int err = -EAGAIN, fd; 19 int err = -EAGAIN, fd;
@@ -132,7 +132,7 @@ bool perf_can_record_cpu_wide(void)
132 return true; 132 return true;
133} 133}
134 134
135void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts, 135void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
136 struct callchain_param *callchain) 136 struct callchain_param *callchain)
137{ 137{
138 struct evsel *evsel; 138 struct evsel *evsel;
@@ -256,9 +256,9 @@ int record_opts__config(struct record_opts *opts)
256 return record_opts__config_freq(opts); 256 return record_opts__config_freq(opts);
257} 257}
258 258
259bool perf_evlist__can_select_event(struct perf_evlist *evlist, const char *str) 259bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
260{ 260{
261 struct perf_evlist *temp_evlist; 261 struct evlist *temp_evlist;
262 struct evsel *evsel; 262 struct evsel *evsel;
263 int err, fd, cpu; 263 int err, fd, cpu;
264 bool ret = false; 264 bool ret = false;
diff --git a/tools/perf/util/s390-sample-raw.c b/tools/perf/util/s390-sample-raw.c
index 159a08220947..6c709647cd8e 100644
--- a/tools/perf/util/s390-sample-raw.c
+++ b/tools/perf/util/s390-sample-raw.c
@@ -200,7 +200,7 @@ static void s390_cpumcfdg_dump(struct perf_sample *sample)
200 * its raw data. 200 * its raw data.
201 * The function is only invoked when the dump flag -D is set. 201 * The function is only invoked when the dump flag -D is set.
202 */ 202 */
203void perf_evlist__s390_sample_raw(struct perf_evlist *evlist, union perf_event *event, 203void perf_evlist__s390_sample_raw(struct evlist *evlist, union perf_event *event,
204 struct perf_sample *sample) 204 struct perf_sample *sample)
205{ 205{
206 struct evsel *ev_bc000; 206 struct evsel *ev_bc000;
diff --git a/tools/perf/util/sample-raw.c b/tools/perf/util/sample-raw.c
index c21e1311fb0f..e84bbe0e441a 100644
--- a/tools/perf/util/sample-raw.c
+++ b/tools/perf/util/sample-raw.c
@@ -9,7 +9,7 @@
9 * Check platform the perf data file was created on and perform platform 9 * Check platform the perf data file was created on and perform platform
10 * specific interpretation. 10 * specific interpretation.
11 */ 11 */
12void perf_evlist__init_trace_event_sample_raw(struct perf_evlist *evlist) 12void perf_evlist__init_trace_event_sample_raw(struct evlist *evlist)
13{ 13{
14 const char *arch_pf = perf_env__arch(evlist->env); 14 const char *arch_pf = perf_env__arch(evlist->env);
15 15
diff --git a/tools/perf/util/sample-raw.h b/tools/perf/util/sample-raw.h
index 95d445c87e93..afe1491a117e 100644
--- a/tools/perf/util/sample-raw.h
+++ b/tools/perf/util/sample-raw.h
@@ -2,13 +2,13 @@
2#ifndef __SAMPLE_RAW_H 2#ifndef __SAMPLE_RAW_H
3#define __SAMPLE_RAW_H 1 3#define __SAMPLE_RAW_H 1
4 4
5struct perf_evlist; 5struct evlist;
6union perf_event; 6union perf_event;
7struct perf_sample; 7struct perf_sample;
8 8
9void perf_evlist__s390_sample_raw(struct perf_evlist *evlist, 9void perf_evlist__s390_sample_raw(struct evlist *evlist,
10 union perf_event *event, 10 union perf_event *event,
11 struct perf_sample *sample); 11 struct perf_sample *sample);
12 12
13void perf_evlist__init_trace_event_sample_raw(struct perf_evlist *evlist); 13void perf_evlist__init_trace_event_sample_raw(struct evlist *evlist);
14#endif /* __PERF_EVLIST_H */ 14#endif /* __PERF_EVLIST_H */
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index e9d1cf8eb274..c191dc152175 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -300,7 +300,7 @@ static int process_event_synth_tracing_data_stub(struct perf_session *session
300 300
301static int process_event_synth_attr_stub(struct perf_tool *tool __maybe_unused, 301static int process_event_synth_attr_stub(struct perf_tool *tool __maybe_unused,
302 union perf_event *event __maybe_unused, 302 union perf_event *event __maybe_unused,
303 struct perf_evlist **pevlist 303 struct evlist **pevlist
304 __maybe_unused) 304 __maybe_unused)
305{ 305{
306 dump_printf(": unhandled!\n"); 306 dump_printf(": unhandled!\n");
@@ -309,7 +309,7 @@ static int process_event_synth_attr_stub(struct perf_tool *tool __maybe_unused,
309 309
310static int process_event_synth_event_update_stub(struct perf_tool *tool __maybe_unused, 310static int process_event_synth_event_update_stub(struct perf_tool *tool __maybe_unused,
311 union perf_event *event __maybe_unused, 311 union perf_event *event __maybe_unused,
312 struct perf_evlist **pevlist 312 struct evlist **pevlist
313 __maybe_unused) 313 __maybe_unused)
314{ 314{
315 if (dump_trace) 315 if (dump_trace)
@@ -1129,7 +1129,7 @@ static void stack_user__printf(struct stack_dump *dump)
1129 dump->size, dump->offset); 1129 dump->size, dump->offset);
1130} 1130}
1131 1131
1132static void perf_evlist__print_tstamp(struct perf_evlist *evlist, 1132static void perf_evlist__print_tstamp(struct evlist *evlist,
1133 union perf_event *event, 1133 union perf_event *event,
1134 struct perf_sample *sample) 1134 struct perf_sample *sample)
1135{ 1135{
@@ -1178,7 +1178,7 @@ static void sample_read__printf(struct perf_sample *sample, u64 read_format)
1178 sample->read.one.id, sample->read.one.value); 1178 sample->read.one.id, sample->read.one.value);
1179} 1179}
1180 1180
1181static void dump_event(struct perf_evlist *evlist, union perf_event *event, 1181static void dump_event(struct evlist *evlist, union perf_event *event,
1182 u64 file_offset, struct perf_sample *sample) 1182 u64 file_offset, struct perf_sample *sample)
1183{ 1183{
1184 if (!dump_trace) 1184 if (!dump_trace)
@@ -1296,7 +1296,7 @@ static struct machine *machines__find_for_cpumode(struct machines *machines,
1296 return &machines->host; 1296 return &machines->host;
1297} 1297}
1298 1298
1299static int deliver_sample_value(struct perf_evlist *evlist, 1299static int deliver_sample_value(struct evlist *evlist,
1300 struct perf_tool *tool, 1300 struct perf_tool *tool,
1301 union perf_event *event, 1301 union perf_event *event,
1302 struct perf_sample *sample, 1302 struct perf_sample *sample,
@@ -1326,7 +1326,7 @@ static int deliver_sample_value(struct perf_evlist *evlist,
1326 return tool->sample(tool, event, sample, sid->evsel, machine); 1326 return tool->sample(tool, event, sample, sid->evsel, machine);
1327} 1327}
1328 1328
1329static int deliver_sample_group(struct perf_evlist *evlist, 1329static int deliver_sample_group(struct evlist *evlist,
1330 struct perf_tool *tool, 1330 struct perf_tool *tool,
1331 union perf_event *event, 1331 union perf_event *event,
1332 struct perf_sample *sample, 1332 struct perf_sample *sample,
@@ -1347,7 +1347,7 @@ static int deliver_sample_group(struct perf_evlist *evlist,
1347} 1347}
1348 1348
1349static int 1349static int
1350 perf_evlist__deliver_sample(struct perf_evlist *evlist, 1350 perf_evlist__deliver_sample(struct evlist *evlist,
1351 struct perf_tool *tool, 1351 struct perf_tool *tool,
1352 union perf_event *event, 1352 union perf_event *event,
1353 struct perf_sample *sample, 1353 struct perf_sample *sample,
@@ -1372,7 +1372,7 @@ static int
1372} 1372}
1373 1373
1374static int machines__deliver_event(struct machines *machines, 1374static int machines__deliver_event(struct machines *machines,
1375 struct perf_evlist *evlist, 1375 struct evlist *evlist,
1376 union perf_event *event, 1376 union perf_event *event,
1377 struct perf_sample *sample, 1377 struct perf_sample *sample,
1378 struct perf_tool *tool, u64 file_offset) 1378 struct perf_tool *tool, u64 file_offset)
@@ -1553,7 +1553,7 @@ int perf_session__deliver_synth_event(struct perf_session *session,
1553 union perf_event *event, 1553 union perf_event *event,
1554 struct perf_sample *sample) 1554 struct perf_sample *sample)
1555{ 1555{
1556 struct perf_evlist *evlist = session->evlist; 1556 struct evlist *evlist = session->evlist;
1557 struct perf_tool *tool = session->tool; 1557 struct perf_tool *tool = session->tool;
1558 1558
1559 events_stats__inc(&evlist->stats, event->header.type); 1559 events_stats__inc(&evlist->stats, event->header.type);
@@ -1631,7 +1631,7 @@ out_parse_sample:
1631static s64 perf_session__process_event(struct perf_session *session, 1631static s64 perf_session__process_event(struct perf_session *session,
1632 union perf_event *event, u64 file_offset) 1632 union perf_event *event, u64 file_offset)
1633{ 1633{
1634 struct perf_evlist *evlist = session->evlist; 1634 struct evlist *evlist = session->evlist;
1635 struct perf_tool *tool = session->tool; 1635 struct perf_tool *tool = session->tool;
1636 int ret; 1636 int ret;
1637 1637
@@ -2357,7 +2357,7 @@ out:
2357int perf_event__process_id_index(struct perf_session *session, 2357int perf_event__process_id_index(struct perf_session *session,
2358 union perf_event *event) 2358 union perf_event *event)
2359{ 2359{
2360 struct perf_evlist *evlist = session->evlist; 2360 struct evlist *evlist = session->evlist;
2361 struct id_index_event *ie = &event->id_index; 2361 struct id_index_event *ie = &event->id_index;
2362 size_t i, nr, max_nr; 2362 size_t i, nr, max_nr;
2363 2363
@@ -2393,7 +2393,7 @@ int perf_event__process_id_index(struct perf_session *session,
2393 2393
2394int perf_event__synthesize_id_index(struct perf_tool *tool, 2394int perf_event__synthesize_id_index(struct perf_tool *tool,
2395 perf_event__handler_t process, 2395 perf_event__handler_t process,
2396 struct perf_evlist *evlist, 2396 struct evlist *evlist,
2397 struct machine *machine) 2397 struct machine *machine)
2398{ 2398{
2399 union perf_event *ev; 2399 union perf_event *ev;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 2b2427c4c0b9..79e97d17ea04 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -23,7 +23,7 @@ struct itrace_synth_opts;
23struct perf_session { 23struct perf_session {
24 struct perf_header header; 24 struct perf_header header;
25 struct machines machines; 25 struct machines machines;
26 struct perf_evlist *evlist; 26 struct evlist *evlist;
27 struct auxtrace *auxtrace; 27 struct auxtrace *auxtrace;
28 struct itrace_synth_opts *itrace_synth_opts; 28 struct itrace_synth_opts *itrace_synth_opts;
29 struct list_head auxtrace_index; 29 struct list_head auxtrace_index;
@@ -140,7 +140,7 @@ int perf_event__process_id_index(struct perf_session *session,
140 140
141int perf_event__synthesize_id_index(struct perf_tool *tool, 141int perf_event__synthesize_id_index(struct perf_tool *tool,
142 perf_event__handler_t process, 142 perf_event__handler_t process,
143 struct perf_evlist *evlist, 143 struct evlist *evlist,
144 struct machine *machine); 144 struct machine *machine);
145 145
146#endif /* __PERF_SESSION_H */ 146#endif /* __PERF_SESSION_H */
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 133d3a45997f..d8e4392d6e18 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -2313,7 +2313,7 @@ static int parse_field_name(char *str, char **event, char **field, char **opt)
2313 * 2. full event name (e.g. sched:sched_switch) 2313 * 2. full event name (e.g. sched:sched_switch)
2314 * 3. partial event name (should not contain ':') 2314 * 3. partial event name (should not contain ':')
2315 */ 2315 */
2316static struct evsel *find_evsel(struct perf_evlist *evlist, char *event_name) 2316static struct evsel *find_evsel(struct evlist *evlist, char *event_name)
2317{ 2317{
2318 struct evsel *evsel = NULL; 2318 struct evsel *evsel = NULL;
2319 struct evsel *pos; 2319 struct evsel *pos;
@@ -2384,7 +2384,7 @@ static int add_evsel_fields(struct evsel *evsel, bool raw_trace, int level)
2384 return 0; 2384 return 0;
2385} 2385}
2386 2386
2387static int add_all_dynamic_fields(struct perf_evlist *evlist, bool raw_trace, 2387static int add_all_dynamic_fields(struct evlist *evlist, bool raw_trace,
2388 int level) 2388 int level)
2389{ 2389{
2390 int ret; 2390 int ret;
@@ -2401,7 +2401,7 @@ static int add_all_dynamic_fields(struct perf_evlist *evlist, bool raw_trace,
2401 return 0; 2401 return 0;
2402} 2402}
2403 2403
2404static int add_all_matching_fields(struct perf_evlist *evlist, 2404static int add_all_matching_fields(struct evlist *evlist,
2405 char *field_name, bool raw_trace, int level) 2405 char *field_name, bool raw_trace, int level)
2406{ 2406{
2407 int ret = -ESRCH; 2407 int ret = -ESRCH;
@@ -2423,7 +2423,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist,
2423 return ret; 2423 return ret;
2424} 2424}
2425 2425
2426static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok, 2426static int add_dynamic_entry(struct evlist *evlist, const char *tok,
2427 int level) 2427 int level)
2428{ 2428{
2429 char *str, *event_name, *field_name, *opt_name; 2429 char *str, *event_name, *field_name, *opt_name;
@@ -2567,7 +2567,7 @@ int hpp_dimension__add_output(unsigned col)
2567} 2567}
2568 2568
2569int sort_dimension__add(struct perf_hpp_list *list, const char *tok, 2569int sort_dimension__add(struct perf_hpp_list *list, const char *tok,
2570 struct perf_evlist *evlist, 2570 struct evlist *evlist,
2571 int level) 2571 int level)
2572{ 2572{
2573 unsigned int i; 2573 unsigned int i;
@@ -2663,7 +2663,7 @@ int sort_dimension__add(struct perf_hpp_list *list, const char *tok,
2663} 2663}
2664 2664
2665static int setup_sort_list(struct perf_hpp_list *list, char *str, 2665static int setup_sort_list(struct perf_hpp_list *list, char *str,
2666 struct perf_evlist *evlist) 2666 struct evlist *evlist)
2667{ 2667{
2668 char *tmp, *tok; 2668 char *tmp, *tok;
2669 int ret = 0; 2669 int ret = 0;
@@ -2709,7 +2709,7 @@ static int setup_sort_list(struct perf_hpp_list *list, char *str,
2709 return ret; 2709 return ret;
2710} 2710}
2711 2711
2712static const char *get_default_sort_order(struct perf_evlist *evlist) 2712static const char *get_default_sort_order(struct evlist *evlist)
2713{ 2713{
2714 const char *default_sort_orders[] = { 2714 const char *default_sort_orders[] = {
2715 default_sort_order, 2715 default_sort_order,
@@ -2743,7 +2743,7 @@ out_no_evlist:
2743 return default_sort_orders[sort__mode]; 2743 return default_sort_orders[sort__mode];
2744} 2744}
2745 2745
2746static int setup_sort_order(struct perf_evlist *evlist) 2746static int setup_sort_order(struct evlist *evlist)
2747{ 2747{
2748 char *new_sort_order; 2748 char *new_sort_order;
2749 2749
@@ -2804,7 +2804,7 @@ static char *setup_overhead(char *keys)
2804 return keys; 2804 return keys;
2805} 2805}
2806 2806
2807static int __setup_sorting(struct perf_evlist *evlist) 2807static int __setup_sorting(struct evlist *evlist)
2808{ 2808{
2809 char *str; 2809 char *str;
2810 const char *sort_keys; 2810 const char *sort_keys;
@@ -3057,7 +3057,7 @@ out:
3057 return ret; 3057 return ret;
3058} 3058}
3059 3059
3060int setup_sorting(struct perf_evlist *evlist) 3060int setup_sorting(struct evlist *evlist)
3061{ 3061{
3062 int err; 3062 int err;
3063 3063
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index a0f232151d6f..5e34676a98e8 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -301,9 +301,9 @@ struct block_hist {
301extern struct sort_entry sort_thread; 301extern struct sort_entry sort_thread;
302extern struct list_head hist_entry__sort_list; 302extern struct list_head hist_entry__sort_list;
303 303
304struct perf_evlist; 304struct evlist;
305struct tep_handle; 305struct tep_handle;
306int setup_sorting(struct perf_evlist *evlist); 306int setup_sorting(struct evlist *evlist);
307int setup_output_field(void); 307int setup_output_field(void);
308void reset_output_field(void); 308void reset_output_field(void);
309void sort__setup_elide(FILE *fp); 309void sort__setup_elide(FILE *fp);
@@ -318,7 +318,7 @@ bool is_strict_order(const char *order);
318int hpp_dimension__add_output(unsigned col); 318int hpp_dimension__add_output(unsigned col);
319void reset_dimensions(void); 319void reset_dimensions(void);
320int sort_dimension__add(struct perf_hpp_list *list, const char *tok, 320int sort_dimension__add(struct perf_hpp_list *list, const char *tok,
321 struct perf_evlist *evlist, 321 struct evlist *evlist,
322 int level); 322 int level);
323int output_field_add(struct perf_hpp_list *list, char *tok); 323int output_field_add(struct perf_hpp_list *list, char *tok);
324int64_t 324int64_t
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 8da4ddcb2e44..cdfceb5b4d72 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -312,7 +312,7 @@ static void print_metric_header(struct perf_stat_config *config,
312static int first_shadow_cpu(struct perf_stat_config *config, 312static int first_shadow_cpu(struct perf_stat_config *config,
313 struct evsel *evsel, int id) 313 struct evsel *evsel, int id)
314{ 314{
315 struct perf_evlist *evlist = evsel->evlist; 315 struct evlist *evlist = evsel->evlist;
316 int i; 316 int i;
317 317
318 if (!config->aggr_get_id) 318 if (!config->aggr_get_id)
@@ -365,7 +365,7 @@ static void abs_printout(struct perf_stat_config *config,
365 365
366static bool is_mixed_hw_group(struct evsel *counter) 366static bool is_mixed_hw_group(struct evsel *counter)
367{ 367{
368 struct perf_evlist *evlist = counter->evlist; 368 struct evlist *evlist = counter->evlist;
369 u32 pmu_type = counter->attr.type; 369 u32 pmu_type = counter->attr.type;
370 struct evsel *pos; 370 struct evsel *pos;
371 371
@@ -489,7 +489,7 @@ static void printout(struct perf_stat_config *config, int id, int nr,
489} 489}
490 490
491static void aggr_update_shadow(struct perf_stat_config *config, 491static void aggr_update_shadow(struct perf_stat_config *config,
492 struct perf_evlist *evlist) 492 struct evlist *evlist)
493{ 493{
494 int cpu, s2, id, s; 494 int cpu, s2, id, s;
495 u64 val; 495 u64 val;
@@ -545,7 +545,7 @@ static void collect_all_aliases(struct perf_stat_config *config, struct evsel *c
545 bool first), 545 bool first),
546 void *data) 546 void *data)
547{ 547{
548 struct perf_evlist *evlist = counter->evlist; 548 struct evlist *evlist = counter->evlist;
549 struct evsel *alias; 549 struct evsel *alias;
550 550
551 alias = list_prepare_entry(counter, &(evlist->entries), node); 551 alias = list_prepare_entry(counter, &(evlist->entries), node);
@@ -651,7 +651,7 @@ static void print_counter_aggrdata(struct perf_stat_config *config,
651} 651}
652 652
653static void print_aggr(struct perf_stat_config *config, 653static void print_aggr(struct perf_stat_config *config,
654 struct perf_evlist *evlist, 654 struct evlist *evlist,
655 char *prefix) 655 char *prefix)
656{ 656{
657 bool metric_only = config->metric_only; 657 bool metric_only = config->metric_only;
@@ -859,7 +859,7 @@ static void print_counter(struct perf_stat_config *config,
859} 859}
860 860
861static void print_no_aggr_metric(struct perf_stat_config *config, 861static void print_no_aggr_metric(struct perf_stat_config *config,
862 struct perf_evlist *evlist, 862 struct evlist *evlist,
863 char *prefix) 863 char *prefix)
864{ 864{
865 int cpu; 865 int cpu;
@@ -910,7 +910,7 @@ static const char *aggr_header_csv[] = {
910}; 910};
911 911
912static void print_metric_headers(struct perf_stat_config *config, 912static void print_metric_headers(struct perf_stat_config *config,
913 struct perf_evlist *evlist, 913 struct evlist *evlist,
914 const char *prefix, bool no_indent) 914 const char *prefix, bool no_indent)
915{ 915{
916 struct perf_stat_output_ctx out; 916 struct perf_stat_output_ctx out;
@@ -949,7 +949,7 @@ static void print_metric_headers(struct perf_stat_config *config,
949} 949}
950 950
951static void print_interval(struct perf_stat_config *config, 951static void print_interval(struct perf_stat_config *config,
952 struct perf_evlist *evlist, 952 struct evlist *evlist,
953 char *prefix, struct timespec *ts) 953 char *prefix, struct timespec *ts)
954{ 954{
955 bool metric_only = config->metric_only; 955 bool metric_only = config->metric_only;
@@ -1156,7 +1156,7 @@ static void print_percore(struct perf_stat_config *config,
1156} 1156}
1157 1157
1158void 1158void
1159perf_evlist__print_counters(struct perf_evlist *evlist, 1159perf_evlist__print_counters(struct evlist *evlist,
1160 struct perf_stat_config *config, 1160 struct perf_stat_config *config,
1161 struct target *_target, 1161 struct target *_target,
1162 struct timespec *ts, 1162 struct timespec *ts,
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 8c19f3149f34..d81bcab2e64c 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -299,7 +299,7 @@ static const char *get_ratio_color(enum grc_type type, double ratio)
299 return color; 299 return color;
300} 300}
301 301
302static struct evsel *perf_stat__find_event(struct perf_evlist *evsel_list, 302static struct evsel *perf_stat__find_event(struct evlist *evsel_list,
303 const char *name) 303 const char *name)
304{ 304{
305 struct evsel *c2; 305 struct evsel *c2;
@@ -312,7 +312,7 @@ static struct evsel *perf_stat__find_event(struct perf_evlist *evsel_list,
312} 312}
313 313
314/* Mark MetricExpr target events and link events using them to them. */ 314/* Mark MetricExpr target events and link events using them to them. */
315void perf_stat__collect_metric_expr(struct perf_evlist *evsel_list) 315void perf_stat__collect_metric_expr(struct evlist *evsel_list)
316{ 316{
317 struct evsel *counter, *leader, **metric_events, *oc; 317 struct evsel *counter, *leader, **metric_events, *oc;
318 bool found; 318 bool found;
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 7acb9a6730fe..efd934ec02c3 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -168,7 +168,7 @@ static int perf_evsel__alloc_stats(struct evsel *evsel, bool alloc_raw)
168 return 0; 168 return 0;
169} 169}
170 170
171int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw) 171int perf_evlist__alloc_stats(struct evlist *evlist, bool alloc_raw)
172{ 172{
173 struct evsel *evsel; 173 struct evsel *evsel;
174 174
@@ -184,7 +184,7 @@ out_free:
184 return -1; 184 return -1;
185} 185}
186 186
187void perf_evlist__free_stats(struct perf_evlist *evlist) 187void perf_evlist__free_stats(struct evlist *evlist)
188{ 188{
189 struct evsel *evsel; 189 struct evsel *evsel;
190 190
@@ -195,7 +195,7 @@ void perf_evlist__free_stats(struct perf_evlist *evlist)
195 } 195 }
196} 196}
197 197
198void perf_evlist__reset_stats(struct perf_evlist *evlist) 198void perf_evlist__reset_stats(struct evlist *evlist)
199{ 199{
200 struct evsel *evsel; 200 struct evsel *evsel;
201 201
@@ -490,7 +490,7 @@ int create_perf_stat_counter(struct evsel *evsel,
490 490
491int perf_stat_synthesize_config(struct perf_stat_config *config, 491int perf_stat_synthesize_config(struct perf_stat_config *config,
492 struct perf_tool *tool, 492 struct perf_tool *tool,
493 struct perf_evlist *evlist, 493 struct evlist *evlist,
494 perf_event__handler_t process, 494 perf_event__handler_t process,
495 bool attrs) 495 bool attrs)
496{ 496{
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index b64cf0177a91..95b4de7a9d51 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -144,7 +144,7 @@ static inline void init_stats(struct stats *stats)
144} 144}
145 145
146struct evsel; 146struct evsel;
147struct perf_evlist; 147struct evlist;
148 148
149struct perf_aggr_thread_value { 149struct perf_aggr_thread_value {
150 struct evsel *counter; 150 struct evsel *counter;
@@ -189,11 +189,11 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config,
189 struct perf_stat_output_ctx *out, 189 struct perf_stat_output_ctx *out,
190 struct rblist *metric_events, 190 struct rblist *metric_events,
191 struct runtime_stat *st); 191 struct runtime_stat *st);
192void perf_stat__collect_metric_expr(struct perf_evlist *); 192void perf_stat__collect_metric_expr(struct evlist *);
193 193
194int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw); 194int perf_evlist__alloc_stats(struct evlist *evlist, bool alloc_raw);
195void perf_evlist__free_stats(struct perf_evlist *evlist); 195void perf_evlist__free_stats(struct evlist *evlist);
196void perf_evlist__reset_stats(struct perf_evlist *evlist); 196void perf_evlist__reset_stats(struct evlist *evlist);
197 197
198int perf_stat_process_counter(struct perf_stat_config *config, 198int perf_stat_process_counter(struct perf_stat_config *config,
199 struct evsel *counter); 199 struct evsel *counter);
@@ -212,11 +212,11 @@ int create_perf_stat_counter(struct evsel *evsel,
212 struct target *target); 212 struct target *target);
213int perf_stat_synthesize_config(struct perf_stat_config *config, 213int perf_stat_synthesize_config(struct perf_stat_config *config,
214 struct perf_tool *tool, 214 struct perf_tool *tool,
215 struct perf_evlist *evlist, 215 struct evlist *evlist,
216 perf_event__handler_t process, 216 perf_event__handler_t process,
217 bool attrs); 217 bool attrs);
218void 218void
219perf_evlist__print_counters(struct perf_evlist *evlist, 219perf_evlist__print_counters(struct evlist *evlist,
220 struct perf_stat_config *config, 220 struct perf_stat_config *config,
221 struct target *_target, 221 struct target *_target,
222 struct timespec *ts, 222 struct timespec *ts,
diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h
index 5d880a6f0a34..7f95dd1d6883 100644
--- a/tools/perf/util/tool.h
+++ b/tools/perf/util/tool.h
@@ -8,7 +8,7 @@
8 8
9struct perf_session; 9struct perf_session;
10union perf_event; 10union perf_event;
11struct perf_evlist; 11struct evlist;
12struct evsel; 12struct evsel;
13struct perf_sample; 13struct perf_sample;
14struct perf_tool; 14struct perf_tool;
@@ -24,7 +24,7 @@ typedef int (*event_op)(struct perf_tool *tool, union perf_event *event,
24 24
25typedef int (*event_attr_op)(struct perf_tool *tool, 25typedef int (*event_attr_op)(struct perf_tool *tool,
26 union perf_event *event, 26 union perf_event *event,
27 struct perf_evlist **pevlist); 27 struct evlist **pevlist);
28 28
29typedef int (*event_op2)(struct perf_session *session, union perf_event *event); 29typedef int (*event_op2)(struct perf_session *session, union perf_event *event);
30typedef s64 (*event_op3)(struct perf_session *session, union perf_event *event); 30typedef s64 (*event_op3)(struct perf_session *session, union perf_event *event);
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
index 7e0f363c0658..2023e0bf6165 100644
--- a/tools/perf/util/top.h
+++ b/tools/perf/util/top.h
@@ -9,13 +9,13 @@
9#include <stdbool.h> 9#include <stdbool.h>
10#include <sys/ioctl.h> 10#include <sys/ioctl.h>
11 11
12struct perf_evlist; 12struct evlist;
13struct evsel; 13struct evsel;
14struct perf_session; 14struct perf_session;
15 15
16struct perf_top { 16struct perf_top {
17 struct perf_tool tool; 17 struct perf_tool tool;
18 struct perf_evlist *evlist; 18 struct evlist *evlist;
19 struct record_opts record_opts; 19 struct record_opts record_opts;
20 struct annotation_options annotation_opts; 20 struct annotation_options annotation_opts;
21 /* 21 /*