diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-07-21 07:24:29 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-29 17:34:45 -0400 |
commit | 1fc632cef4ea137bc45fd0fc4cb902e374064163 (patch) | |
tree | 71f8a47f40071eaee25d2157fc908f1f789c09a2 | |
parent | 6484d2f9dc3ecbf13f07100f7f771d1d779eda04 (diff) |
libperf: Move perf_event_attr field from perf's evsel to libperf's perf_evsel
Move the perf_event_attr struct fron 'struct evsel' to 'struct perf_evsel'.
Committer notes:
Fixed up these:
tools/perf/arch/arm/util/auxtrace.c
tools/perf/arch/arm/util/cs-etm.c
tools/perf/arch/arm64/util/arm-spe.c
tools/perf/arch/s390/util/auxtrace.c
tools/perf/util/cs-etm.c
Also
cc1: warnings being treated as errors
tests/sample-parsing.c: In function 'do_test':
tests/sample-parsing.c:162: error: missing initializer
tests/sample-parsing.c:162: error: (near initialization for 'evsel.core.cpus')
struct evsel evsel = {
.needs_swap = false,
- .core.attr = {
- .sample_type = sample_type,
- .read_format = read_format,
+ .core = {
+ . attr = {
+ .sample_type = sample_type,
+ .read_format = read_format,
+ },
[perfbuilder@a70e4eeb5549 /]$ gcc --version |& head -1
gcc (GCC) 4.4.7
Also we don't need to include perf_event.h in
tools/perf/lib/include/perf/evsel.h, forward declaring 'struct
perf_event_attr' is enough. And this even fixes the build in some
systems where things are used somewhere down the include path from
perf_event.h without defining __always_inline.
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-43-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
59 files changed, 864 insertions, 857 deletions
diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c index 306a54185438..41b78f74599f 100644 --- a/tools/perf/arch/arm/util/auxtrace.c +++ b/tools/perf/arch/arm/util/auxtrace.c | |||
@@ -70,14 +70,14 @@ struct auxtrace_record | |||
70 | 70 | ||
71 | evlist__for_each_entry(evlist, evsel) { | 71 | evlist__for_each_entry(evlist, evsel) { |
72 | if (cs_etm_pmu && | 72 | if (cs_etm_pmu && |
73 | evsel->attr.type == cs_etm_pmu->type) | 73 | evsel->core.attr.type == cs_etm_pmu->type) |
74 | found_etm = true; | 74 | found_etm = true; |
75 | 75 | ||
76 | if (!nr_spes) | 76 | if (!nr_spes) |
77 | continue; | 77 | continue; |
78 | 78 | ||
79 | for (i = 0; i < nr_spes; i++) { | 79 | for (i = 0; i < nr_spes; i++) { |
80 | if (evsel->attr.type == arm_spe_pmus[i]->type) { | 80 | if (evsel->core.attr.type == arm_spe_pmus[i]->type) { |
81 | found_spe = true; | 81 | found_spe = true; |
82 | break; | 82 | break; |
83 | } | 83 | } |
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 3a78b38e43ca..f5aafdec7f50 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c | |||
@@ -95,7 +95,7 @@ static int cs_etm_set_context_id(struct auxtrace_record *itr, | |||
95 | } | 95 | } |
96 | 96 | ||
97 | /* All good, let the kernel know */ | 97 | /* All good, let the kernel know */ |
98 | evsel->attr.config |= (1 << ETM_OPT_CTXTID); | 98 | evsel->core.attr.config |= (1 << ETM_OPT_CTXTID); |
99 | err = 0; | 99 | err = 0; |
100 | 100 | ||
101 | out: | 101 | out: |
@@ -144,7 +144,7 @@ static int cs_etm_set_timestamp(struct auxtrace_record *itr, | |||
144 | } | 144 | } |
145 | 145 | ||
146 | /* All good, let the kernel know */ | 146 | /* All good, let the kernel know */ |
147 | evsel->attr.config |= (1 << ETM_OPT_TS); | 147 | evsel->core.attr.config |= (1 << ETM_OPT_TS); |
148 | err = 0; | 148 | err = 0; |
149 | 149 | ||
150 | out: | 150 | out: |
@@ -215,7 +215,7 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu, | |||
215 | int ret = -EINVAL; | 215 | int ret = -EINVAL; |
216 | u32 hash; | 216 | u32 hash; |
217 | 217 | ||
218 | if (evsel->attr.config2 & GENMASK(31, 0)) | 218 | if (evsel->core.attr.config2 & GENMASK(31, 0)) |
219 | return 0; | 219 | return 0; |
220 | 220 | ||
221 | list_for_each_entry(term, &evsel->config_terms, list) { | 221 | list_for_each_entry(term, &evsel->config_terms, list) { |
@@ -233,7 +233,7 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu, | |||
233 | return ret; | 233 | return ret; |
234 | } | 234 | } |
235 | 235 | ||
236 | evsel->attr.config2 |= hash; | 236 | evsel->core.attr.config2 |= hash; |
237 | return 0; | 237 | return 0; |
238 | } | 238 | } |
239 | 239 | ||
@@ -264,14 +264,14 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, | |||
264 | opts->record_switch_events = true; | 264 | opts->record_switch_events = true; |
265 | 265 | ||
266 | evlist__for_each_entry(evlist, evsel) { | 266 | evlist__for_each_entry(evlist, evsel) { |
267 | if (evsel->attr.type == cs_etm_pmu->type) { | 267 | if (evsel->core.attr.type == cs_etm_pmu->type) { |
268 | if (cs_etm_evsel) { | 268 | if (cs_etm_evsel) { |
269 | pr_err("There may be only one %s event\n", | 269 | pr_err("There may be only one %s event\n", |
270 | CORESIGHT_ETM_PMU_NAME); | 270 | CORESIGHT_ETM_PMU_NAME); |
271 | return -EINVAL; | 271 | return -EINVAL; |
272 | } | 272 | } |
273 | evsel->attr.freq = 0; | 273 | evsel->core.attr.freq = 0; |
274 | evsel->attr.sample_period = 1; | 274 | evsel->core.attr.sample_period = 1; |
275 | cs_etm_evsel = evsel; | 275 | cs_etm_evsel = evsel; |
276 | opts->full_auxtrace = true; | 276 | opts->full_auxtrace = true; |
277 | } | 277 | } |
@@ -416,8 +416,8 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, | |||
416 | tracking_evsel = perf_evlist__last(evlist); | 416 | tracking_evsel = perf_evlist__last(evlist); |
417 | perf_evlist__set_tracking_event(evlist, tracking_evsel); | 417 | perf_evlist__set_tracking_event(evlist, tracking_evsel); |
418 | 418 | ||
419 | tracking_evsel->attr.freq = 0; | 419 | tracking_evsel->core.attr.freq = 0; |
420 | tracking_evsel->attr.sample_period = 1; | 420 | tracking_evsel->core.attr.sample_period = 1; |
421 | 421 | ||
422 | /* In per-cpu case, always need the time of mmap events etc */ | 422 | /* In per-cpu case, always need the time of mmap events etc */ |
423 | if (!cpu_map__empty(cpus)) | 423 | if (!cpu_map__empty(cpus)) |
@@ -438,7 +438,7 @@ static u64 cs_etm_get_config(struct auxtrace_record *itr) | |||
438 | struct evsel *evsel; | 438 | struct evsel *evsel; |
439 | 439 | ||
440 | evlist__for_each_entry(evlist, evsel) { | 440 | evlist__for_each_entry(evlist, evsel) { |
441 | if (evsel->attr.type == cs_etm_pmu->type) { | 441 | if (evsel->core.attr.type == cs_etm_pmu->type) { |
442 | /* | 442 | /* |
443 | * Variable perf_event_attr::config is assigned to | 443 | * Variable perf_event_attr::config is assigned to |
444 | * ETMv3/PTM. The bit fields have been made to match | 444 | * ETMv3/PTM. The bit fields have been made to match |
@@ -447,7 +447,7 @@ static u64 cs_etm_get_config(struct auxtrace_record *itr) | |||
447 | * drivers/hwtracing/coresight/coresight-perf.c for | 447 | * drivers/hwtracing/coresight/coresight-perf.c for |
448 | * details. | 448 | * details. |
449 | */ | 449 | */ |
450 | config = evsel->attr.config; | 450 | config = evsel->core.attr.config; |
451 | break; | 451 | break; |
452 | } | 452 | } |
453 | } | 453 | } |
@@ -820,7 +820,7 @@ static int cs_etm_snapshot_start(struct auxtrace_record *itr) | |||
820 | struct evsel *evsel; | 820 | struct evsel *evsel; |
821 | 821 | ||
822 | evlist__for_each_entry(ptr->evlist, evsel) { | 822 | evlist__for_each_entry(ptr->evlist, evsel) { |
823 | if (evsel->attr.type == ptr->cs_etm_pmu->type) | 823 | if (evsel->core.attr.type == ptr->cs_etm_pmu->type) |
824 | return evsel__disable(evsel); | 824 | return evsel__disable(evsel); |
825 | } | 825 | } |
826 | return -EINVAL; | 826 | return -EINVAL; |
@@ -833,7 +833,7 @@ static int cs_etm_snapshot_finish(struct auxtrace_record *itr) | |||
833 | struct evsel *evsel; | 833 | struct evsel *evsel; |
834 | 834 | ||
835 | evlist__for_each_entry(ptr->evlist, evsel) { | 835 | evlist__for_each_entry(ptr->evlist, evsel) { |
836 | if (evsel->attr.type == ptr->cs_etm_pmu->type) | 836 | if (evsel->core.attr.type == ptr->cs_etm_pmu->type) |
837 | return evsel__enable(evsel); | 837 | return evsel__enable(evsel); |
838 | } | 838 | } |
839 | return -EINVAL; | 839 | return -EINVAL; |
@@ -861,7 +861,7 @@ static int cs_etm_read_finish(struct auxtrace_record *itr, int idx) | |||
861 | struct evsel *evsel; | 861 | struct evsel *evsel; |
862 | 862 | ||
863 | evlist__for_each_entry(ptr->evlist, evsel) { | 863 | evlist__for_each_entry(ptr->evlist, evsel) { |
864 | if (evsel->attr.type == ptr->cs_etm_pmu->type) | 864 | if (evsel->core.attr.type == ptr->cs_etm_pmu->type) |
865 | return perf_evlist__enable_event_idx(ptr->evlist, | 865 | return perf_evlist__enable_event_idx(ptr->evlist, |
866 | evsel, idx); | 866 | evsel, idx); |
867 | } | 867 | } |
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c index cc29b995c751..00915b8fd05b 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c | |||
@@ -73,13 +73,13 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, | |||
73 | sper->evlist = evlist; | 73 | sper->evlist = evlist; |
74 | 74 | ||
75 | evlist__for_each_entry(evlist, evsel) { | 75 | evlist__for_each_entry(evlist, evsel) { |
76 | if (evsel->attr.type == arm_spe_pmu->type) { | 76 | if (evsel->core.attr.type == arm_spe_pmu->type) { |
77 | if (arm_spe_evsel) { | 77 | if (arm_spe_evsel) { |
78 | pr_err("There may be only one " ARM_SPE_PMU_NAME "x event\n"); | 78 | pr_err("There may be only one " ARM_SPE_PMU_NAME "x event\n"); |
79 | return -EINVAL; | 79 | return -EINVAL; |
80 | } | 80 | } |
81 | evsel->attr.freq = 0; | 81 | evsel->core.attr.freq = 0; |
82 | evsel->attr.sample_period = 1; | 82 | evsel->core.attr.sample_period = 1; |
83 | arm_spe_evsel = evsel; | 83 | arm_spe_evsel = evsel; |
84 | opts->full_auxtrace = true; | 84 | opts->full_auxtrace = true; |
85 | } | 85 | } |
@@ -130,8 +130,8 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, | |||
130 | tracking_evsel = perf_evlist__last(evlist); | 130 | tracking_evsel = perf_evlist__last(evlist); |
131 | perf_evlist__set_tracking_event(evlist, tracking_evsel); | 131 | perf_evlist__set_tracking_event(evlist, tracking_evsel); |
132 | 132 | ||
133 | tracking_evsel->attr.freq = 0; | 133 | tracking_evsel->core.attr.freq = 0; |
134 | tracking_evsel->attr.sample_period = 1; | 134 | tracking_evsel->core.attr.sample_period = 1; |
135 | perf_evsel__set_sample_bit(tracking_evsel, TIME); | 135 | perf_evsel__set_sample_bit(tracking_evsel, TIME); |
136 | perf_evsel__set_sample_bit(tracking_evsel, CPU); | 136 | perf_evsel__set_sample_bit(tracking_evsel, CPU); |
137 | perf_evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK); | 137 | perf_evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK); |
@@ -163,7 +163,7 @@ static int arm_spe_read_finish(struct auxtrace_record *itr, int idx) | |||
163 | struct evsel *evsel; | 163 | struct evsel *evsel; |
164 | 164 | ||
165 | evlist__for_each_entry(sper->evlist, evsel) { | 165 | evlist__for_each_entry(sper->evlist, evsel) { |
166 | if (evsel->attr.type == sper->arm_spe_pmu->type) | 166 | if (evsel->core.attr.type == sper->arm_spe_pmu->type) |
167 | return perf_evlist__enable_event_idx(sper->evlist, | 167 | return perf_evlist__enable_event_idx(sper->evlist, |
168 | evsel, idx); | 168 | evsel, idx); |
169 | } | 169 | } |
diff --git a/tools/perf/arch/s390/util/auxtrace.c b/tools/perf/arch/s390/util/auxtrace.c index 480ada281bdb..cab46f517b83 100644 --- a/tools/perf/arch/s390/util/auxtrace.c +++ b/tools/perf/arch/s390/util/auxtrace.c | |||
@@ -94,7 +94,7 @@ struct auxtrace_record *auxtrace_record__init(struct evlist *evlist, | |||
94 | return NULL; | 94 | return NULL; |
95 | 95 | ||
96 | evlist__for_each_entry(evlist, pos) { | 96 | evlist__for_each_entry(evlist, pos) { |
97 | if (pos->attr.config == PERF_EVENT_CPUM_SF_DIAG) { | 97 | if (pos->core.attr.config == PERF_EVENT_CPUM_SF_DIAG) { |
98 | diagnose = 1; | 98 | diagnose = 1; |
99 | break; | 99 | break; |
100 | } | 100 | } |
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 8b70e9ee341a..07129e007eb0 100644 --- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c +++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c | |||
@@ -79,9 +79,9 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe | |||
79 | 79 | ||
80 | evsel = perf_evlist__first(evlist); | 80 | evsel = perf_evlist__first(evlist); |
81 | 81 | ||
82 | evsel->attr.comm = 1; | 82 | evsel->core.attr.comm = 1; |
83 | evsel->attr.disabled = 1; | 83 | evsel->core.attr.disabled = 1; |
84 | evsel->attr.enable_on_exec = 0; | 84 | evsel->core.attr.enable_on_exec = 0; |
85 | 85 | ||
86 | CHECK__(evlist__open(evlist)); | 86 | CHECK__(evlist__open(evlist)); |
87 | 87 | ||
diff --git a/tools/perf/arch/x86/util/auxtrace.c b/tools/perf/arch/x86/util/auxtrace.c index 6b3ad5c826fd..96f4a2c11893 100644 --- a/tools/perf/arch/x86/util/auxtrace.c +++ b/tools/perf/arch/x86/util/auxtrace.c | |||
@@ -29,9 +29,9 @@ struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist, | |||
29 | intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME); | 29 | intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME); |
30 | 30 | ||
31 | evlist__for_each_entry(evlist, evsel) { | 31 | evlist__for_each_entry(evlist, evsel) { |
32 | if (intel_pt_pmu && evsel->attr.type == intel_pt_pmu->type) | 32 | if (intel_pt_pmu && evsel->core.attr.type == intel_pt_pmu->type) |
33 | found_pt = true; | 33 | found_pt = true; |
34 | if (intel_bts_pmu && evsel->attr.type == intel_bts_pmu->type) | 34 | if (intel_bts_pmu && evsel->core.attr.type == intel_bts_pmu->type) |
35 | found_bts = true; | 35 | found_bts = true; |
36 | } | 36 | } |
37 | 37 | ||
diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c index 8b0a53d748c9..d8a091266185 100644 --- a/tools/perf/arch/x86/util/intel-bts.c +++ b/tools/perf/arch/x86/util/intel-bts.c | |||
@@ -113,13 +113,13 @@ static int intel_bts_recording_options(struct auxtrace_record *itr, | |||
113 | btsr->snapshot_mode = opts->auxtrace_snapshot_mode; | 113 | btsr->snapshot_mode = opts->auxtrace_snapshot_mode; |
114 | 114 | ||
115 | evlist__for_each_entry(evlist, evsel) { | 115 | evlist__for_each_entry(evlist, evsel) { |
116 | if (evsel->attr.type == intel_bts_pmu->type) { | 116 | if (evsel->core.attr.type == intel_bts_pmu->type) { |
117 | if (intel_bts_evsel) { | 117 | if (intel_bts_evsel) { |
118 | pr_err("There may be only one " INTEL_BTS_PMU_NAME " event\n"); | 118 | pr_err("There may be only one " INTEL_BTS_PMU_NAME " event\n"); |
119 | return -EINVAL; | 119 | return -EINVAL; |
120 | } | 120 | } |
121 | evsel->attr.freq = 0; | 121 | evsel->core.attr.freq = 0; |
122 | evsel->attr.sample_period = 1; | 122 | evsel->core.attr.sample_period = 1; |
123 | intel_bts_evsel = evsel; | 123 | intel_bts_evsel = evsel; |
124 | opts->full_auxtrace = true; | 124 | opts->full_auxtrace = true; |
125 | } | 125 | } |
@@ -231,8 +231,8 @@ static int intel_bts_recording_options(struct auxtrace_record *itr, | |||
231 | 231 | ||
232 | perf_evlist__set_tracking_event(evlist, tracking_evsel); | 232 | perf_evlist__set_tracking_event(evlist, tracking_evsel); |
233 | 233 | ||
234 | tracking_evsel->attr.freq = 0; | 234 | tracking_evsel->core.attr.freq = 0; |
235 | tracking_evsel->attr.sample_period = 1; | 235 | tracking_evsel->core.attr.sample_period = 1; |
236 | } | 236 | } |
237 | 237 | ||
238 | return 0; | 238 | return 0; |
@@ -316,7 +316,7 @@ static int intel_bts_snapshot_start(struct auxtrace_record *itr) | |||
316 | struct evsel *evsel; | 316 | struct evsel *evsel; |
317 | 317 | ||
318 | evlist__for_each_entry(btsr->evlist, evsel) { | 318 | evlist__for_each_entry(btsr->evlist, evsel) { |
319 | if (evsel->attr.type == btsr->intel_bts_pmu->type) | 319 | if (evsel->core.attr.type == btsr->intel_bts_pmu->type) |
320 | return evsel__disable(evsel); | 320 | return evsel__disable(evsel); |
321 | } | 321 | } |
322 | return -EINVAL; | 322 | return -EINVAL; |
@@ -329,7 +329,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr) | |||
329 | struct evsel *evsel; | 329 | struct evsel *evsel; |
330 | 330 | ||
331 | evlist__for_each_entry(btsr->evlist, evsel) { | 331 | evlist__for_each_entry(btsr->evlist, evsel) { |
332 | if (evsel->attr.type == btsr->intel_bts_pmu->type) | 332 | if (evsel->core.attr.type == btsr->intel_bts_pmu->type) |
333 | return evsel__enable(evsel); | 333 | return evsel__enable(evsel); |
334 | } | 334 | } |
335 | return -EINVAL; | 335 | return -EINVAL; |
@@ -411,7 +411,7 @@ static int intel_bts_read_finish(struct auxtrace_record *itr, int idx) | |||
411 | struct evsel *evsel; | 411 | struct evsel *evsel; |
412 | 412 | ||
413 | evlist__for_each_entry(btsr->evlist, evsel) { | 413 | evlist__for_each_entry(btsr->evlist, evsel) { |
414 | if (evsel->attr.type == btsr->intel_bts_pmu->type) | 414 | if (evsel->core.attr.type == btsr->intel_bts_pmu->type) |
415 | return perf_evlist__enable_event_idx(btsr->evlist, | 415 | return perf_evlist__enable_event_idx(btsr->evlist, |
416 | evsel, idx); | 416 | evsel, idx); |
417 | } | 417 | } |
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index 4ce157a4e5e2..aada6a2c456a 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c | |||
@@ -122,8 +122,8 @@ static int intel_pt_read_config(struct perf_pmu *intel_pt_pmu, const char *str, | |||
122 | return -EINVAL; | 122 | return -EINVAL; |
123 | 123 | ||
124 | evlist__for_each_entry(evlist, evsel) { | 124 | evlist__for_each_entry(evlist, evsel) { |
125 | if (evsel->attr.type == intel_pt_pmu->type) { | 125 | if (evsel->core.attr.type == intel_pt_pmu->type) { |
126 | *res = intel_pt_masked_bits(mask, evsel->attr.config); | 126 | *res = intel_pt_masked_bits(mask, evsel->core.attr.config); |
127 | return 0; | 127 | return 0; |
128 | } | 128 | } |
129 | } | 129 | } |
@@ -274,7 +274,7 @@ static const char *intel_pt_find_filter(struct evlist *evlist, | |||
274 | struct evsel *evsel; | 274 | struct evsel *evsel; |
275 | 275 | ||
276 | evlist__for_each_entry(evlist, evsel) { | 276 | evlist__for_each_entry(evlist, evsel) { |
277 | if (evsel->attr.type == intel_pt_pmu->type) | 277 | if (evsel->core.attr.type == intel_pt_pmu->type) |
278 | return evsel->filter; | 278 | return evsel->filter; |
279 | } | 279 | } |
280 | 280 | ||
@@ -526,26 +526,26 @@ static int intel_pt_validate_config(struct perf_pmu *intel_pt_pmu, | |||
526 | * sets pt=0, which avoids senseless kernel errors. | 526 | * sets pt=0, which avoids senseless kernel errors. |
527 | */ | 527 | */ |
528 | if (perf_pmu__scan_file(intel_pt_pmu, "format/pt", "%c", &c) == 1 && | 528 | if (perf_pmu__scan_file(intel_pt_pmu, "format/pt", "%c", &c) == 1 && |
529 | !(evsel->attr.config & 1)) { | 529 | !(evsel->core.attr.config & 1)) { |
530 | pr_warning("pt=0 doesn't make sense, forcing pt=1\n"); | 530 | pr_warning("pt=0 doesn't make sense, forcing pt=1\n"); |
531 | evsel->attr.config |= 1; | 531 | evsel->core.attr.config |= 1; |
532 | } | 532 | } |
533 | 533 | ||
534 | err = intel_pt_val_config_term(intel_pt_pmu, "caps/cycle_thresholds", | 534 | err = intel_pt_val_config_term(intel_pt_pmu, "caps/cycle_thresholds", |
535 | "cyc_thresh", "caps/psb_cyc", | 535 | "cyc_thresh", "caps/psb_cyc", |
536 | evsel->attr.config); | 536 | evsel->core.attr.config); |
537 | if (err) | 537 | if (err) |
538 | return err; | 538 | return err; |
539 | 539 | ||
540 | err = intel_pt_val_config_term(intel_pt_pmu, "caps/mtc_periods", | 540 | err = intel_pt_val_config_term(intel_pt_pmu, "caps/mtc_periods", |
541 | "mtc_period", "caps/mtc", | 541 | "mtc_period", "caps/mtc", |
542 | evsel->attr.config); | 542 | evsel->core.attr.config); |
543 | if (err) | 543 | if (err) |
544 | return err; | 544 | return err; |
545 | 545 | ||
546 | return intel_pt_val_config_term(intel_pt_pmu, "caps/psb_periods", | 546 | return intel_pt_val_config_term(intel_pt_pmu, "caps/psb_periods", |
547 | "psb_period", "caps/psb_cyc", | 547 | "psb_period", "caps/psb_cyc", |
548 | evsel->attr.config); | 548 | evsel->core.attr.config); |
549 | } | 549 | } |
550 | 550 | ||
551 | static int intel_pt_recording_options(struct auxtrace_record *itr, | 551 | static int intel_pt_recording_options(struct auxtrace_record *itr, |
@@ -566,13 +566,13 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, | |||
566 | ptr->snapshot_mode = opts->auxtrace_snapshot_mode; | 566 | ptr->snapshot_mode = opts->auxtrace_snapshot_mode; |
567 | 567 | ||
568 | evlist__for_each_entry(evlist, evsel) { | 568 | evlist__for_each_entry(evlist, evsel) { |
569 | if (evsel->attr.type == intel_pt_pmu->type) { | 569 | if (evsel->core.attr.type == intel_pt_pmu->type) { |
570 | if (intel_pt_evsel) { | 570 | if (intel_pt_evsel) { |
571 | pr_err("There may be only one " INTEL_PT_PMU_NAME " event\n"); | 571 | pr_err("There may be only one " INTEL_PT_PMU_NAME " event\n"); |
572 | return -EINVAL; | 572 | return -EINVAL; |
573 | } | 573 | } |
574 | evsel->attr.freq = 0; | 574 | evsel->core.attr.freq = 0; |
575 | evsel->attr.sample_period = 1; | 575 | evsel->core.attr.sample_period = 1; |
576 | intel_pt_evsel = evsel; | 576 | intel_pt_evsel = evsel; |
577 | opts->full_auxtrace = true; | 577 | opts->full_auxtrace = true; |
578 | } | 578 | } |
@@ -670,7 +670,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, | |||
670 | 670 | ||
671 | intel_pt_parse_terms(&intel_pt_pmu->format, "tsc", &tsc_bit); | 671 | intel_pt_parse_terms(&intel_pt_pmu->format, "tsc", &tsc_bit); |
672 | 672 | ||
673 | if (opts->full_auxtrace && (intel_pt_evsel->attr.config & tsc_bit)) | 673 | if (opts->full_auxtrace && (intel_pt_evsel->core.attr.config & tsc_bit)) |
674 | have_timing_info = true; | 674 | have_timing_info = true; |
675 | else | 675 | else |
676 | have_timing_info = false; | 676 | have_timing_info = false; |
@@ -693,9 +693,9 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, | |||
693 | 693 | ||
694 | switch_evsel = perf_evlist__last(evlist); | 694 | switch_evsel = perf_evlist__last(evlist); |
695 | 695 | ||
696 | switch_evsel->attr.freq = 0; | 696 | switch_evsel->core.attr.freq = 0; |
697 | switch_evsel->attr.sample_period = 1; | 697 | switch_evsel->core.attr.sample_period = 1; |
698 | switch_evsel->attr.context_switch = 1; | 698 | switch_evsel->core.attr.context_switch = 1; |
699 | 699 | ||
700 | switch_evsel->system_wide = true; | 700 | switch_evsel->system_wide = true; |
701 | switch_evsel->no_aux_samples = true; | 701 | switch_evsel->no_aux_samples = true; |
@@ -753,8 +753,8 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, | |||
753 | 753 | ||
754 | perf_evlist__set_tracking_event(evlist, tracking_evsel); | 754 | perf_evlist__set_tracking_event(evlist, tracking_evsel); |
755 | 755 | ||
756 | tracking_evsel->attr.freq = 0; | 756 | tracking_evsel->core.attr.freq = 0; |
757 | tracking_evsel->attr.sample_period = 1; | 757 | tracking_evsel->core.attr.sample_period = 1; |
758 | 758 | ||
759 | tracking_evsel->no_aux_samples = true; | 759 | tracking_evsel->no_aux_samples = true; |
760 | if (need_immediate) | 760 | if (need_immediate) |
@@ -787,7 +787,7 @@ static int intel_pt_snapshot_start(struct auxtrace_record *itr) | |||
787 | struct evsel *evsel; | 787 | struct evsel *evsel; |
788 | 788 | ||
789 | evlist__for_each_entry(ptr->evlist, evsel) { | 789 | evlist__for_each_entry(ptr->evlist, evsel) { |
790 | if (evsel->attr.type == ptr->intel_pt_pmu->type) | 790 | if (evsel->core.attr.type == ptr->intel_pt_pmu->type) |
791 | return evsel__disable(evsel); | 791 | return evsel__disable(evsel); |
792 | } | 792 | } |
793 | return -EINVAL; | 793 | return -EINVAL; |
@@ -800,7 +800,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr) | |||
800 | struct evsel *evsel; | 800 | struct evsel *evsel; |
801 | 801 | ||
802 | evlist__for_each_entry(ptr->evlist, evsel) { | 802 | evlist__for_each_entry(ptr->evlist, evsel) { |
803 | if (evsel->attr.type == ptr->intel_pt_pmu->type) | 803 | if (evsel->core.attr.type == ptr->intel_pt_pmu->type) |
804 | return evsel__enable(evsel); | 804 | return evsel__enable(evsel); |
805 | } | 805 | } |
806 | return -EINVAL; | 806 | return -EINVAL; |
@@ -1073,7 +1073,7 @@ static int intel_pt_read_finish(struct auxtrace_record *itr, int idx) | |||
1073 | struct evsel *evsel; | 1073 | struct evsel *evsel; |
1074 | 1074 | ||
1075 | evlist__for_each_entry(ptr->evlist, evsel) { | 1075 | evlist__for_each_entry(ptr->evlist, evsel) { |
1076 | if (evsel->attr.type == ptr->intel_pt_pmu->type) | 1076 | if (evsel->core.attr.type == ptr->intel_pt_pmu->type) |
1077 | return perf_evlist__enable_event_idx(ptr->evlist, evsel, | 1077 | return perf_evlist__enable_event_idx(ptr->evlist, evsel, |
1078 | idx); | 1078 | idx); |
1079 | } | 1079 | } |
diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index e4cb61dc6315..238fa3876805 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c | |||
@@ -36,7 +36,7 @@ static int __cmd_evlist(const char *file_name, struct perf_attr_details *details | |||
36 | evlist__for_each_entry(session->evlist, pos) { | 36 | evlist__for_each_entry(session->evlist, pos) { |
37 | perf_evsel__fprintf(pos, details, stdout); | 37 | perf_evsel__fprintf(pos, details, stdout); |
38 | 38 | ||
39 | if (pos->attr.type == PERF_TYPE_TRACEPOINT) | 39 | if (pos->core.attr.type == PERF_TYPE_TRACEPOINT) |
40 | has_tracepoint = true; | 40 | has_tracepoint = true; |
41 | } | 41 | } |
42 | 42 | ||
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 4e56e399bbc8..040142581d20 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -530,8 +530,8 @@ found: | |||
530 | 530 | ||
531 | sample_sw.period = sample->period; | 531 | sample_sw.period = sample->period; |
532 | sample_sw.time = sample->time; | 532 | sample_sw.time = sample->time; |
533 | perf_event__synthesize_sample(event_sw, evsel->attr.sample_type, | 533 | perf_event__synthesize_sample(event_sw, evsel->core.attr.sample_type, |
534 | evsel->attr.read_format, &sample_sw); | 534 | evsel->core.attr.read_format, &sample_sw); |
535 | build_id__mark_dso_hit(tool, event_sw, &sample_sw, evsel, machine); | 535 | build_id__mark_dso_hit(tool, event_sw, &sample_sw, evsel, machine); |
536 | return perf_event__repipe(tool, event_sw, &sample_sw, machine); | 536 | return perf_event__repipe(tool, event_sw, &sample_sw, machine); |
537 | } | 537 | } |
@@ -544,7 +544,7 @@ static void sig_handler(int sig __maybe_unused) | |||
544 | static int perf_evsel__check_stype(struct evsel *evsel, | 544 | static int perf_evsel__check_stype(struct evsel *evsel, |
545 | u64 sample_type, const char *sample_msg) | 545 | u64 sample_type, const char *sample_msg) |
546 | { | 546 | { |
547 | struct perf_event_attr *attr = &evsel->attr; | 547 | struct perf_event_attr *attr = &evsel->core.attr; |
548 | const char *name = perf_evsel__name(evsel); | 548 | const char *name = perf_evsel__name(evsel); |
549 | 549 | ||
550 | if (!(attr->sample_type & sample_type)) { | 550 | if (!(attr->sample_type & sample_type)) { |
@@ -578,8 +578,8 @@ static void strip_init(struct perf_inject *inject) | |||
578 | 578 | ||
579 | static bool has_tracking(struct evsel *evsel) | 579 | static bool has_tracking(struct evsel *evsel) |
580 | { | 580 | { |
581 | return evsel->attr.mmap || evsel->attr.mmap2 || evsel->attr.comm || | 581 | return evsel->core.attr.mmap || evsel->core.attr.mmap2 || evsel->core.attr.comm || |
582 | evsel->attr.task; | 582 | evsel->core.attr.task; |
583 | } | 583 | } |
584 | 584 | ||
585 | #define COMPAT_MASK (PERF_SAMPLE_ID | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \ | 585 | #define COMPAT_MASK (PERF_SAMPLE_ID | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \ |
@@ -603,8 +603,8 @@ static bool ok_to_remove(struct evlist *evlist, | |||
603 | evlist__for_each_entry(evlist, evsel) { | 603 | evlist__for_each_entry(evlist, evsel) { |
604 | if (evsel->handler != drop_sample) { | 604 | if (evsel->handler != drop_sample) { |
605 | cnt += 1; | 605 | cnt += 1; |
606 | if ((evsel->attr.sample_type & COMPAT_MASK) == | 606 | if ((evsel->core.attr.sample_type & COMPAT_MASK) == |
607 | (evsel_to_remove->attr.sample_type & COMPAT_MASK)) | 607 | (evsel_to_remove->core.attr.sample_type & COMPAT_MASK)) |
608 | ok = true; | 608 | ok = true; |
609 | } | 609 | } |
610 | } | 610 | } |
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 3370eba0d3f3..b9c58a5c1ba6 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -1022,7 +1022,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm) | |||
1022 | * This command processes KVM tracepoints from host only | 1022 | * This command processes KVM tracepoints from host only |
1023 | */ | 1023 | */ |
1024 | evlist__for_each_entry(evlist, pos) { | 1024 | evlist__for_each_entry(evlist, pos) { |
1025 | struct perf_event_attr *attr = &pos->attr; | 1025 | struct perf_event_attr *attr = &pos->core.attr; |
1026 | 1026 | ||
1027 | /* make sure these *are* set */ | 1027 | /* make sure these *are* set */ |
1028 | perf_evsel__set_sample_bit(pos, TID); | 1028 | perf_evsel__set_sample_bit(pos, TID); |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 778e46417f6b..b7d2c27c4164 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -732,7 +732,7 @@ static int record__open(struct record *rec) | |||
732 | pos->tracking = 0; | 732 | pos->tracking = 0; |
733 | pos = perf_evlist__last(evlist); | 733 | pos = perf_evlist__last(evlist); |
734 | pos->tracking = 1; | 734 | pos->tracking = 1; |
735 | pos->attr.enable_on_exec = 1; | 735 | pos->core.attr.enable_on_exec = 1; |
736 | } | 736 | } |
737 | 737 | ||
738 | perf_evlist__config(evlist, opts, &callchain_param); | 738 | perf_evlist__config(evlist, opts, &callchain_param); |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index d741c0aa2750..69133b35bbc1 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -345,7 +345,7 @@ static int perf_evsel__do_check_stype(struct evsel *evsel, | |||
345 | enum perf_output_field field, | 345 | enum perf_output_field field, |
346 | bool allow_user_set) | 346 | bool allow_user_set) |
347 | { | 347 | { |
348 | struct perf_event_attr *attr = &evsel->attr; | 348 | struct perf_event_attr *attr = &evsel->core.attr; |
349 | int type = output_type(attr->type); | 349 | int type = output_type(attr->type); |
350 | const char *evname; | 350 | const char *evname; |
351 | 351 | ||
@@ -383,7 +383,7 @@ static int perf_evsel__check_stype(struct evsel *evsel, | |||
383 | static int perf_evsel__check_attr(struct evsel *evsel, | 383 | static int perf_evsel__check_attr(struct evsel *evsel, |
384 | struct perf_session *session) | 384 | struct perf_session *session) |
385 | { | 385 | { |
386 | struct perf_event_attr *attr = &evsel->attr; | 386 | struct perf_event_attr *attr = &evsel->core.attr; |
387 | bool allow_user_set; | 387 | bool allow_user_set; |
388 | 388 | ||
389 | if (perf_header__has_feat(&session->header, HEADER_STAT)) | 389 | if (perf_header__has_feat(&session->header, HEADER_STAT)) |
@@ -418,7 +418,7 @@ static int perf_evsel__check_attr(struct evsel *evsel, | |||
418 | return -EINVAL; | 418 | return -EINVAL; |
419 | 419 | ||
420 | if (PRINT_FIELD(SYM) && | 420 | if (PRINT_FIELD(SYM) && |
421 | !(evsel->attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { | 421 | !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { |
422 | pr_err("Display of symbols requested but neither sample IP nor " | 422 | pr_err("Display of symbols requested but neither sample IP nor " |
423 | "sample address\navailable. Hence, no addresses to convert " | 423 | "sample address\navailable. Hence, no addresses to convert " |
424 | "to symbols.\n"); | 424 | "to symbols.\n"); |
@@ -430,7 +430,7 @@ static int perf_evsel__check_attr(struct evsel *evsel, | |||
430 | return -EINVAL; | 430 | return -EINVAL; |
431 | } | 431 | } |
432 | if (PRINT_FIELD(DSO) && | 432 | if (PRINT_FIELD(DSO) && |
433 | !(evsel->attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { | 433 | !(evsel->core.attr.sample_type & (PERF_SAMPLE_IP|PERF_SAMPLE_ADDR))) { |
434 | pr_err("Display of DSO requested but no address to convert.\n"); | 434 | pr_err("Display of DSO requested but no address to convert.\n"); |
435 | return -EINVAL; | 435 | return -EINVAL; |
436 | } | 436 | } |
@@ -531,7 +531,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
531 | if (evsel == NULL) | 531 | if (evsel == NULL) |
532 | continue; | 532 | continue; |
533 | 533 | ||
534 | set_print_ip_opts(&evsel->attr); | 534 | set_print_ip_opts(&evsel->core.attr); |
535 | } | 535 | } |
536 | 536 | ||
537 | if (!no_callchain) { | 537 | if (!no_callchain) { |
@@ -558,7 +558,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
558 | j = PERF_TYPE_TRACEPOINT; | 558 | j = PERF_TYPE_TRACEPOINT; |
559 | 559 | ||
560 | evlist__for_each_entry(session->evlist, evsel) { | 560 | evlist__for_each_entry(session->evlist, evsel) { |
561 | if (evsel->attr.type != j) | 561 | if (evsel->core.attr.type != j) |
562 | continue; | 562 | continue; |
563 | 563 | ||
564 | if (evsel__has_callchain(evsel)) { | 564 | if (evsel__has_callchain(evsel)) { |
@@ -566,7 +566,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
566 | output[j].fields |= PERF_OUTPUT_SYM; | 566 | output[j].fields |= PERF_OUTPUT_SYM; |
567 | output[j].fields |= PERF_OUTPUT_SYMOFFSET; | 567 | output[j].fields |= PERF_OUTPUT_SYMOFFSET; |
568 | output[j].fields |= PERF_OUTPUT_DSO; | 568 | output[j].fields |= PERF_OUTPUT_DSO; |
569 | set_print_ip_opts(&evsel->attr); | 569 | set_print_ip_opts(&evsel->core.attr); |
570 | goto out; | 570 | goto out; |
571 | } | 571 | } |
572 | } | 572 | } |
@@ -617,7 +617,7 @@ static int perf_sample__fprintf_start(struct perf_sample *sample, | |||
617 | struct evsel *evsel, | 617 | struct evsel *evsel, |
618 | u32 type, FILE *fp) | 618 | u32 type, FILE *fp) |
619 | { | 619 | { |
620 | struct perf_event_attr *attr = &evsel->attr; | 620 | struct perf_event_attr *attr = &evsel->core.attr; |
621 | unsigned long secs; | 621 | unsigned long secs; |
622 | unsigned long long nsecs; | 622 | unsigned long long nsecs; |
623 | int printed = 0; | 623 | int printed = 0; |
@@ -1168,7 +1168,7 @@ static const char *resolve_branch_sym(struct perf_sample *sample, | |||
1168 | u64 *ip) | 1168 | u64 *ip) |
1169 | { | 1169 | { |
1170 | struct addr_location addr_al; | 1170 | struct addr_location addr_al; |
1171 | struct perf_event_attr *attr = &evsel->attr; | 1171 | struct perf_event_attr *attr = &evsel->core.attr; |
1172 | const char *name = NULL; | 1172 | const char *name = NULL; |
1173 | 1173 | ||
1174 | if (sample->flags & (PERF_IP_FLAG_CALL | PERF_IP_FLAG_TRACE_BEGIN)) { | 1174 | if (sample->flags & (PERF_IP_FLAG_CALL | PERF_IP_FLAG_TRACE_BEGIN)) { |
@@ -1195,7 +1195,7 @@ static int perf_sample__fprintf_callindent(struct perf_sample *sample, | |||
1195 | struct thread *thread, | 1195 | struct thread *thread, |
1196 | struct addr_location *al, FILE *fp) | 1196 | struct addr_location *al, FILE *fp) |
1197 | { | 1197 | { |
1198 | struct perf_event_attr *attr = &evsel->attr; | 1198 | struct perf_event_attr *attr = &evsel->core.attr; |
1199 | size_t depth = thread_stack__depth(thread, sample->cpu); | 1199 | size_t depth = thread_stack__depth(thread, sample->cpu); |
1200 | const char *name = NULL; | 1200 | const char *name = NULL; |
1201 | static int spacing; | 1201 | static int spacing; |
@@ -1290,7 +1290,7 @@ static int perf_sample__fprintf_bts(struct perf_sample *sample, | |||
1290 | struct addr_location *al, | 1290 | struct addr_location *al, |
1291 | struct machine *machine, FILE *fp) | 1291 | struct machine *machine, FILE *fp) |
1292 | { | 1292 | { |
1293 | struct perf_event_attr *attr = &evsel->attr; | 1293 | struct perf_event_attr *attr = &evsel->core.attr; |
1294 | unsigned int type = output_type(attr->type); | 1294 | unsigned int type = output_type(attr->type); |
1295 | bool print_srcline_last = false; | 1295 | bool print_srcline_last = false; |
1296 | int printed = 0; | 1296 | int printed = 0; |
@@ -1322,7 +1322,7 @@ static int perf_sample__fprintf_bts(struct perf_sample *sample, | |||
1322 | 1322 | ||
1323 | /* print branch_to information */ | 1323 | /* print branch_to information */ |
1324 | if (PRINT_FIELD(ADDR) || | 1324 | if (PRINT_FIELD(ADDR) || |
1325 | ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && | 1325 | ((evsel->core.attr.sample_type & PERF_SAMPLE_ADDR) && |
1326 | !output[type].user_set)) { | 1326 | !output[type].user_set)) { |
1327 | printed += fprintf(fp, " => "); | 1327 | printed += fprintf(fp, " => "); |
1328 | printed += perf_sample__fprintf_addr(sample, thread, attr, fp); | 1328 | printed += perf_sample__fprintf_addr(sample, thread, attr, fp); |
@@ -1595,7 +1595,7 @@ static int perf_sample__fprintf_synth_cbr(struct perf_sample *sample, FILE *fp) | |||
1595 | static int perf_sample__fprintf_synth(struct perf_sample *sample, | 1595 | static int perf_sample__fprintf_synth(struct perf_sample *sample, |
1596 | struct evsel *evsel, FILE *fp) | 1596 | struct evsel *evsel, FILE *fp) |
1597 | { | 1597 | { |
1598 | switch (evsel->attr.config) { | 1598 | switch (evsel->core.attr.config) { |
1599 | case PERF_SYNTH_INTEL_PTWRITE: | 1599 | case PERF_SYNTH_INTEL_PTWRITE: |
1600 | return perf_sample__fprintf_synth_ptwrite(sample, fp); | 1600 | return perf_sample__fprintf_synth_ptwrite(sample, fp); |
1601 | case PERF_SYNTH_INTEL_MWAIT: | 1601 | case PERF_SYNTH_INTEL_MWAIT: |
@@ -1793,7 +1793,7 @@ static void process_event(struct perf_script *script, | |||
1793 | struct machine *machine) | 1793 | struct machine *machine) |
1794 | { | 1794 | { |
1795 | struct thread *thread = al->thread; | 1795 | struct thread *thread = al->thread; |
1796 | struct perf_event_attr *attr = &evsel->attr; | 1796 | struct perf_event_attr *attr = &evsel->core.attr; |
1797 | unsigned int type = output_type(attr->type); | 1797 | unsigned int type = output_type(attr->type); |
1798 | struct evsel_script *es = evsel->priv; | 1798 | struct evsel_script *es = evsel->priv; |
1799 | FILE *fp = es->fp; | 1799 | FILE *fp = es->fp; |
@@ -2046,18 +2046,18 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
2046 | } | 2046 | } |
2047 | } | 2047 | } |
2048 | 2048 | ||
2049 | if (evsel->attr.type >= PERF_TYPE_MAX && | 2049 | if (evsel->core.attr.type >= PERF_TYPE_MAX && |
2050 | evsel->attr.type != PERF_TYPE_SYNTH) | 2050 | evsel->core.attr.type != PERF_TYPE_SYNTH) |
2051 | return 0; | 2051 | return 0; |
2052 | 2052 | ||
2053 | evlist__for_each_entry(evlist, pos) { | 2053 | evlist__for_each_entry(evlist, pos) { |
2054 | if (pos->attr.type == evsel->attr.type && pos != evsel) | 2054 | if (pos->core.attr.type == evsel->core.attr.type && pos != evsel) |
2055 | return 0; | 2055 | return 0; |
2056 | } | 2056 | } |
2057 | 2057 | ||
2058 | set_print_ip_opts(&evsel->attr); | 2058 | set_print_ip_opts(&evsel->core.attr); |
2059 | 2059 | ||
2060 | if (evsel->attr.sample_type) | 2060 | if (evsel->core.attr.sample_type) |
2061 | err = perf_evsel__check_attr(evsel, scr->session); | 2061 | err = perf_evsel__check_attr(evsel, scr->session); |
2062 | 2062 | ||
2063 | return err; | 2063 | return err; |
@@ -2083,7 +2083,7 @@ static int process_comm_event(struct perf_tool *tool, | |||
2083 | if (perf_event__process_comm(tool, event, sample, machine) < 0) | 2083 | if (perf_event__process_comm(tool, event, sample, machine) < 0) |
2084 | goto out; | 2084 | goto out; |
2085 | 2085 | ||
2086 | if (!evsel->attr.sample_id_all) { | 2086 | if (!evsel->core.attr.sample_id_all) { |
2087 | sample->cpu = 0; | 2087 | sample->cpu = 0; |
2088 | sample->time = 0; | 2088 | sample->time = 0; |
2089 | sample->tid = event->comm.tid; | 2089 | sample->tid = event->comm.tid; |
@@ -2121,7 +2121,7 @@ static int process_namespaces_event(struct perf_tool *tool, | |||
2121 | if (perf_event__process_namespaces(tool, event, sample, machine) < 0) | 2121 | if (perf_event__process_namespaces(tool, event, sample, machine) < 0) |
2122 | goto out; | 2122 | goto out; |
2123 | 2123 | ||
2124 | if (!evsel->attr.sample_id_all) { | 2124 | if (!evsel->core.attr.sample_id_all) { |
2125 | sample->cpu = 0; | 2125 | sample->cpu = 0; |
2126 | sample->time = 0; | 2126 | sample->time = 0; |
2127 | sample->tid = event->namespaces.tid; | 2127 | sample->tid = event->namespaces.tid; |
@@ -2157,7 +2157,7 @@ static int process_fork_event(struct perf_tool *tool, | |||
2157 | return -1; | 2157 | return -1; |
2158 | } | 2158 | } |
2159 | 2159 | ||
2160 | if (!evsel->attr.sample_id_all) { | 2160 | if (!evsel->core.attr.sample_id_all) { |
2161 | sample->cpu = 0; | 2161 | sample->cpu = 0; |
2162 | sample->time = event->fork.time; | 2162 | sample->time = event->fork.time; |
2163 | sample->tid = event->fork.tid; | 2163 | sample->tid = event->fork.tid; |
@@ -2189,7 +2189,7 @@ static int process_exit_event(struct perf_tool *tool, | |||
2189 | return -1; | 2189 | return -1; |
2190 | } | 2190 | } |
2191 | 2191 | ||
2192 | if (!evsel->attr.sample_id_all) { | 2192 | if (!evsel->core.attr.sample_id_all) { |
2193 | sample->cpu = 0; | 2193 | sample->cpu = 0; |
2194 | sample->time = 0; | 2194 | sample->time = 0; |
2195 | sample->tid = event->fork.tid; | 2195 | sample->tid = event->fork.tid; |
@@ -2227,7 +2227,7 @@ static int process_mmap_event(struct perf_tool *tool, | |||
2227 | return -1; | 2227 | return -1; |
2228 | } | 2228 | } |
2229 | 2229 | ||
2230 | if (!evsel->attr.sample_id_all) { | 2230 | if (!evsel->core.attr.sample_id_all) { |
2231 | sample->cpu = 0; | 2231 | sample->cpu = 0; |
2232 | sample->time = 0; | 2232 | sample->time = 0; |
2233 | sample->tid = event->mmap.tid; | 2233 | sample->tid = event->mmap.tid; |
@@ -2261,7 +2261,7 @@ static int process_mmap2_event(struct perf_tool *tool, | |||
2261 | return -1; | 2261 | return -1; |
2262 | } | 2262 | } |
2263 | 2263 | ||
2264 | if (!evsel->attr.sample_id_all) { | 2264 | if (!evsel->core.attr.sample_id_all) { |
2265 | sample->cpu = 0; | 2265 | sample->cpu = 0; |
2266 | sample->time = 0; | 2266 | sample->time = 0; |
2267 | sample->tid = event->mmap2.tid; | 2267 | sample->tid = event->mmap2.tid; |
@@ -2360,7 +2360,7 @@ process_bpf_events(struct perf_tool *tool __maybe_unused, | |||
2360 | if (machine__process_ksymbol(machine, event, sample) < 0) | 2360 | if (machine__process_ksymbol(machine, event, sample) < 0) |
2361 | return -1; | 2361 | return -1; |
2362 | 2362 | ||
2363 | if (!evsel->attr.sample_id_all) { | 2363 | if (!evsel->core.attr.sample_id_all) { |
2364 | perf_event__fprintf(event, stdout); | 2364 | perf_event__fprintf(event, stdout); |
2365 | return 0; | 2365 | return 0; |
2366 | } | 2366 | } |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 3ba184f2e64f..8ad3643d61f9 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -391,7 +391,7 @@ static void workload_exec_failed_signal(int signo __maybe_unused, siginfo_t *inf | |||
391 | 391 | ||
392 | static bool perf_evsel__should_store_id(struct evsel *counter) | 392 | static bool perf_evsel__should_store_id(struct evsel *counter) |
393 | { | 393 | { |
394 | return STAT_RECORD || counter->attr.read_format & PERF_FORMAT_ID; | 394 | return STAT_RECORD || counter->core.attr.read_format & PERF_FORMAT_ID; |
395 | } | 395 | } |
396 | 396 | ||
397 | static bool is_target_alive(struct target *_target, | 397 | static bool is_target_alive(struct target *_target, |
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index f5f70c83d304..7d6a6ecf4e02 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -557,7 +557,7 @@ static int process_sample_event(struct perf_tool *tool, | |||
557 | { | 557 | { |
558 | struct timechart *tchart = container_of(tool, struct timechart, tool); | 558 | struct timechart *tchart = container_of(tool, struct timechart, tool); |
559 | 559 | ||
560 | if (evsel->attr.sample_type & PERF_SAMPLE_TIME) { | 560 | if (evsel->core.attr.sample_type & PERF_SAMPLE_TIME) { |
561 | if (!tchart->first_time || tchart->first_time > sample->time) | 561 | if (!tchart->first_time || tchart->first_time > sample->time) |
562 | tchart->first_time = sample->time; | 562 | tchart->first_time = sample->time; |
563 | if (tchart->last_time < sample->time) | 563 | if (tchart->last_time < sample->time) |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 3291eff13e28..54d06d271bfd 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -966,7 +966,7 @@ static int perf_top_overwrite_fallback(struct perf_top *top, | |||
966 | return 0; | 966 | return 0; |
967 | 967 | ||
968 | evlist__for_each_entry(evlist, counter) | 968 | evlist__for_each_entry(evlist, counter) |
969 | counter->attr.write_backward = false; | 969 | counter->core.attr.write_backward = false; |
970 | opts->overwrite = false; | 970 | opts->overwrite = false; |
971 | pr_debug2("fall back to non-overwrite mode\n"); | 971 | pr_debug2("fall back to non-overwrite mode\n"); |
972 | return 1; | 972 | return 1; |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 06fcd8b1f160..abfd22ff1730 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -2046,8 +2046,8 @@ static int trace__resolve_callchain(struct trace *trace, struct evsel *evsel, | |||
2046 | struct callchain_cursor *cursor) | 2046 | struct callchain_cursor *cursor) |
2047 | { | 2047 | { |
2048 | struct addr_location al; | 2048 | struct addr_location al; |
2049 | int max_stack = evsel->attr.sample_max_stack ? | 2049 | int max_stack = evsel->core.attr.sample_max_stack ? |
2050 | evsel->attr.sample_max_stack : | 2050 | evsel->core.attr.sample_max_stack : |
2051 | trace->max_stack; | 2051 | trace->max_stack; |
2052 | int err; | 2052 | int err; |
2053 | 2053 | ||
@@ -2462,7 +2462,7 @@ static int trace__pgfault(struct trace *trace, | |||
2462 | if (ttrace == NULL) | 2462 | if (ttrace == NULL) |
2463 | goto out_put; | 2463 | goto out_put; |
2464 | 2464 | ||
2465 | if (evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ) | 2465 | if (evsel->core.attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ) |
2466 | ttrace->pfmaj++; | 2466 | ttrace->pfmaj++; |
2467 | else | 2467 | else |
2468 | ttrace->pfmin++; | 2468 | ttrace->pfmin++; |
@@ -2475,7 +2475,7 @@ static int trace__pgfault(struct trace *trace, | |||
2475 | trace__fprintf_entry_head(trace, thread, 0, true, sample->time, trace->output); | 2475 | trace__fprintf_entry_head(trace, thread, 0, true, sample->time, trace->output); |
2476 | 2476 | ||
2477 | fprintf(trace->output, "%sfault [", | 2477 | fprintf(trace->output, "%sfault [", |
2478 | evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ ? | 2478 | evsel->core.attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ ? |
2479 | "maj" : "min"); | 2479 | "maj" : "min"); |
2480 | 2480 | ||
2481 | print_location(trace->output, sample, &al, false, true); | 2481 | print_location(trace->output, sample, &al, false, true); |
@@ -2523,7 +2523,7 @@ static void trace__set_base_time(struct trace *trace, | |||
2523 | * appears in our event stream (vfs_getname comes to mind). | 2523 | * appears in our event stream (vfs_getname comes to mind). |
2524 | */ | 2524 | */ |
2525 | if (trace->base_time == 0 && !trace->full_time && | 2525 | if (trace->base_time == 0 && !trace->full_time && |
2526 | (evsel->attr.sample_type & PERF_SAMPLE_TIME)) | 2526 | (evsel->core.attr.sample_type & PERF_SAMPLE_TIME)) |
2527 | trace->base_time = sample->time; | 2527 | trace->base_time = sample->time; |
2528 | } | 2528 | } |
2529 | 2529 | ||
@@ -2682,7 +2682,7 @@ static void trace__handle_event(struct trace *trace, union perf_event *event, st | |||
2682 | 2682 | ||
2683 | trace__set_base_time(trace, evsel, sample); | 2683 | trace__set_base_time(trace, evsel, sample); |
2684 | 2684 | ||
2685 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT && | 2685 | if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT && |
2686 | sample->raw_data == NULL) { | 2686 | sample->raw_data == NULL) { |
2687 | fprintf(trace->output, "%s sample with no payload for tid: %d, cpu %d, raw_size=%d, skipping...\n", | 2687 | fprintf(trace->output, "%s sample with no payload for tid: %d, cpu %d, raw_size=%d, skipping...\n", |
2688 | perf_evsel__name(evsel), sample->tid, | 2688 | perf_evsel__name(evsel), sample->tid, |
@@ -2728,7 +2728,7 @@ static int trace__add_syscall_newtp(struct trace *trace) | |||
2728 | * leading to the syscall, allow overriding that for | 2728 | * leading to the syscall, allow overriding that for |
2729 | * debugging reasons using --kernel_syscall_callchains | 2729 | * debugging reasons using --kernel_syscall_callchains |
2730 | */ | 2730 | */ |
2731 | sys_exit->attr.exclude_callchain_kernel = 1; | 2731 | sys_exit->core.attr.exclude_callchain_kernel = 1; |
2732 | } | 2732 | } |
2733 | 2733 | ||
2734 | trace->syscalls.events.sys_enter = sys_enter; | 2734 | trace->syscalls.events.sys_enter = sys_enter; |
@@ -3414,18 +3414,18 @@ static int trace__run(struct trace *trace, int argc, const char **argv) | |||
3414 | 3414 | ||
3415 | trace->multiple_threads = thread_map__pid(evlist->threads, 0) == -1 || | 3415 | trace->multiple_threads = thread_map__pid(evlist->threads, 0) == -1 || |
3416 | evlist->threads->nr > 1 || | 3416 | evlist->threads->nr > 1 || |
3417 | perf_evlist__first(evlist)->attr.inherit; | 3417 | perf_evlist__first(evlist)->core.attr.inherit; |
3418 | 3418 | ||
3419 | /* | 3419 | /* |
3420 | * Now that we already used evsel->attr to ask the kernel to setup the | 3420 | * Now that we already used evsel->core.attr to ask the kernel to setup the |
3421 | * events, lets reuse evsel->attr.sample_max_stack as the limit in | 3421 | * events, lets reuse evsel->core.attr.sample_max_stack as the limit in |
3422 | * trace__resolve_callchain(), allowing per-event max-stack settings | 3422 | * trace__resolve_callchain(), allowing per-event max-stack settings |
3423 | * to override an explicitly set --max-stack global setting. | 3423 | * to override an explicitly set --max-stack global setting. |
3424 | */ | 3424 | */ |
3425 | evlist__for_each_entry(evlist, evsel) { | 3425 | evlist__for_each_entry(evlist, evsel) { |
3426 | if (evsel__has_callchain(evsel) && | 3426 | if (evsel__has_callchain(evsel) && |
3427 | evsel->attr.sample_max_stack == 0) | 3427 | evsel->core.attr.sample_max_stack == 0) |
3428 | evsel->attr.sample_max_stack = trace->max_stack; | 3428 | evsel->core.attr.sample_max_stack = trace->max_stack; |
3429 | } | 3429 | } |
3430 | again: | 3430 | again: |
3431 | before = trace->nr_events; | 3431 | before = trace->nr_events; |
@@ -3618,10 +3618,10 @@ static int trace__replay(struct trace *trace) | |||
3618 | } | 3618 | } |
3619 | 3619 | ||
3620 | evlist__for_each_entry(session->evlist, evsel) { | 3620 | evlist__for_each_entry(session->evlist, evsel) { |
3621 | if (evsel->attr.type == PERF_TYPE_SOFTWARE && | 3621 | if (evsel->core.attr.type == PERF_TYPE_SOFTWARE && |
3622 | (evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ || | 3622 | (evsel->core.attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ || |
3623 | evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MIN || | 3623 | evsel->core.attr.config == PERF_COUNT_SW_PAGE_FAULTS_MIN || |
3624 | evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS)) | 3624 | evsel->core.attr.config == PERF_COUNT_SW_PAGE_FAULTS)) |
3625 | evsel->handler = trace__pgfault; | 3625 | evsel->handler = trace__pgfault; |
3626 | } | 3626 | } |
3627 | 3627 | ||
diff --git a/tools/perf/lib/evsel.c b/tools/perf/lib/evsel.c index 9a87e867a7ec..17cba35becc7 100644 --- a/tools/perf/lib/evsel.c +++ b/tools/perf/lib/evsel.c | |||
@@ -3,7 +3,8 @@ | |||
3 | #include <linux/list.h> | 3 | #include <linux/list.h> |
4 | #include <internal/evsel.h> | 4 | #include <internal/evsel.h> |
5 | 5 | ||
6 | void perf_evsel__init(struct perf_evsel *evsel) | 6 | void perf_evsel__init(struct perf_evsel *evsel, struct perf_event_attr *attr) |
7 | { | 7 | { |
8 | INIT_LIST_HEAD(&evsel->node); | 8 | INIT_LIST_HEAD(&evsel->node); |
9 | evsel->attr = *attr; | ||
9 | } | 10 | } |
diff --git a/tools/perf/lib/include/internal/evsel.h b/tools/perf/lib/include/internal/evsel.h index 690943d0408a..c2e0bd104c94 100644 --- a/tools/perf/lib/include/internal/evsel.h +++ b/tools/perf/lib/include/internal/evsel.h | |||
@@ -2,8 +2,12 @@ | |||
2 | #ifndef __LIBPERF_INTERNAL_EVSEL_H | 2 | #ifndef __LIBPERF_INTERNAL_EVSEL_H |
3 | #define __LIBPERF_INTERNAL_EVSEL_H | 3 | #define __LIBPERF_INTERNAL_EVSEL_H |
4 | 4 | ||
5 | #include <linux/types.h> | ||
6 | #include <linux/perf_event.h> | ||
7 | |||
5 | struct perf_evsel { | 8 | struct perf_evsel { |
6 | struct list_head node; | 9 | struct list_head node; |
10 | struct perf_event_attr attr; | ||
7 | }; | 11 | }; |
8 | 12 | ||
9 | #endif /* __LIBPERF_INTERNAL_EVSEL_H */ | 13 | #endif /* __LIBPERF_INTERNAL_EVSEL_H */ |
diff --git a/tools/perf/lib/include/perf/evsel.h b/tools/perf/lib/include/perf/evsel.h index b4d074a3684b..295583b89f46 100644 --- a/tools/perf/lib/include/perf/evsel.h +++ b/tools/perf/lib/include/perf/evsel.h | |||
@@ -5,7 +5,9 @@ | |||
5 | #include <perf/core.h> | 5 | #include <perf/core.h> |
6 | 6 | ||
7 | struct perf_evsel; | 7 | struct perf_evsel; |
8 | struct perf_event_attr; | ||
8 | 9 | ||
9 | LIBPERF_API void perf_evsel__init(struct perf_evsel *evsel); | 10 | LIBPERF_API void perf_evsel__init(struct perf_evsel *evsel, |
11 | struct perf_event_attr *attr); | ||
10 | 12 | ||
11 | #endif /* __LIBPERF_EVSEL_H */ | 13 | #endif /* __LIBPERF_EVSEL_H */ |
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index 7b26be1dfb47..131bbeec62d2 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c | |||
@@ -642,9 +642,9 @@ static int do_test_code_reading(bool try_kcore) | |||
642 | 642 | ||
643 | evsel = perf_evlist__first(evlist); | 643 | evsel = perf_evlist__first(evlist); |
644 | 644 | ||
645 | evsel->attr.comm = 1; | 645 | evsel->core.attr.comm = 1; |
646 | evsel->attr.disabled = 1; | 646 | evsel->core.attr.disabled = 1; |
647 | evsel->attr.enable_on_exec = 0; | 647 | evsel->core.attr.enable_on_exec = 0; |
648 | 648 | ||
649 | ret = evlist__open(evlist); | 649 | ret = evlist__open(evlist); |
650 | if (ret < 0) { | 650 | if (ret < 0) { |
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c index 9238180416b0..165534f62036 100644 --- a/tools/perf/tests/event-times.c +++ b/tools/perf/tests/event-times.c | |||
@@ -36,7 +36,7 @@ static int attach__enable_on_exec(struct evlist *evlist) | |||
36 | return err; | 36 | return err; |
37 | } | 37 | } |
38 | 38 | ||
39 | evsel->attr.enable_on_exec = 1; | 39 | evsel->core.attr.enable_on_exec = 1; |
40 | 40 | ||
41 | err = evlist__open(evlist); | 41 | err = evlist__open(evlist); |
42 | if (err < 0) { | 42 | if (err < 0) { |
@@ -68,7 +68,7 @@ static int attach__current_disabled(struct evlist *evlist) | |||
68 | return -1; | 68 | return -1; |
69 | } | 69 | } |
70 | 70 | ||
71 | evsel->attr.disabled = 1; | 71 | evsel->core.attr.disabled = 1; |
72 | 72 | ||
73 | err = perf_evsel__open_per_thread(evsel, threads); | 73 | err = perf_evsel__open_per_thread(evsel, threads); |
74 | if (err) { | 74 | if (err) { |
@@ -121,7 +121,7 @@ static int attach__cpu_disabled(struct evlist *evlist) | |||
121 | return -1; | 121 | return -1; |
122 | } | 122 | } |
123 | 123 | ||
124 | evsel->attr.disabled = 1; | 124 | evsel->core.attr.disabled = 1; |
125 | 125 | ||
126 | err = perf_evsel__open_per_cpu(evsel, cpus); | 126 | err = perf_evsel__open_per_cpu(evsel, cpus); |
127 | if (err) { | 127 | if (err) { |
@@ -179,7 +179,7 @@ static int test_times(int (attach)(struct evlist *), | |||
179 | } | 179 | } |
180 | 180 | ||
181 | evsel = perf_evlist__last(evlist); | 181 | evsel = perf_evlist__last(evlist); |
182 | evsel->attr.read_format |= | 182 | evsel->core.attr.read_format |= |
183 | PERF_FORMAT_TOTAL_TIME_ENABLED | | 183 | PERF_FORMAT_TOTAL_TIME_ENABLED | |
184 | PERF_FORMAT_TOTAL_TIME_RUNNING; | 184 | PERF_FORMAT_TOTAL_TIME_RUNNING; |
185 | 185 | ||
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c index 830fb3d7ea2e..4fc7b3b4e153 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c | |||
@@ -90,9 +90,9 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un | |||
90 | 90 | ||
91 | evsel = perf_evlist__first(evlist); | 91 | evsel = perf_evlist__first(evlist); |
92 | 92 | ||
93 | evsel->attr.comm = 1; | 93 | evsel->core.attr.comm = 1; |
94 | evsel->attr.disabled = 1; | 94 | evsel->core.attr.disabled = 1; |
95 | evsel->attr.enable_on_exec = 0; | 95 | evsel->core.attr.enable_on_exec = 0; |
96 | 96 | ||
97 | if (evlist__open(evlist) < 0) { | 97 | if (evlist__open(evlist) < 0) { |
98 | pr_debug("Unable to open dummy and cycles event\n"); | 98 | pr_debug("Unable to open dummy and cycles event\n"); |
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 72fbf55f4fc3..9d8eb43b12cb 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c | |||
@@ -79,7 +79,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse | |||
79 | goto out_delete_evlist; | 79 | goto out_delete_evlist; |
80 | } | 80 | } |
81 | 81 | ||
82 | evsels[i]->attr.wakeup_events = 1; | 82 | evsels[i]->core.attr.wakeup_events = 1; |
83 | perf_evsel__set_sample_id(evsels[i], false); | 83 | perf_evsel__set_sample_id(evsels[i], false); |
84 | 84 | ||
85 | evlist__add(evlist, evsels[i]); | 85 | evlist__add(evlist, evsels[i]); |
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 878140501edf..5b4a5a3dac50 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -50,10 +50,10 @@ static int test__checkevent_tracepoint(struct evlist *evlist) | |||
50 | 50 | ||
51 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 51 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
52 | TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); | 52 | TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); |
53 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); | 53 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
54 | TEST_ASSERT_VAL("wrong sample_type", | 54 | TEST_ASSERT_VAL("wrong sample_type", |
55 | PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); | 55 | PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
56 | TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); | 56 | TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); |
57 | return 0; | 57 | return 0; |
58 | } | 58 | } |
59 | 59 | ||
@@ -66,11 +66,11 @@ static int test__checkevent_tracepoint_multi(struct evlist *evlist) | |||
66 | 66 | ||
67 | evlist__for_each_entry(evlist, evsel) { | 67 | evlist__for_each_entry(evlist, evsel) { |
68 | TEST_ASSERT_VAL("wrong type", | 68 | TEST_ASSERT_VAL("wrong type", |
69 | PERF_TYPE_TRACEPOINT == evsel->attr.type); | 69 | PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
70 | TEST_ASSERT_VAL("wrong sample_type", | 70 | TEST_ASSERT_VAL("wrong sample_type", |
71 | PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); | 71 | PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
72 | TEST_ASSERT_VAL("wrong sample_period", | 72 | TEST_ASSERT_VAL("wrong sample_period", |
73 | 1 == evsel->attr.sample_period); | 73 | 1 == evsel->core.attr.sample_period); |
74 | } | 74 | } |
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
@@ -80,8 +80,8 @@ static int test__checkevent_raw(struct evlist *evlist) | |||
80 | struct evsel *evsel = perf_evlist__first(evlist); | 80 | struct evsel *evsel = perf_evlist__first(evlist); |
81 | 81 | ||
82 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 82 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
83 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 83 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
84 | TEST_ASSERT_VAL("wrong config", 0x1a == evsel->attr.config); | 84 | TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); |
85 | return 0; | 85 | return 0; |
86 | } | 86 | } |
87 | 87 | ||
@@ -90,8 +90,8 @@ static int test__checkevent_numeric(struct evlist *evlist) | |||
90 | struct evsel *evsel = perf_evlist__first(evlist); | 90 | struct evsel *evsel = perf_evlist__first(evlist); |
91 | 91 | ||
92 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 92 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
93 | TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); | 93 | TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
94 | TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); | 94 | TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
@@ -100,9 +100,9 @@ static int test__checkevent_symbolic_name(struct evlist *evlist) | |||
100 | struct evsel *evsel = perf_evlist__first(evlist); | 100 | struct evsel *evsel = perf_evlist__first(evlist); |
101 | 101 | ||
102 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 102 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
103 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 103 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
104 | TEST_ASSERT_VAL("wrong config", | 104 | TEST_ASSERT_VAL("wrong config", |
105 | PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); | 105 | PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
106 | return 0; | 106 | return 0; |
107 | } | 107 | } |
108 | 108 | ||
@@ -111,19 +111,19 @@ static int test__checkevent_symbolic_name_config(struct evlist *evlist) | |||
111 | struct evsel *evsel = perf_evlist__first(evlist); | 111 | struct evsel *evsel = perf_evlist__first(evlist); |
112 | 112 | ||
113 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 113 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
114 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 114 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
115 | TEST_ASSERT_VAL("wrong config", | 115 | TEST_ASSERT_VAL("wrong config", |
116 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 116 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
117 | /* | 117 | /* |
118 | * The period value gets configured within perf_evlist__config, | 118 | * The period value gets configured within perf_evlist__config, |
119 | * while this test executes only parse events method. | 119 | * while this test executes only parse events method. |
120 | */ | 120 | */ |
121 | TEST_ASSERT_VAL("wrong period", | 121 | TEST_ASSERT_VAL("wrong period", |
122 | 0 == evsel->attr.sample_period); | 122 | 0 == evsel->core.attr.sample_period); |
123 | TEST_ASSERT_VAL("wrong config1", | 123 | TEST_ASSERT_VAL("wrong config1", |
124 | 0 == evsel->attr.config1); | 124 | 0 == evsel->core.attr.config1); |
125 | TEST_ASSERT_VAL("wrong config2", | 125 | TEST_ASSERT_VAL("wrong config2", |
126 | 1 == evsel->attr.config2); | 126 | 1 == evsel->core.attr.config2); |
127 | return 0; | 127 | return 0; |
128 | } | 128 | } |
129 | 129 | ||
@@ -132,9 +132,9 @@ static int test__checkevent_symbolic_alias(struct evlist *evlist) | |||
132 | struct evsel *evsel = perf_evlist__first(evlist); | 132 | struct evsel *evsel = perf_evlist__first(evlist); |
133 | 133 | ||
134 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 134 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
135 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); | 135 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
136 | TEST_ASSERT_VAL("wrong config", | 136 | TEST_ASSERT_VAL("wrong config", |
137 | PERF_COUNT_SW_PAGE_FAULTS == evsel->attr.config); | 137 | PERF_COUNT_SW_PAGE_FAULTS == evsel->core.attr.config); |
138 | return 0; | 138 | return 0; |
139 | } | 139 | } |
140 | 140 | ||
@@ -143,8 +143,8 @@ static int test__checkevent_genhw(struct evlist *evlist) | |||
143 | struct evsel *evsel = perf_evlist__first(evlist); | 143 | struct evsel *evsel = perf_evlist__first(evlist); |
144 | 144 | ||
145 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 145 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
146 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->attr.type); | 146 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type); |
147 | TEST_ASSERT_VAL("wrong config", (1 << 16) == evsel->attr.config); | 147 | TEST_ASSERT_VAL("wrong config", (1 << 16) == evsel->core.attr.config); |
148 | return 0; | 148 | return 0; |
149 | } | 149 | } |
150 | 150 | ||
@@ -153,12 +153,12 @@ static int test__checkevent_breakpoint(struct evlist *evlist) | |||
153 | struct evsel *evsel = perf_evlist__first(evlist); | 153 | struct evsel *evsel = perf_evlist__first(evlist); |
154 | 154 | ||
155 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 155 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
156 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); | 156 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
157 | TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); | 157 | TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
158 | TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == | 158 | TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == |
159 | evsel->attr.bp_type); | 159 | evsel->core.attr.bp_type); |
160 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == | 160 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == |
161 | evsel->attr.bp_len); | 161 | evsel->core.attr.bp_len); |
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
164 | 164 | ||
@@ -167,11 +167,11 @@ static int test__checkevent_breakpoint_x(struct evlist *evlist) | |||
167 | struct evsel *evsel = perf_evlist__first(evlist); | 167 | struct evsel *evsel = perf_evlist__first(evlist); |
168 | 168 | ||
169 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 169 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
170 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); | 170 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
171 | TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); | 171 | TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
172 | TEST_ASSERT_VAL("wrong bp_type", | 172 | TEST_ASSERT_VAL("wrong bp_type", |
173 | HW_BREAKPOINT_X == evsel->attr.bp_type); | 173 | HW_BREAKPOINT_X == evsel->core.attr.bp_type); |
174 | TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->attr.bp_len); | 174 | TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->core.attr.bp_len); |
175 | return 0; | 175 | return 0; |
176 | } | 176 | } |
177 | 177 | ||
@@ -181,12 +181,12 @@ static int test__checkevent_breakpoint_r(struct evlist *evlist) | |||
181 | 181 | ||
182 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 182 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
183 | TEST_ASSERT_VAL("wrong type", | 183 | TEST_ASSERT_VAL("wrong type", |
184 | PERF_TYPE_BREAKPOINT == evsel->attr.type); | 184 | PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
185 | TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); | 185 | TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
186 | TEST_ASSERT_VAL("wrong bp_type", | 186 | TEST_ASSERT_VAL("wrong bp_type", |
187 | HW_BREAKPOINT_R == evsel->attr.bp_type); | 187 | HW_BREAKPOINT_R == evsel->core.attr.bp_type); |
188 | TEST_ASSERT_VAL("wrong bp_len", | 188 | TEST_ASSERT_VAL("wrong bp_len", |
189 | HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); | 189 | HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); |
190 | return 0; | 190 | return 0; |
191 | } | 191 | } |
192 | 192 | ||
@@ -196,12 +196,12 @@ static int test__checkevent_breakpoint_w(struct evlist *evlist) | |||
196 | 196 | ||
197 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 197 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
198 | TEST_ASSERT_VAL("wrong type", | 198 | TEST_ASSERT_VAL("wrong type", |
199 | PERF_TYPE_BREAKPOINT == evsel->attr.type); | 199 | PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
200 | TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); | 200 | TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
201 | TEST_ASSERT_VAL("wrong bp_type", | 201 | TEST_ASSERT_VAL("wrong bp_type", |
202 | HW_BREAKPOINT_W == evsel->attr.bp_type); | 202 | HW_BREAKPOINT_W == evsel->core.attr.bp_type); |
203 | TEST_ASSERT_VAL("wrong bp_len", | 203 | TEST_ASSERT_VAL("wrong bp_len", |
204 | HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); | 204 | HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); |
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | 207 | ||
@@ -211,12 +211,12 @@ static int test__checkevent_breakpoint_rw(struct evlist *evlist) | |||
211 | 211 | ||
212 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 212 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
213 | TEST_ASSERT_VAL("wrong type", | 213 | TEST_ASSERT_VAL("wrong type", |
214 | PERF_TYPE_BREAKPOINT == evsel->attr.type); | 214 | PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
215 | TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); | 215 | TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
216 | TEST_ASSERT_VAL("wrong bp_type", | 216 | TEST_ASSERT_VAL("wrong bp_type", |
217 | (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->attr.bp_type); | 217 | (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->core.attr.bp_type); |
218 | TEST_ASSERT_VAL("wrong bp_len", | 218 | TEST_ASSERT_VAL("wrong bp_len", |
219 | HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); | 219 | HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); |
220 | return 0; | 220 | return 0; |
221 | } | 221 | } |
222 | 222 | ||
@@ -224,10 +224,10 @@ static 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 | ||
227 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 227 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
228 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 228 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
229 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 229 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
230 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 230 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
231 | 231 | ||
232 | return test__checkevent_tracepoint(evlist); | 232 | return test__checkevent_tracepoint(evlist); |
233 | } | 233 | } |
@@ -241,11 +241,11 @@ test__checkevent_tracepoint_multi_modifier(struct evlist *evlist) | |||
241 | 241 | ||
242 | evlist__for_each_entry(evlist, evsel) { | 242 | evlist__for_each_entry(evlist, evsel) { |
243 | TEST_ASSERT_VAL("wrong exclude_user", | 243 | TEST_ASSERT_VAL("wrong exclude_user", |
244 | !evsel->attr.exclude_user); | 244 | !evsel->core.attr.exclude_user); |
245 | TEST_ASSERT_VAL("wrong exclude_kernel", | 245 | TEST_ASSERT_VAL("wrong exclude_kernel", |
246 | evsel->attr.exclude_kernel); | 246 | evsel->core.attr.exclude_kernel); |
247 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 247 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
248 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 248 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
249 | } | 249 | } |
250 | 250 | ||
251 | return test__checkevent_tracepoint_multi(evlist); | 251 | return test__checkevent_tracepoint_multi(evlist); |
@@ -255,10 +255,10 @@ static 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 | ||
258 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 258 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
259 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 259 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
260 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 260 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
261 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 261 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
262 | 262 | ||
263 | return test__checkevent_raw(evlist); | 263 | return test__checkevent_raw(evlist); |
264 | } | 264 | } |
@@ -267,10 +267,10 @@ static 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 | ||
270 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 270 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
271 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 271 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
272 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 272 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
273 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 273 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
274 | 274 | ||
275 | return test__checkevent_numeric(evlist); | 275 | return test__checkevent_numeric(evlist); |
276 | } | 276 | } |
@@ -279,10 +279,10 @@ static 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 | ||
282 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 282 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
283 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 283 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
284 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 284 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
285 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 285 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
286 | 286 | ||
287 | return test__checkevent_symbolic_name(evlist); | 287 | return test__checkevent_symbolic_name(evlist); |
288 | } | 288 | } |
@@ -291,8 +291,8 @@ static 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 | ||
294 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 294 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
295 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 295 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
296 | 296 | ||
297 | return test__checkevent_symbolic_name(evlist); | 297 | return test__checkevent_symbolic_name(evlist); |
298 | } | 298 | } |
@@ -301,8 +301,8 @@ static 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 | ||
304 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 304 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
305 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 305 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
306 | 306 | ||
307 | return test__checkevent_symbolic_name(evlist); | 307 | return test__checkevent_symbolic_name(evlist); |
308 | } | 308 | } |
@@ -311,10 +311,10 @@ static 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 | ||
314 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 314 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
315 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 315 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
316 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 316 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
317 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 317 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
318 | 318 | ||
319 | return test__checkevent_symbolic_alias(evlist); | 319 | return test__checkevent_symbolic_alias(evlist); |
320 | } | 320 | } |
@@ -323,10 +323,10 @@ static 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 | ||
326 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 326 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
327 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 327 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
328 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 328 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
329 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 329 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
330 | 330 | ||
331 | return test__checkevent_genhw(evlist); | 331 | return test__checkevent_genhw(evlist); |
332 | } | 332 | } |
@@ -335,13 +335,13 @@ static 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 | ||
338 | TEST_ASSERT_VAL("wrong exclude idle", evsel->attr.exclude_idle); | 338 | TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle); |
339 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 339 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
340 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 340 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
341 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 341 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
342 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 342 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
343 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 343 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
344 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 344 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
345 | 345 | ||
346 | return test__checkevent_symbolic_name(evlist); | 346 | return test__checkevent_symbolic_name(evlist); |
347 | } | 347 | } |
@@ -350,13 +350,13 @@ static 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 | ||
353 | TEST_ASSERT_VAL("wrong exclude idle", evsel->attr.exclude_idle); | 353 | TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle); |
354 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 354 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
355 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 355 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
356 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 356 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
357 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 357 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
358 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 358 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
359 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 359 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
360 | 360 | ||
361 | return test__checkevent_symbolic_name(evlist); | 361 | return test__checkevent_symbolic_name(evlist); |
362 | } | 362 | } |
@@ -366,10 +366,10 @@ static int test__checkevent_breakpoint_modifier(struct evlist *evlist) | |||
366 | struct evsel *evsel = perf_evlist__first(evlist); | 366 | struct evsel *evsel = perf_evlist__first(evlist); |
367 | 367 | ||
368 | 368 | ||
369 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 369 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
370 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 370 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
371 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 371 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
372 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 372 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
373 | TEST_ASSERT_VAL("wrong name", | 373 | TEST_ASSERT_VAL("wrong name", |
374 | !strcmp(perf_evsel__name(evsel), "mem:0:u")); | 374 | !strcmp(perf_evsel__name(evsel), "mem:0:u")); |
375 | 375 | ||
@@ -380,10 +380,10 @@ static 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 | ||
383 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 383 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
384 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 384 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
385 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 385 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
386 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 386 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
387 | TEST_ASSERT_VAL("wrong name", | 387 | TEST_ASSERT_VAL("wrong name", |
388 | !strcmp(perf_evsel__name(evsel), "mem:0:x:k")); | 388 | !strcmp(perf_evsel__name(evsel), "mem:0:x:k")); |
389 | 389 | ||
@@ -394,10 +394,10 @@ static 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 | ||
397 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 397 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
398 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 398 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
399 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 399 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
400 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 400 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
401 | TEST_ASSERT_VAL("wrong name", | 401 | TEST_ASSERT_VAL("wrong name", |
402 | !strcmp(perf_evsel__name(evsel), "mem:0:r:hp")); | 402 | !strcmp(perf_evsel__name(evsel), "mem:0:r:hp")); |
403 | 403 | ||
@@ -408,10 +408,10 @@ static 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 | ||
411 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 411 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
412 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 412 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
413 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 413 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
414 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 414 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
415 | TEST_ASSERT_VAL("wrong name", | 415 | TEST_ASSERT_VAL("wrong name", |
416 | !strcmp(perf_evsel__name(evsel), "mem:0:w:up")); | 416 | !strcmp(perf_evsel__name(evsel), "mem:0:w:up")); |
417 | 417 | ||
@@ -422,10 +422,10 @@ static 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 | ||
425 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 425 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
426 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 426 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
427 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 427 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
428 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 428 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
429 | TEST_ASSERT_VAL("wrong name", | 429 | TEST_ASSERT_VAL("wrong name", |
430 | !strcmp(perf_evsel__name(evsel), "mem:0:rw:kp")); | 430 | !strcmp(perf_evsel__name(evsel), "mem:0:rw:kp")); |
431 | 431 | ||
@@ -438,15 +438,15 @@ static int test__checkevent_pmu(struct evlist *evlist) | |||
438 | struct evsel *evsel = perf_evlist__first(evlist); | 438 | struct evsel *evsel = perf_evlist__first(evlist); |
439 | 439 | ||
440 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 440 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
441 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 441 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
442 | TEST_ASSERT_VAL("wrong config", 10 == evsel->attr.config); | 442 | TEST_ASSERT_VAL("wrong config", 10 == evsel->core.attr.config); |
443 | TEST_ASSERT_VAL("wrong config1", 1 == evsel->attr.config1); | 443 | TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1); |
444 | TEST_ASSERT_VAL("wrong config2", 3 == evsel->attr.config2); | 444 | TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2); |
445 | /* | 445 | /* |
446 | * The period value gets configured within perf_evlist__config, | 446 | * The period value gets configured within perf_evlist__config, |
447 | * while this test executes only parse events method. | 447 | * while this test executes only parse events method. |
448 | */ | 448 | */ |
449 | TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); | 449 | TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); |
450 | 450 | ||
451 | return 0; | 451 | return 0; |
452 | } | 452 | } |
@@ -458,34 +458,34 @@ static int test__checkevent_list(struct evlist *evlist) | |||
458 | TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); | 458 | TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); |
459 | 459 | ||
460 | /* r1 */ | 460 | /* r1 */ |
461 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 461 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
462 | TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); | 462 | TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
463 | TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1); | 463 | TEST_ASSERT_VAL("wrong config1", 0 == evsel->core.attr.config1); |
464 | TEST_ASSERT_VAL("wrong config2", 0 == evsel->attr.config2); | 464 | TEST_ASSERT_VAL("wrong config2", 0 == evsel->core.attr.config2); |
465 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 465 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
466 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 466 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
467 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 467 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
468 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 468 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
469 | 469 | ||
470 | /* syscalls:sys_enter_openat:k */ | 470 | /* syscalls:sys_enter_openat:k */ |
471 | evsel = perf_evsel__next(evsel); | 471 | evsel = perf_evsel__next(evsel); |
472 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); | 472 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
473 | TEST_ASSERT_VAL("wrong sample_type", | 473 | TEST_ASSERT_VAL("wrong sample_type", |
474 | PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); | 474 | PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
475 | TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); | 475 | TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); |
476 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 476 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
477 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 477 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
478 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 478 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
479 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 479 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
480 | 480 | ||
481 | /* 1:1:hp */ | 481 | /* 1:1:hp */ |
482 | evsel = perf_evsel__next(evsel); | 482 | evsel = perf_evsel__next(evsel); |
483 | TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); | 483 | TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
484 | TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); | 484 | TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
485 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 485 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
486 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 486 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
487 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 487 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
488 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 488 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
489 | 489 | ||
490 | return 0; | 490 | return 0; |
491 | } | 491 | } |
@@ -496,15 +496,15 @@ static int test__checkevent_pmu_name(struct evlist *evlist) | |||
496 | 496 | ||
497 | /* cpu/config=1,name=krava/u */ | 497 | /* cpu/config=1,name=krava/u */ |
498 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); | 498 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
499 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 499 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
500 | TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); | 500 | TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
501 | TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "krava")); | 501 | TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "krava")); |
502 | 502 | ||
503 | /* cpu/config=2/u" */ | 503 | /* cpu/config=2/u" */ |
504 | evsel = perf_evsel__next(evsel); | 504 | evsel = perf_evsel__next(evsel); |
505 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); | 505 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
506 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 506 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
507 | TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config); | 507 | TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); |
508 | TEST_ASSERT_VAL("wrong name", | 508 | TEST_ASSERT_VAL("wrong name", |
509 | !strcmp(perf_evsel__name(evsel), "cpu/config=2/u")); | 509 | !strcmp(perf_evsel__name(evsel), "cpu/config=2/u")); |
510 | 510 | ||
@@ -517,29 +517,29 @@ static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist) | |||
517 | 517 | ||
518 | /* cpu/config=1,call-graph=fp,time,period=100000/ */ | 518 | /* cpu/config=1,call-graph=fp,time,period=100000/ */ |
519 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); | 519 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
520 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 520 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
521 | TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); | 521 | TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
522 | /* | 522 | /* |
523 | * The period, time and callgraph value gets configured | 523 | * The period, time and callgraph value gets configured |
524 | * within perf_evlist__config, | 524 | * within perf_evlist__config, |
525 | * while this test executes only parse events method. | 525 | * while this test executes only parse events method. |
526 | */ | 526 | */ |
527 | TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); | 527 | TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); |
528 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); | 528 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); |
529 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); | 529 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); |
530 | 530 | ||
531 | /* cpu/config=2,call-graph=no,time=0,period=2000/ */ | 531 | /* cpu/config=2,call-graph=no,time=0,period=2000/ */ |
532 | evsel = perf_evsel__next(evsel); | 532 | evsel = perf_evsel__next(evsel); |
533 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 533 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
534 | TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config); | 534 | TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); |
535 | /* | 535 | /* |
536 | * The period, time and callgraph value gets configured | 536 | * The period, time and callgraph value gets configured |
537 | * within perf_evlist__config, | 537 | * within perf_evlist__config, |
538 | * while this test executes only parse events method. | 538 | * while this test executes only parse events method. |
539 | */ | 539 | */ |
540 | TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); | 540 | TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); |
541 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); | 541 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); |
542 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); | 542 | TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); |
543 | 543 | ||
544 | return 0; | 544 | return 0; |
545 | } | 545 | } |
@@ -549,14 +549,14 @@ static int test__checkevent_pmu_events(struct evlist *evlist) | |||
549 | struct evsel *evsel = perf_evlist__first(evlist); | 549 | struct evsel *evsel = perf_evlist__first(evlist); |
550 | 550 | ||
551 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 551 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
552 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 552 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
553 | TEST_ASSERT_VAL("wrong exclude_user", | 553 | TEST_ASSERT_VAL("wrong exclude_user", |
554 | !evsel->attr.exclude_user); | 554 | !evsel->core.attr.exclude_user); |
555 | TEST_ASSERT_VAL("wrong exclude_kernel", | 555 | TEST_ASSERT_VAL("wrong exclude_kernel", |
556 | evsel->attr.exclude_kernel); | 556 | evsel->core.attr.exclude_kernel); |
557 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 557 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
558 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 558 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
559 | TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); | 559 | TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
560 | 560 | ||
561 | return 0; | 561 | return 0; |
562 | } | 562 | } |
@@ -569,24 +569,24 @@ static int test__checkevent_pmu_events_mix(struct evlist *evlist) | |||
569 | /* pmu-event:u */ | 569 | /* pmu-event:u */ |
570 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); | 570 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
571 | TEST_ASSERT_VAL("wrong exclude_user", | 571 | TEST_ASSERT_VAL("wrong exclude_user", |
572 | !evsel->attr.exclude_user); | 572 | !evsel->core.attr.exclude_user); |
573 | TEST_ASSERT_VAL("wrong exclude_kernel", | 573 | TEST_ASSERT_VAL("wrong exclude_kernel", |
574 | evsel->attr.exclude_kernel); | 574 | evsel->core.attr.exclude_kernel); |
575 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 575 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
576 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 576 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
577 | TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); | 577 | TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
578 | 578 | ||
579 | /* cpu/pmu-event/u*/ | 579 | /* cpu/pmu-event/u*/ |
580 | evsel = perf_evsel__next(evsel); | 580 | evsel = perf_evsel__next(evsel); |
581 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); | 581 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
582 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 582 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
583 | TEST_ASSERT_VAL("wrong exclude_user", | 583 | TEST_ASSERT_VAL("wrong exclude_user", |
584 | !evsel->attr.exclude_user); | 584 | !evsel->core.attr.exclude_user); |
585 | TEST_ASSERT_VAL("wrong exclude_kernel", | 585 | TEST_ASSERT_VAL("wrong exclude_kernel", |
586 | evsel->attr.exclude_kernel); | 586 | evsel->core.attr.exclude_kernel); |
587 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 587 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
588 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 588 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
589 | TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); | 589 | TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
590 | 590 | ||
591 | return 0; | 591 | return 0; |
592 | } | 592 | } |
@@ -643,15 +643,15 @@ static int test__group1(struct evlist *evlist) | |||
643 | 643 | ||
644 | /* instructions:k */ | 644 | /* instructions:k */ |
645 | evsel = leader = perf_evlist__first(evlist); | 645 | evsel = leader = perf_evlist__first(evlist); |
646 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 646 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
647 | TEST_ASSERT_VAL("wrong config", | 647 | TEST_ASSERT_VAL("wrong config", |
648 | PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); | 648 | PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
649 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 649 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
650 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 650 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
651 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 651 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
652 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 652 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
653 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 653 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
654 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 654 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
655 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 655 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
656 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 656 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
657 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); | 657 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
@@ -659,16 +659,16 @@ static int test__group1(struct evlist *evlist) | |||
659 | 659 | ||
660 | /* cycles:upp */ | 660 | /* cycles:upp */ |
661 | evsel = perf_evsel__next(evsel); | 661 | evsel = perf_evsel__next(evsel); |
662 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 662 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
663 | TEST_ASSERT_VAL("wrong config", | 663 | TEST_ASSERT_VAL("wrong config", |
664 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 664 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
665 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 665 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
666 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 666 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
667 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 667 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
668 | /* use of precise requires exclude_guest */ | 668 | /* use of precise requires exclude_guest */ |
669 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 669 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
670 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 670 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
671 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); | 671 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); |
672 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 672 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
673 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 673 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
674 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); | 674 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
@@ -685,15 +685,15 @@ static int test__group2(struct evlist *evlist) | |||
685 | 685 | ||
686 | /* faults + :ku modifier */ | 686 | /* faults + :ku modifier */ |
687 | evsel = leader = perf_evlist__first(evlist); | 687 | evsel = leader = perf_evlist__first(evlist); |
688 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); | 688 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
689 | TEST_ASSERT_VAL("wrong config", | 689 | TEST_ASSERT_VAL("wrong config", |
690 | PERF_COUNT_SW_PAGE_FAULTS == evsel->attr.config); | 690 | PERF_COUNT_SW_PAGE_FAULTS == evsel->core.attr.config); |
691 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 691 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
692 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 692 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
693 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 693 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
694 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 694 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
695 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 695 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
696 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 696 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
697 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 697 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
698 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 698 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
699 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); | 699 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
@@ -701,30 +701,30 @@ static int test__group2(struct evlist *evlist) | |||
701 | 701 | ||
702 | /* cache-references + :u modifier */ | 702 | /* cache-references + :u modifier */ |
703 | evsel = perf_evsel__next(evsel); | 703 | evsel = perf_evsel__next(evsel); |
704 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 704 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
705 | TEST_ASSERT_VAL("wrong config", | 705 | TEST_ASSERT_VAL("wrong config", |
706 | PERF_COUNT_HW_CACHE_REFERENCES == evsel->attr.config); | 706 | PERF_COUNT_HW_CACHE_REFERENCES == evsel->core.attr.config); |
707 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 707 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
708 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 708 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
709 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 709 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
710 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 710 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
711 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 711 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
712 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 712 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
713 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 713 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
714 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 714 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
715 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); | 715 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
716 | 716 | ||
717 | /* cycles:k */ | 717 | /* cycles:k */ |
718 | evsel = perf_evsel__next(evsel); | 718 | evsel = perf_evsel__next(evsel); |
719 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 719 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
720 | TEST_ASSERT_VAL("wrong config", | 720 | TEST_ASSERT_VAL("wrong config", |
721 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 721 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
722 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 722 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
723 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 723 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
724 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 724 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
725 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 725 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
726 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 726 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
727 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 727 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
728 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 728 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
729 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); | 729 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
730 | 730 | ||
@@ -740,16 +740,16 @@ static int test__group3(struct evlist *evlist __maybe_unused) | |||
740 | 740 | ||
741 | /* group1 syscalls:sys_enter_openat:H */ | 741 | /* group1 syscalls:sys_enter_openat:H */ |
742 | evsel = leader = perf_evlist__first(evlist); | 742 | evsel = leader = perf_evlist__first(evlist); |
743 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); | 743 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
744 | TEST_ASSERT_VAL("wrong sample_type", | 744 | TEST_ASSERT_VAL("wrong sample_type", |
745 | PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); | 745 | PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
746 | TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); | 746 | TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); |
747 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 747 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
748 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 748 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
749 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 749 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
750 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 750 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
751 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 751 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
752 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 752 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
753 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 753 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
754 | TEST_ASSERT_VAL("wrong group name", | 754 | TEST_ASSERT_VAL("wrong group name", |
755 | !strcmp(leader->group_name, "group1")); | 755 | !strcmp(leader->group_name, "group1")); |
@@ -759,16 +759,16 @@ static int test__group3(struct evlist *evlist __maybe_unused) | |||
759 | 759 | ||
760 | /* group1 cycles:kppp */ | 760 | /* group1 cycles:kppp */ |
761 | evsel = perf_evsel__next(evsel); | 761 | evsel = perf_evsel__next(evsel); |
762 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 762 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
763 | TEST_ASSERT_VAL("wrong config", | 763 | TEST_ASSERT_VAL("wrong config", |
764 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 764 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
765 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 765 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
766 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 766 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
767 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 767 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
768 | /* use of precise requires exclude_guest */ | 768 | /* use of precise requires exclude_guest */ |
769 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 769 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
770 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 770 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
771 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 3); | 771 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 3); |
772 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 772 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
773 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 773 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
774 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 774 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
@@ -776,15 +776,15 @@ static int test__group3(struct evlist *evlist __maybe_unused) | |||
776 | 776 | ||
777 | /* group2 cycles + G modifier */ | 777 | /* group2 cycles + G modifier */ |
778 | evsel = leader = perf_evsel__next(evsel); | 778 | evsel = leader = perf_evsel__next(evsel); |
779 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 779 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
780 | TEST_ASSERT_VAL("wrong config", | 780 | TEST_ASSERT_VAL("wrong config", |
781 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 781 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
782 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 782 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
783 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 783 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
784 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 784 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
785 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 785 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
786 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 786 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
787 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 787 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
788 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 788 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
789 | TEST_ASSERT_VAL("wrong group name", | 789 | TEST_ASSERT_VAL("wrong group name", |
790 | !strcmp(leader->group_name, "group2")); | 790 | !strcmp(leader->group_name, "group2")); |
@@ -794,29 +794,29 @@ static int test__group3(struct evlist *evlist __maybe_unused) | |||
794 | 794 | ||
795 | /* group2 1:3 + G modifier */ | 795 | /* group2 1:3 + G modifier */ |
796 | evsel = perf_evsel__next(evsel); | 796 | evsel = perf_evsel__next(evsel); |
797 | TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); | 797 | TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
798 | TEST_ASSERT_VAL("wrong config", 3 == evsel->attr.config); | 798 | TEST_ASSERT_VAL("wrong config", 3 == evsel->core.attr.config); |
799 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 799 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
800 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 800 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
801 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 801 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
802 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 802 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
803 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 803 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
804 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 804 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
805 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 805 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
806 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 806 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
807 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); | 807 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
808 | 808 | ||
809 | /* instructions:u */ | 809 | /* instructions:u */ |
810 | evsel = perf_evsel__next(evsel); | 810 | evsel = perf_evsel__next(evsel); |
811 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 811 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
812 | TEST_ASSERT_VAL("wrong config", | 812 | TEST_ASSERT_VAL("wrong config", |
813 | PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); | 813 | PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
814 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 814 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
815 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 815 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
816 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 816 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
817 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 817 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
818 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 818 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
819 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 819 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
820 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 820 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
821 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); | 821 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
822 | 822 | ||
@@ -832,16 +832,16 @@ static int test__group4(struct evlist *evlist __maybe_unused) | |||
832 | 832 | ||
833 | /* cycles:u + p */ | 833 | /* cycles:u + p */ |
834 | evsel = leader = perf_evlist__first(evlist); | 834 | evsel = leader = perf_evlist__first(evlist); |
835 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 835 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
836 | TEST_ASSERT_VAL("wrong config", | 836 | TEST_ASSERT_VAL("wrong config", |
837 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 837 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
838 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 838 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
839 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 839 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
840 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 840 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
841 | /* use of precise requires exclude_guest */ | 841 | /* use of precise requires exclude_guest */ |
842 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 842 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
843 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 843 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
844 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 1); | 844 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 1); |
845 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 845 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
846 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 846 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
847 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 847 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
@@ -850,16 +850,16 @@ static int test__group4(struct evlist *evlist __maybe_unused) | |||
850 | 850 | ||
851 | /* instructions:kp + p */ | 851 | /* instructions:kp + p */ |
852 | evsel = perf_evsel__next(evsel); | 852 | evsel = perf_evsel__next(evsel); |
853 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 853 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
854 | TEST_ASSERT_VAL("wrong config", | 854 | TEST_ASSERT_VAL("wrong config", |
855 | PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); | 855 | PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
856 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 856 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
857 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 857 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
858 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 858 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
859 | /* use of precise requires exclude_guest */ | 859 | /* use of precise requires exclude_guest */ |
860 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 860 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
861 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 861 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
862 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); | 862 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); |
863 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 863 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
864 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 864 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
865 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); | 865 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
@@ -876,15 +876,15 @@ static int test__group5(struct evlist *evlist __maybe_unused) | |||
876 | 876 | ||
877 | /* cycles + G */ | 877 | /* cycles + G */ |
878 | evsel = leader = perf_evlist__first(evlist); | 878 | evsel = leader = perf_evlist__first(evlist); |
879 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 879 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
880 | TEST_ASSERT_VAL("wrong config", | 880 | TEST_ASSERT_VAL("wrong config", |
881 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 881 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
882 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 882 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
883 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 883 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
884 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 884 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
885 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 885 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
886 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 886 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
887 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 887 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
888 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 888 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
889 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 889 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
890 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 890 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
@@ -893,30 +893,30 @@ static int test__group5(struct evlist *evlist __maybe_unused) | |||
893 | 893 | ||
894 | /* instructions + G */ | 894 | /* instructions + G */ |
895 | evsel = perf_evsel__next(evsel); | 895 | evsel = perf_evsel__next(evsel); |
896 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 896 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
897 | TEST_ASSERT_VAL("wrong config", | 897 | TEST_ASSERT_VAL("wrong config", |
898 | PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); | 898 | PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
899 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 899 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
900 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 900 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
901 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 901 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
902 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 902 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
903 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 903 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
904 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 904 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
905 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 905 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
906 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 906 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
907 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); | 907 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
908 | 908 | ||
909 | /* cycles:G */ | 909 | /* cycles:G */ |
910 | evsel = leader = perf_evsel__next(evsel); | 910 | evsel = leader = perf_evsel__next(evsel); |
911 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 911 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
912 | TEST_ASSERT_VAL("wrong config", | 912 | TEST_ASSERT_VAL("wrong config", |
913 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 913 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
914 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 914 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
915 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 915 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
916 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 916 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
917 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 917 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
918 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 918 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
919 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 919 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
920 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 920 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
921 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 921 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
922 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 922 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
@@ -925,29 +925,29 @@ static int test__group5(struct evlist *evlist __maybe_unused) | |||
925 | 925 | ||
926 | /* instructions:G */ | 926 | /* instructions:G */ |
927 | evsel = perf_evsel__next(evsel); | 927 | evsel = perf_evsel__next(evsel); |
928 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 928 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
929 | TEST_ASSERT_VAL("wrong config", | 929 | TEST_ASSERT_VAL("wrong config", |
930 | PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); | 930 | PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
931 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 931 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
932 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 932 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
933 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 933 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
934 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 934 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
935 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 935 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
936 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 936 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
937 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 937 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
938 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 938 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
939 | 939 | ||
940 | /* cycles */ | 940 | /* cycles */ |
941 | evsel = perf_evsel__next(evsel); | 941 | evsel = perf_evsel__next(evsel); |
942 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 942 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
943 | TEST_ASSERT_VAL("wrong config", | 943 | TEST_ASSERT_VAL("wrong config", |
944 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 944 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
945 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 945 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
946 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 946 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
947 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 947 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
948 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 948 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
949 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 949 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
950 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 950 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
951 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 951 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
952 | 952 | ||
953 | return 0; | 953 | return 0; |
@@ -962,15 +962,15 @@ static int test__group_gh1(struct evlist *evlist) | |||
962 | 962 | ||
963 | /* cycles + :H group modifier */ | 963 | /* cycles + :H group modifier */ |
964 | evsel = leader = perf_evlist__first(evlist); | 964 | evsel = leader = perf_evlist__first(evlist); |
965 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 965 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
966 | TEST_ASSERT_VAL("wrong config", | 966 | TEST_ASSERT_VAL("wrong config", |
967 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 967 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
968 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 968 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
969 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 969 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
970 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 970 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
971 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 971 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
972 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 972 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
973 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 973 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
974 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 974 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
975 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 975 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
976 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 976 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
@@ -978,15 +978,15 @@ static int test__group_gh1(struct evlist *evlist) | |||
978 | 978 | ||
979 | /* cache-misses:G + :H group modifier */ | 979 | /* cache-misses:G + :H group modifier */ |
980 | evsel = perf_evsel__next(evsel); | 980 | evsel = perf_evsel__next(evsel); |
981 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 981 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
982 | TEST_ASSERT_VAL("wrong config", | 982 | TEST_ASSERT_VAL("wrong config", |
983 | PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); | 983 | PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
984 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 984 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
985 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 985 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
986 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 986 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
987 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 987 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
988 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 988 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
989 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 989 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
990 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 990 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
991 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 991 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
992 | 992 | ||
@@ -1002,15 +1002,15 @@ static int test__group_gh2(struct evlist *evlist) | |||
1002 | 1002 | ||
1003 | /* cycles + :G group modifier */ | 1003 | /* cycles + :G group modifier */ |
1004 | evsel = leader = perf_evlist__first(evlist); | 1004 | evsel = leader = perf_evlist__first(evlist); |
1005 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1005 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1006 | TEST_ASSERT_VAL("wrong config", | 1006 | TEST_ASSERT_VAL("wrong config", |
1007 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 1007 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
1008 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1008 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1009 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 1009 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
1010 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 1010 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
1011 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 1011 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
1012 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 1012 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
1013 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1013 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1014 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1014 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1015 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 1015 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
1016 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 1016 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
@@ -1018,15 +1018,15 @@ static int test__group_gh2(struct evlist *evlist) | |||
1018 | 1018 | ||
1019 | /* cache-misses:H + :G group modifier */ | 1019 | /* cache-misses:H + :G group modifier */ |
1020 | evsel = perf_evsel__next(evsel); | 1020 | evsel = perf_evsel__next(evsel); |
1021 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1021 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1022 | TEST_ASSERT_VAL("wrong config", | 1022 | TEST_ASSERT_VAL("wrong config", |
1023 | PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); | 1023 | PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
1024 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1024 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1025 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 1025 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
1026 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 1026 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
1027 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 1027 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
1028 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1028 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1029 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1029 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1030 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1030 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1031 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 1031 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
1032 | 1032 | ||
@@ -1042,15 +1042,15 @@ static int test__group_gh3(struct evlist *evlist) | |||
1042 | 1042 | ||
1043 | /* cycles:G + :u group modifier */ | 1043 | /* cycles:G + :u group modifier */ |
1044 | evsel = leader = perf_evlist__first(evlist); | 1044 | evsel = leader = perf_evlist__first(evlist); |
1045 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1045 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1046 | TEST_ASSERT_VAL("wrong config", | 1046 | TEST_ASSERT_VAL("wrong config", |
1047 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 1047 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
1048 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1048 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1049 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1049 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1050 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1050 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1051 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 1051 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
1052 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 1052 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
1053 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1053 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1054 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1054 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1055 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 1055 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
1056 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 1056 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
@@ -1058,15 +1058,15 @@ static int test__group_gh3(struct evlist *evlist) | |||
1058 | 1058 | ||
1059 | /* cache-misses:H + :u group modifier */ | 1059 | /* cache-misses:H + :u group modifier */ |
1060 | evsel = perf_evsel__next(evsel); | 1060 | evsel = perf_evsel__next(evsel); |
1061 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1061 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1062 | TEST_ASSERT_VAL("wrong config", | 1062 | TEST_ASSERT_VAL("wrong config", |
1063 | PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); | 1063 | PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
1064 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1064 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1065 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1065 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1066 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1066 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1067 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 1067 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
1068 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1068 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1069 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1069 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1070 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1070 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1071 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 1071 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
1072 | 1072 | ||
@@ -1082,15 +1082,15 @@ static int test__group_gh4(struct evlist *evlist) | |||
1082 | 1082 | ||
1083 | /* cycles:G + :uG group modifier */ | 1083 | /* cycles:G + :uG group modifier */ |
1084 | evsel = leader = perf_evlist__first(evlist); | 1084 | evsel = leader = perf_evlist__first(evlist); |
1085 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1085 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1086 | TEST_ASSERT_VAL("wrong config", | 1086 | TEST_ASSERT_VAL("wrong config", |
1087 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 1087 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
1088 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1088 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1089 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1089 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1090 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1090 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1091 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 1091 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
1092 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 1092 | TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
1093 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1093 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1094 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1094 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1095 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); | 1095 | TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
1096 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); | 1096 | TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
@@ -1098,15 +1098,15 @@ static int test__group_gh4(struct evlist *evlist) | |||
1098 | 1098 | ||
1099 | /* cache-misses:H + :uG group modifier */ | 1099 | /* cache-misses:H + :uG group modifier */ |
1100 | evsel = perf_evsel__next(evsel); | 1100 | evsel = perf_evsel__next(evsel); |
1101 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1101 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1102 | TEST_ASSERT_VAL("wrong config", | 1102 | TEST_ASSERT_VAL("wrong config", |
1103 | PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); | 1103 | PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
1104 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1104 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1105 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1105 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1106 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1106 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1107 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 1107 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
1108 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1108 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1109 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1109 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1110 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1110 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1111 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); | 1111 | TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
1112 | 1112 | ||
@@ -1121,44 +1121,44 @@ static int test__leader_sample1(struct evlist *evlist) | |||
1121 | 1121 | ||
1122 | /* cycles - sampling group leader */ | 1122 | /* cycles - sampling group leader */ |
1123 | evsel = leader = perf_evlist__first(evlist); | 1123 | evsel = leader = perf_evlist__first(evlist); |
1124 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1124 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1125 | TEST_ASSERT_VAL("wrong config", | 1125 | TEST_ASSERT_VAL("wrong config", |
1126 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 1126 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
1127 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1127 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1128 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 1128 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
1129 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 1129 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
1130 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 1130 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
1131 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1131 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1132 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1132 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1133 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1133 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1134 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1134 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1135 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); | 1135 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
1136 | 1136 | ||
1137 | /* cache-misses - not sampling */ | 1137 | /* cache-misses - not sampling */ |
1138 | evsel = perf_evsel__next(evsel); | 1138 | evsel = perf_evsel__next(evsel); |
1139 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1139 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1140 | TEST_ASSERT_VAL("wrong config", | 1140 | TEST_ASSERT_VAL("wrong config", |
1141 | PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); | 1141 | PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
1142 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1142 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1143 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 1143 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
1144 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 1144 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
1145 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 1145 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
1146 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1146 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1147 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1147 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1148 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1148 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1149 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); | 1149 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
1150 | 1150 | ||
1151 | /* branch-misses - not sampling */ | 1151 | /* branch-misses - not sampling */ |
1152 | evsel = perf_evsel__next(evsel); | 1152 | evsel = perf_evsel__next(evsel); |
1153 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1153 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1154 | TEST_ASSERT_VAL("wrong config", | 1154 | TEST_ASSERT_VAL("wrong config", |
1155 | PERF_COUNT_HW_BRANCH_MISSES == evsel->attr.config); | 1155 | PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); |
1156 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1156 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1157 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); | 1157 | TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
1158 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 1158 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
1159 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 1159 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
1160 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1160 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1161 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1161 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1162 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1162 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1163 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1163 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1164 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); | 1164 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
@@ -1174,30 +1174,30 @@ static int test__leader_sample2(struct evlist *evlist __maybe_unused) | |||
1174 | 1174 | ||
1175 | /* instructions - sampling group leader */ | 1175 | /* instructions - sampling group leader */ |
1176 | evsel = leader = perf_evlist__first(evlist); | 1176 | evsel = leader = perf_evlist__first(evlist); |
1177 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1177 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1178 | TEST_ASSERT_VAL("wrong config", | 1178 | TEST_ASSERT_VAL("wrong config", |
1179 | PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); | 1179 | PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
1180 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1180 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1181 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1181 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1182 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1182 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1183 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 1183 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
1184 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1184 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1185 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1185 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1186 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1186 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1187 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1187 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1188 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); | 1188 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
1189 | 1189 | ||
1190 | /* branch-misses - not sampling */ | 1190 | /* branch-misses - not sampling */ |
1191 | evsel = perf_evsel__next(evsel); | 1191 | evsel = perf_evsel__next(evsel); |
1192 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1192 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1193 | TEST_ASSERT_VAL("wrong config", | 1193 | TEST_ASSERT_VAL("wrong config", |
1194 | PERF_COUNT_HW_BRANCH_MISSES == evsel->attr.config); | 1194 | PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); |
1195 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1195 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1196 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1196 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1197 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1197 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1198 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 1198 | TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
1199 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 1199 | TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
1200 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1200 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1201 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1201 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1202 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1202 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1203 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); | 1203 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
@@ -1209,11 +1209,11 @@ static 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 | ||
1212 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1212 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1213 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1213 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1214 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1214 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1215 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 1215 | TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
1216 | TEST_ASSERT_VAL("wrong pinned", evsel->attr.pinned); | 1216 | TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned); |
1217 | 1217 | ||
1218 | return test__checkevent_symbolic_name(evlist); | 1218 | return test__checkevent_symbolic_name(evlist); |
1219 | } | 1219 | } |
@@ -1226,25 +1226,25 @@ static int test__pinned_group(struct evlist *evlist) | |||
1226 | 1226 | ||
1227 | /* cycles - group leader */ | 1227 | /* cycles - group leader */ |
1228 | evsel = leader = perf_evlist__first(evlist); | 1228 | evsel = leader = perf_evlist__first(evlist); |
1229 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1229 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1230 | TEST_ASSERT_VAL("wrong config", | 1230 | TEST_ASSERT_VAL("wrong config", |
1231 | PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); | 1231 | PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
1232 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 1232 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
1233 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); | 1233 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
1234 | TEST_ASSERT_VAL("wrong pinned", evsel->attr.pinned); | 1234 | TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned); |
1235 | 1235 | ||
1236 | /* cache-misses - can not be pinned, but will go on with the leader */ | 1236 | /* cache-misses - can not be pinned, but will go on with the leader */ |
1237 | evsel = perf_evsel__next(evsel); | 1237 | evsel = perf_evsel__next(evsel); |
1238 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); | 1238 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1239 | TEST_ASSERT_VAL("wrong config", | 1239 | TEST_ASSERT_VAL("wrong config", |
1240 | PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); | 1240 | PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
1241 | TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); | 1241 | TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
1242 | 1242 | ||
1243 | /* branch-misses - ditto */ | 1243 | /* branch-misses - ditto */ |
1244 | evsel = perf_evsel__next(evsel); | 1244 | evsel = perf_evsel__next(evsel); |
1245 | TEST_ASSERT_VAL("wrong config", | 1245 | TEST_ASSERT_VAL("wrong config", |
1246 | PERF_COUNT_HW_BRANCH_MISSES == evsel->attr.config); | 1246 | PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); |
1247 | TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); | 1247 | TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
1248 | 1248 | ||
1249 | return 0; | 1249 | return 0; |
1250 | } | 1250 | } |
@@ -1254,12 +1254,12 @@ static int test__checkevent_breakpoint_len(struct evlist *evlist) | |||
1254 | struct evsel *evsel = perf_evlist__first(evlist); | 1254 | struct evsel *evsel = perf_evlist__first(evlist); |
1255 | 1255 | ||
1256 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 1256 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
1257 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); | 1257 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
1258 | TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); | 1258 | TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
1259 | TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == | 1259 | TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == |
1260 | evsel->attr.bp_type); | 1260 | evsel->core.attr.bp_type); |
1261 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_1 == | 1261 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_1 == |
1262 | evsel->attr.bp_len); | 1262 | evsel->core.attr.bp_len); |
1263 | 1263 | ||
1264 | return 0; | 1264 | return 0; |
1265 | } | 1265 | } |
@@ -1269,12 +1269,12 @@ static int test__checkevent_breakpoint_len_w(struct evlist *evlist) | |||
1269 | struct evsel *evsel = perf_evlist__first(evlist); | 1269 | struct evsel *evsel = perf_evlist__first(evlist); |
1270 | 1270 | ||
1271 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); | 1271 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
1272 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); | 1272 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
1273 | TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); | 1273 | TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
1274 | TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_W == | 1274 | TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_W == |
1275 | evsel->attr.bp_type); | 1275 | evsel->core.attr.bp_type); |
1276 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_2 == | 1276 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_2 == |
1277 | evsel->attr.bp_len); | 1277 | evsel->core.attr.bp_len); |
1278 | 1278 | ||
1279 | return 0; | 1279 | return 0; |
1280 | } | 1280 | } |
@@ -1284,10 +1284,10 @@ test__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 | ||
1287 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 1287 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
1288 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1288 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1289 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 1289 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
1290 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 1290 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
1291 | 1291 | ||
1292 | return test__checkevent_breakpoint_rw(evlist); | 1292 | return test__checkevent_breakpoint_rw(evlist); |
1293 | } | 1293 | } |
@@ -1297,9 +1297,9 @@ static int test__checkevent_precise_max_modifier(struct evlist *evlist) | |||
1297 | struct evsel *evsel = perf_evlist__first(evlist); | 1297 | struct evsel *evsel = perf_evlist__first(evlist); |
1298 | 1298 | ||
1299 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); | 1299 | TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
1300 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); | 1300 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
1301 | TEST_ASSERT_VAL("wrong config", | 1301 | TEST_ASSERT_VAL("wrong config", |
1302 | PERF_COUNT_SW_TASK_CLOCK == evsel->attr.config); | 1302 | PERF_COUNT_SW_TASK_CLOCK == evsel->core.attr.config); |
1303 | return 0; | 1303 | return 0; |
1304 | } | 1304 | } |
1305 | 1305 | ||
@@ -1360,9 +1360,9 @@ static 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 | ||
1363 | TEST_ASSERT_VAL("wrong type", evsel->attr.type == PERF_TYPE_HARDWARE); | 1363 | TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); |
1364 | TEST_ASSERT_VAL("wrong config", evsel->attr.config == PERF_COUNT_HW_CPU_CYCLES); | 1364 | TEST_ASSERT_VAL("wrong config", evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES); |
1365 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 1365 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
1366 | return 0; | 1366 | return 0; |
1367 | } | 1367 | } |
1368 | 1368 | ||
@@ -1370,9 +1370,9 @@ static 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 | ||
1373 | TEST_ASSERT_VAL("wrong type", evsel->attr.type == PERF_TYPE_HARDWARE); | 1373 | TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); |
1374 | TEST_ASSERT_VAL("wrong config", evsel->attr.config == PERF_COUNT_HW_CPU_CYCLES); | 1374 | TEST_ASSERT_VAL("wrong config", evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES); |
1375 | TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); | 1375 | TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
1376 | return 0; | 1376 | return 0; |
1377 | } | 1377 | } |
1378 | 1378 | ||
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index a8cd3ed3c116..a8ca29fe172b 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c | |||
@@ -155,9 +155,11 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format) | |||
155 | { | 155 | { |
156 | struct evsel evsel = { | 156 | struct evsel evsel = { |
157 | .needs_swap = false, | 157 | .needs_swap = false, |
158 | .attr = { | 158 | .core = { |
159 | .sample_type = sample_type, | 159 | . attr = { |
160 | .read_format = read_format, | 160 | .sample_type = sample_type, |
161 | .read_format = read_format, | ||
162 | }, | ||
161 | }, | 163 | }, |
162 | }; | 164 | }; |
163 | union perf_event *event; | 165 | union perf_event *event; |
@@ -221,10 +223,10 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format) | |||
221 | int err, ret = -1; | 223 | int err, ret = -1; |
222 | 224 | ||
223 | if (sample_type & PERF_SAMPLE_REGS_USER) | 225 | if (sample_type & PERF_SAMPLE_REGS_USER) |
224 | evsel.attr.sample_regs_user = sample_regs; | 226 | evsel.core.attr.sample_regs_user = sample_regs; |
225 | 227 | ||
226 | if (sample_type & PERF_SAMPLE_REGS_INTR) | 228 | if (sample_type & PERF_SAMPLE_REGS_INTR) |
227 | evsel.attr.sample_regs_intr = sample_regs; | 229 | evsel.core.attr.sample_regs_intr = sample_regs; |
228 | 230 | ||
229 | for (i = 0; i < sizeof(regs); i++) | 231 | for (i = 0; i < sizeof(regs); i++) |
230 | *(i + (u8 *)regs) = i & 0xfe; | 232 | *(i + (u8 *)regs) = i & 0xfe; |
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 0935a5a1ecaa..dd07acced4af 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c | |||
@@ -420,8 +420,8 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ | |||
420 | 420 | ||
421 | perf_evlist__set_tracking_event(evlist, tracking_evsel); | 421 | perf_evlist__set_tracking_event(evlist, tracking_evsel); |
422 | 422 | ||
423 | tracking_evsel->attr.freq = 0; | 423 | tracking_evsel->core.attr.freq = 0; |
424 | tracking_evsel->attr.sample_period = 1; | 424 | tracking_evsel->core.attr.sample_period = 1; |
425 | 425 | ||
426 | perf_evsel__set_sample_bit(tracking_evsel, TIME); | 426 | perf_evsel__set_sample_bit(tracking_evsel, TIME); |
427 | 427 | ||
@@ -435,7 +435,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ | |||
435 | } | 435 | } |
436 | 436 | ||
437 | /* Check tracking event is tracking */ | 437 | /* Check tracking event is tracking */ |
438 | if (!tracking_evsel->attr.mmap || !tracking_evsel->attr.comm) { | 438 | if (!tracking_evsel->core.attr.mmap || !tracking_evsel->core.attr.comm) { |
439 | pr_debug("Tracking event not tracking\n"); | 439 | pr_debug("Tracking event not tracking\n"); |
440 | goto out_err; | 440 | goto out_err; |
441 | } | 441 | } |
@@ -443,7 +443,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ | |||
443 | /* Check non-tracking events are not tracking */ | 443 | /* Check non-tracking events are not tracking */ |
444 | evlist__for_each_entry(evlist, evsel) { | 444 | evlist__for_each_entry(evlist, evsel) { |
445 | if (evsel != tracking_evsel) { | 445 | if (evsel != tracking_evsel) { |
446 | if (evsel->attr.mmap || evsel->attr.comm) { | 446 | if (evsel->core.attr.mmap || evsel->core.attr.comm) { |
447 | pr_debug("Non-tracking event is tracking\n"); | 447 | pr_debug("Non-tracking event is tracking\n"); |
448 | goto out_err; | 448 | goto out_err; |
449 | } | 449 | } |
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index 24257285844b..b0192ea636a7 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c | |||
@@ -84,16 +84,16 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused | |||
84 | } | 84 | } |
85 | 85 | ||
86 | evsel = perf_evlist__first(evlist); | 86 | evsel = perf_evlist__first(evlist); |
87 | evsel->attr.task = 1; | 87 | evsel->core.attr.task = 1; |
88 | #ifdef __s390x__ | 88 | #ifdef __s390x__ |
89 | evsel->attr.sample_freq = 1000000; | 89 | evsel->core.attr.sample_freq = 1000000; |
90 | #else | 90 | #else |
91 | evsel->attr.sample_freq = 1; | 91 | evsel->core.attr.sample_freq = 1; |
92 | #endif | 92 | #endif |
93 | evsel->attr.inherit = 0; | 93 | evsel->core.attr.inherit = 0; |
94 | evsel->attr.watermark = 0; | 94 | evsel->core.attr.watermark = 0; |
95 | evsel->attr.wakeup_events = 1; | 95 | evsel->core.attr.wakeup_events = 1; |
96 | evsel->attr.exclude_kernel = 1; | 96 | evsel->core.attr.exclude_kernel = 1; |
97 | 97 | ||
98 | err = evlist__open(evlist); | 98 | err = evlist__open(evlist); |
99 | if (err < 0) { | 99 | if (err < 0) { |
diff --git a/tools/perf/ui/browsers/res_sample.c b/tools/perf/ui/browsers/res_sample.c index 7f3576deafd7..08897bd5eb0f 100644 --- a/tools/perf/ui/browsers/res_sample.c +++ b/tools/perf/ui/browsers/res_sample.c | |||
@@ -66,7 +66,7 @@ int res_sample_browse(struct res_sample *res_samples, int num_res, | |||
66 | 66 | ||
67 | timestamp__scnprintf_nsec(r->time, tsample, sizeof tsample); | 67 | timestamp__scnprintf_nsec(r->time, tsample, sizeof tsample); |
68 | 68 | ||
69 | attr_to_script(extra_format, &evsel->attr); | 69 | attr_to_script(extra_format, &evsel->core.attr); |
70 | 70 | ||
71 | if (asprintf(&cmd, "%s script %s%s --time %s %s%s %s%s --ns %s %s %s %s %s | less +/%s", | 71 | if (asprintf(&cmd, "%s script %s%s --time %s %s%s %s%s --ns %s %s %s %s %s | less +/%s", |
72 | perf, | 72 | perf, |
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c index c0462457e9f9..04f9aff5621e 100644 --- a/tools/perf/ui/browsers/scripts.c +++ b/tools/perf/ui/browsers/scripts.c | |||
@@ -100,7 +100,7 @@ static int list_scripts(char *script_name, bool *custom, | |||
100 | return -1; | 100 | return -1; |
101 | 101 | ||
102 | if (evsel) | 102 | if (evsel) |
103 | attr_to_script(scriptc.extra_format, &evsel->attr); | 103 | attr_to_script(scriptc.extra_format, &evsel->core.attr); |
104 | add_script_option("Show individual samples", "", &scriptc); | 104 | add_script_option("Show individual samples", "", &scriptc); |
105 | add_script_option("Show individual samples with assembler", "-F +insn --xed", | 105 | add_script_option("Show individual samples with assembler", "-F +insn --xed", |
106 | &scriptc); | 106 | &scriptc); |
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 9ec2841ddec4..843959f85d6f 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c | |||
@@ -2140,7 +2140,7 @@ static struct perf_pmu *perf_evsel__find_pmu(struct evsel *evsel) | |||
2140 | struct perf_pmu *pmu = NULL; | 2140 | struct perf_pmu *pmu = NULL; |
2141 | 2141 | ||
2142 | while ((pmu = perf_pmu__scan(pmu)) != NULL) { | 2142 | while ((pmu = perf_pmu__scan(pmu)) != NULL) { |
2143 | if (pmu->type == evsel->attr.type) | 2143 | if (pmu->type == evsel->core.attr.type) |
2144 | break; | 2144 | break; |
2145 | } | 2145 | } |
2146 | 2146 | ||
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index b0696726ab76..4df8bdea14ac 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c | |||
@@ -1421,7 +1421,7 @@ apply_config_evsel_for_key(const char *name, int map_fd, void *pkey, | |||
1421 | return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM; | 1421 | return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM; |
1422 | } | 1422 | } |
1423 | 1423 | ||
1424 | attr = &evsel->attr; | 1424 | attr = &evsel->core.attr; |
1425 | if (attr->inherit) { | 1425 | if (attr->inherit) { |
1426 | pr_debug("ERROR: Can't put inherit event into map %s\n", name); | 1426 | pr_debug("ERROR: Can't put inherit event into map %s\n", name); |
1427 | return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH; | 1427 | return -BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH; |
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index c1df366f4519..ed6f7fd5b90b 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c | |||
@@ -1230,7 +1230,7 @@ static int cs_etm__synth_events(struct cs_etm_auxtrace *etm, | |||
1230 | int err; | 1230 | int err; |
1231 | 1231 | ||
1232 | evlist__for_each_entry(evlist, evsel) { | 1232 | evlist__for_each_entry(evlist, evsel) { |
1233 | if (evsel->attr.type == etm->pmu_type) { | 1233 | if (evsel->core.attr.type == etm->pmu_type) { |
1234 | found = true; | 1234 | found = true; |
1235 | break; | 1235 | break; |
1236 | } | 1236 | } |
@@ -1244,7 +1244,7 @@ static int cs_etm__synth_events(struct cs_etm_auxtrace *etm, | |||
1244 | memset(&attr, 0, sizeof(struct perf_event_attr)); | 1244 | memset(&attr, 0, sizeof(struct perf_event_attr)); |
1245 | attr.size = sizeof(struct perf_event_attr); | 1245 | attr.size = sizeof(struct perf_event_attr); |
1246 | attr.type = PERF_TYPE_HARDWARE; | 1246 | attr.type = PERF_TYPE_HARDWARE; |
1247 | attr.sample_type = evsel->attr.sample_type & PERF_SAMPLE_MASK; | 1247 | attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK; |
1248 | attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID | | 1248 | attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID | |
1249 | PERF_SAMPLE_PERIOD; | 1249 | PERF_SAMPLE_PERIOD; |
1250 | if (etm->timeless_decoding) | 1250 | if (etm->timeless_decoding) |
@@ -1252,13 +1252,13 @@ static int cs_etm__synth_events(struct cs_etm_auxtrace *etm, | |||
1252 | else | 1252 | else |
1253 | attr.sample_type |= PERF_SAMPLE_TIME; | 1253 | attr.sample_type |= PERF_SAMPLE_TIME; |
1254 | 1254 | ||
1255 | attr.exclude_user = evsel->attr.exclude_user; | 1255 | attr.exclude_user = evsel->core.attr.exclude_user; |
1256 | attr.exclude_kernel = evsel->attr.exclude_kernel; | 1256 | attr.exclude_kernel = evsel->core.attr.exclude_kernel; |
1257 | attr.exclude_hv = evsel->attr.exclude_hv; | 1257 | attr.exclude_hv = evsel->core.attr.exclude_hv; |
1258 | attr.exclude_host = evsel->attr.exclude_host; | 1258 | attr.exclude_host = evsel->core.attr.exclude_host; |
1259 | attr.exclude_guest = evsel->attr.exclude_guest; | 1259 | attr.exclude_guest = evsel->core.attr.exclude_guest; |
1260 | attr.sample_id_all = evsel->attr.sample_id_all; | 1260 | attr.sample_id_all = evsel->core.attr.sample_id_all; |
1261 | attr.read_format = evsel->attr.read_format; | 1261 | attr.read_format = evsel->core.attr.read_format; |
1262 | 1262 | ||
1263 | /* create new id val to be a fixed offset from evsel id */ | 1263 | /* create new id val to be a fixed offset from evsel id */ |
1264 | id = evsel->id[0] + 1000000000; | 1264 | id = evsel->id[0] + 1000000000; |
@@ -2303,7 +2303,7 @@ static bool cs_etm__is_timeless_decoding(struct cs_etm_auxtrace *etm) | |||
2303 | * with the time bit set. | 2303 | * with the time bit set. |
2304 | */ | 2304 | */ |
2305 | evlist__for_each_entry(evlist, evsel) { | 2305 | evlist__for_each_entry(evlist, evsel) { |
2306 | if ((evsel->attr.sample_type & PERF_SAMPLE_TIME)) | 2306 | if ((evsel->core.attr.sample_type & PERF_SAMPLE_TIME)) |
2307 | timeless_decoding = false; | 2307 | timeless_decoding = false; |
2308 | } | 2308 | } |
2309 | 2309 | ||
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index ca30bb25b3c5..0c268449959c 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c | |||
@@ -587,7 +587,7 @@ static int add_generic_values(struct ctf_writer *cw, | |||
587 | struct evsel *evsel, | 587 | struct evsel *evsel, |
588 | struct perf_sample *sample) | 588 | struct perf_sample *sample) |
589 | { | 589 | { |
590 | u64 type = evsel->attr.sample_type; | 590 | u64 type = evsel->core.attr.sample_type; |
591 | int ret; | 591 | int ret; |
592 | 592 | ||
593 | /* | 593 | /* |
@@ -757,7 +757,7 @@ static int get_sample_cpu(struct ctf_writer *cw, struct perf_sample *sample, | |||
757 | { | 757 | { |
758 | int cpu = 0; | 758 | int cpu = 0; |
759 | 759 | ||
760 | if (evsel->attr.sample_type & PERF_SAMPLE_CPU) | 760 | if (evsel->core.attr.sample_type & PERF_SAMPLE_CPU) |
761 | cpu = sample->cpu; | 761 | cpu = sample->cpu; |
762 | 762 | ||
763 | if (cpu > cw->stream_cnt) { | 763 | if (cpu > cw->stream_cnt) { |
@@ -795,7 +795,7 @@ static int process_sample_event(struct perf_tool *tool, | |||
795 | struct bt_ctf_event_class *event_class; | 795 | struct bt_ctf_event_class *event_class; |
796 | struct bt_ctf_event *event; | 796 | struct bt_ctf_event *event; |
797 | int ret; | 797 | int ret; |
798 | unsigned long type = evsel->attr.sample_type; | 798 | unsigned long type = evsel->core.attr.sample_type; |
799 | 799 | ||
800 | if (WARN_ONCE(!priv, "Failed to setup all events.\n")) | 800 | if (WARN_ONCE(!priv, "Failed to setup all events.\n")) |
801 | return 0; | 801 | return 0; |
@@ -820,7 +820,7 @@ static int process_sample_event(struct perf_tool *tool, | |||
820 | if (ret) | 820 | if (ret) |
821 | return -1; | 821 | return -1; |
822 | 822 | ||
823 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT) { | 823 | if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) { |
824 | ret = add_tracepoint_values(cw, event_class, event, | 824 | ret = add_tracepoint_values(cw, event_class, event, |
825 | evsel, sample); | 825 | evsel, sample); |
826 | if (ret) | 826 | if (ret) |
@@ -1087,7 +1087,7 @@ static int add_bpf_output_types(struct ctf_writer *cw, | |||
1087 | static int add_generic_types(struct ctf_writer *cw, struct evsel *evsel, | 1087 | static int add_generic_types(struct ctf_writer *cw, struct evsel *evsel, |
1088 | struct bt_ctf_event_class *event_class) | 1088 | struct bt_ctf_event_class *event_class) |
1089 | { | 1089 | { |
1090 | u64 type = evsel->attr.sample_type; | 1090 | u64 type = evsel->core.attr.sample_type; |
1091 | 1091 | ||
1092 | /* | 1092 | /* |
1093 | * missing: | 1093 | * missing: |
@@ -1157,7 +1157,7 @@ static int add_event(struct ctf_writer *cw, struct evsel *evsel) | |||
1157 | const char *name = perf_evsel__name(evsel); | 1157 | const char *name = perf_evsel__name(evsel); |
1158 | int ret; | 1158 | int ret; |
1159 | 1159 | ||
1160 | pr("Adding event '%s' (type %d)\n", name, evsel->attr.type); | 1160 | pr("Adding event '%s' (type %d)\n", name, evsel->core.attr.type); |
1161 | 1161 | ||
1162 | event_class = bt_ctf_event_class_create(name); | 1162 | event_class = bt_ctf_event_class_create(name); |
1163 | if (!event_class) | 1163 | if (!event_class) |
@@ -1167,7 +1167,7 @@ static int add_event(struct ctf_writer *cw, struct evsel *evsel) | |||
1167 | if (ret) | 1167 | if (ret) |
1168 | goto err; | 1168 | goto err; |
1169 | 1169 | ||
1170 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT) { | 1170 | if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) { |
1171 | ret = add_tracepoint_types(cw, evsel, event_class); | 1171 | ret = add_tracepoint_types(cw, evsel, event_class); |
1172 | if (ret) | 1172 | if (ret) |
1173 | goto err; | 1173 | goto err; |
diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index dc2d4de772e3..701e9f814313 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c | |||
@@ -388,8 +388,8 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, | |||
388 | } | 388 | } |
389 | } | 389 | } |
390 | 390 | ||
391 | if ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && | 391 | if ((evsel->core.attr.sample_type & PERF_SAMPLE_ADDR) && |
392 | sample_addr_correlates_sym(&evsel->attr)) { | 392 | sample_addr_correlates_sym(&evsel->core.attr)) { |
393 | struct addr_location addr_al; | 393 | struct addr_location addr_al; |
394 | 394 | ||
395 | thread__resolve(thread, &addr_al, sample); | 395 | thread__resolve(thread, &addr_al, sample); |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index ce9f52215d60..ae75777a0ba4 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -299,8 +299,8 @@ perf_evlist__find_tracepoint_by_id(struct evlist *evlist, int id) | |||
299 | struct evsel *evsel; | 299 | struct evsel *evsel; |
300 | 300 | ||
301 | evlist__for_each_entry(evlist, evsel) { | 301 | evlist__for_each_entry(evlist, evsel) { |
302 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT && | 302 | if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT && |
303 | (int)evsel->attr.config == id) | 303 | (int)evsel->core.attr.config == id) |
304 | return evsel; | 304 | return evsel; |
305 | } | 305 | } |
306 | 306 | ||
@@ -314,7 +314,7 @@ perf_evlist__find_tracepoint_by_name(struct evlist *evlist, | |||
314 | struct evsel *evsel; | 314 | struct evsel *evsel; |
315 | 315 | ||
316 | evlist__for_each_entry(evlist, evsel) { | 316 | evlist__for_each_entry(evlist, evsel) { |
317 | if ((evsel->attr.type == PERF_TYPE_TRACEPOINT) && | 317 | if ((evsel->core.attr.type == PERF_TYPE_TRACEPOINT) && |
318 | (strcmp(evsel->name, name) == 0)) | 318 | (strcmp(evsel->name, name) == 0)) |
319 | return evsel; | 319 | return evsel; |
320 | } | 320 | } |
@@ -529,13 +529,13 @@ int perf_evlist__id_add_fd(struct evlist *evlist, | |||
529 | if (perf_evlist__read_format(evlist) & PERF_FORMAT_GROUP) | 529 | if (perf_evlist__read_format(evlist) & PERF_FORMAT_GROUP) |
530 | return -1; | 530 | return -1; |
531 | 531 | ||
532 | if (!(evsel->attr.read_format & PERF_FORMAT_ID) || | 532 | if (!(evsel->core.attr.read_format & PERF_FORMAT_ID) || |
533 | read(fd, &read_data, sizeof(read_data)) == -1) | 533 | read(fd, &read_data, sizeof(read_data)) == -1) |
534 | return -1; | 534 | return -1; |
535 | 535 | ||
536 | if (evsel->attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) | 536 | if (evsel->core.attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) |
537 | ++id_idx; | 537 | ++id_idx; |
538 | if (evsel->attr.read_format & PERF_FORMAT_TOTAL_TIME_RUNNING) | 538 | if (evsel->core.attr.read_format & PERF_FORMAT_TOTAL_TIME_RUNNING) |
539 | ++id_idx; | 539 | ++id_idx; |
540 | 540 | ||
541 | id = read_data[id_idx]; | 541 | id = read_data[id_idx]; |
@@ -642,7 +642,7 @@ struct evsel *perf_evlist__event2evsel(struct evlist *evlist, | |||
642 | if (evlist->core.nr_entries == 1) | 642 | if (evlist->core.nr_entries == 1) |
643 | return first; | 643 | return first; |
644 | 644 | ||
645 | if (!first->attr.sample_id_all && | 645 | if (!first->core.attr.sample_id_all && |
646 | event->header.type != PERF_RECORD_SAMPLE) | 646 | event->header.type != PERF_RECORD_SAMPLE) |
647 | return first; | 647 | return first; |
648 | 648 | ||
@@ -747,7 +747,7 @@ static bool | |||
747 | perf_evlist__should_poll(struct evlist *evlist __maybe_unused, | 747 | perf_evlist__should_poll(struct evlist *evlist __maybe_unused, |
748 | struct evsel *evsel) | 748 | struct evsel *evsel) |
749 | { | 749 | { |
750 | if (evsel->attr.write_backward) | 750 | if (evsel->core.attr.write_backward) |
751 | return false; | 751 | return false; |
752 | return true; | 752 | return true; |
753 | } | 753 | } |
@@ -767,7 +767,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx, | |||
767 | int cpu; | 767 | int cpu; |
768 | 768 | ||
769 | mp->prot = PROT_READ | PROT_WRITE; | 769 | mp->prot = PROT_READ | PROT_WRITE; |
770 | if (evsel->attr.write_backward) { | 770 | if (evsel->core.attr.write_backward) { |
771 | output = _output_overwrite; | 771 | output = _output_overwrite; |
772 | maps = evlist->overwrite_mmap; | 772 | maps = evlist->overwrite_mmap; |
773 | 773 | ||
@@ -818,7 +818,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx, | |||
818 | return -1; | 818 | return -1; |
819 | } | 819 | } |
820 | 820 | ||
821 | if (evsel->attr.read_format & PERF_FORMAT_ID) { | 821 | if (evsel->core.attr.read_format & PERF_FORMAT_ID) { |
822 | if (perf_evlist__id_add_fd(evlist, evsel, cpu, thread, | 822 | if (perf_evlist__id_add_fd(evlist, evsel, cpu, thread, |
823 | fd) < 0) | 823 | fd) < 0) |
824 | return -1; | 824 | return -1; |
@@ -1039,7 +1039,7 @@ int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages, | |||
1039 | auxtrace_pages, auxtrace_overwrite); | 1039 | auxtrace_pages, auxtrace_overwrite); |
1040 | 1040 | ||
1041 | evlist__for_each_entry(evlist, evsel) { | 1041 | evlist__for_each_entry(evlist, evsel) { |
1042 | if ((evsel->attr.read_format & PERF_FORMAT_ID) && | 1042 | if ((evsel->core.attr.read_format & PERF_FORMAT_ID) && |
1043 | evsel->sample_id == NULL && | 1043 | evsel->sample_id == NULL && |
1044 | perf_evsel__alloc_id(evsel, cpu_map__nr(cpus), threads->nr) < 0) | 1044 | perf_evsel__alloc_id(evsel, cpu_map__nr(cpus), threads->nr) < 0) |
1045 | return -ENOMEM; | 1045 | return -ENOMEM; |
@@ -1175,7 +1175,7 @@ int perf_evlist__set_tp_filter(struct evlist *evlist, const char *filter) | |||
1175 | int err = 0; | 1175 | int err = 0; |
1176 | 1176 | ||
1177 | evlist__for_each_entry(evlist, evsel) { | 1177 | evlist__for_each_entry(evlist, evsel) { |
1178 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 1178 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) |
1179 | continue; | 1179 | continue; |
1180 | 1180 | ||
1181 | err = perf_evsel__set_filter(evsel, filter); | 1181 | err = perf_evsel__set_filter(evsel, filter); |
@@ -1245,7 +1245,7 @@ u64 __perf_evlist__combined_sample_type(struct evlist *evlist) | |||
1245 | return evlist->combined_sample_type; | 1245 | return evlist->combined_sample_type; |
1246 | 1246 | ||
1247 | evlist__for_each_entry(evlist, evsel) | 1247 | evlist__for_each_entry(evlist, evsel) |
1248 | evlist->combined_sample_type |= evsel->attr.sample_type; | 1248 | evlist->combined_sample_type |= evsel->core.attr.sample_type; |
1249 | 1249 | ||
1250 | return evlist->combined_sample_type; | 1250 | return evlist->combined_sample_type; |
1251 | } | 1251 | } |
@@ -1262,18 +1262,18 @@ u64 perf_evlist__combined_branch_type(struct evlist *evlist) | |||
1262 | u64 branch_type = 0; | 1262 | u64 branch_type = 0; |
1263 | 1263 | ||
1264 | evlist__for_each_entry(evlist, evsel) | 1264 | evlist__for_each_entry(evlist, evsel) |
1265 | branch_type |= evsel->attr.branch_sample_type; | 1265 | branch_type |= evsel->core.attr.branch_sample_type; |
1266 | return branch_type; | 1266 | return branch_type; |
1267 | } | 1267 | } |
1268 | 1268 | ||
1269 | bool perf_evlist__valid_read_format(struct evlist *evlist) | 1269 | bool perf_evlist__valid_read_format(struct evlist *evlist) |
1270 | { | 1270 | { |
1271 | struct evsel *first = perf_evlist__first(evlist), *pos = first; | 1271 | struct evsel *first = perf_evlist__first(evlist), *pos = first; |
1272 | u64 read_format = first->attr.read_format; | 1272 | u64 read_format = first->core.attr.read_format; |
1273 | u64 sample_type = first->attr.sample_type; | 1273 | u64 sample_type = first->core.attr.sample_type; |
1274 | 1274 | ||
1275 | evlist__for_each_entry(evlist, pos) { | 1275 | evlist__for_each_entry(evlist, pos) { |
1276 | if (read_format != pos->attr.read_format) | 1276 | if (read_format != pos->core.attr.read_format) |
1277 | return false; | 1277 | return false; |
1278 | } | 1278 | } |
1279 | 1279 | ||
@@ -1289,7 +1289,7 @@ bool perf_evlist__valid_read_format(struct evlist *evlist) | |||
1289 | u64 perf_evlist__read_format(struct evlist *evlist) | 1289 | u64 perf_evlist__read_format(struct evlist *evlist) |
1290 | { | 1290 | { |
1291 | struct evsel *first = perf_evlist__first(evlist); | 1291 | struct evsel *first = perf_evlist__first(evlist); |
1292 | return first->attr.read_format; | 1292 | return first->core.attr.read_format; |
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | u16 perf_evlist__id_hdr_size(struct evlist *evlist) | 1295 | u16 perf_evlist__id_hdr_size(struct evlist *evlist) |
@@ -1299,10 +1299,10 @@ u16 perf_evlist__id_hdr_size(struct evlist *evlist) | |||
1299 | u64 sample_type; | 1299 | u64 sample_type; |
1300 | u16 size = 0; | 1300 | u16 size = 0; |
1301 | 1301 | ||
1302 | if (!first->attr.sample_id_all) | 1302 | if (!first->core.attr.sample_id_all) |
1303 | goto out; | 1303 | goto out; |
1304 | 1304 | ||
1305 | sample_type = first->attr.sample_type; | 1305 | sample_type = first->core.attr.sample_type; |
1306 | 1306 | ||
1307 | if (sample_type & PERF_SAMPLE_TID) | 1307 | if (sample_type & PERF_SAMPLE_TID) |
1308 | size += sizeof(data->tid) * 2; | 1308 | size += sizeof(data->tid) * 2; |
@@ -1330,7 +1330,7 @@ bool perf_evlist__valid_sample_id_all(struct evlist *evlist) | |||
1330 | struct evsel *first = perf_evlist__first(evlist), *pos = first; | 1330 | struct evsel *first = perf_evlist__first(evlist), *pos = first; |
1331 | 1331 | ||
1332 | evlist__for_each_entry_continue(evlist, pos) { | 1332 | evlist__for_each_entry_continue(evlist, pos) { |
1333 | if (first->attr.sample_id_all != pos->attr.sample_id_all) | 1333 | if (first->core.attr.sample_id_all != pos->core.attr.sample_id_all) |
1334 | return false; | 1334 | return false; |
1335 | } | 1335 | } |
1336 | 1336 | ||
@@ -1340,7 +1340,7 @@ bool perf_evlist__valid_sample_id_all(struct evlist *evlist) | |||
1340 | bool perf_evlist__sample_id_all(struct evlist *evlist) | 1340 | bool perf_evlist__sample_id_all(struct evlist *evlist) |
1341 | { | 1341 | { |
1342 | struct evsel *first = perf_evlist__first(evlist); | 1342 | struct evsel *first = perf_evlist__first(evlist); |
1343 | return first->attr.sample_id_all; | 1343 | return first->core.attr.sample_id_all; |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | void perf_evlist__set_selected(struct evlist *evlist, | 1346 | void perf_evlist__set_selected(struct evlist *evlist, |
@@ -1620,14 +1620,14 @@ int perf_evlist__strerror_open(struct evlist *evlist, | |||
1620 | if (sysctl__read_int("kernel/perf_event_max_sample_rate", &max_freq) < 0) | 1620 | if (sysctl__read_int("kernel/perf_event_max_sample_rate", &max_freq) < 0) |
1621 | goto out_default; | 1621 | goto out_default; |
1622 | 1622 | ||
1623 | if (first->attr.sample_freq < (u64)max_freq) | 1623 | if (first->core.attr.sample_freq < (u64)max_freq) |
1624 | goto out_default; | 1624 | goto out_default; |
1625 | 1625 | ||
1626 | printed = scnprintf(buf, size, | 1626 | printed = scnprintf(buf, size, |
1627 | "Error:\t%s.\n" | 1627 | "Error:\t%s.\n" |
1628 | "Hint:\tCheck /proc/sys/kernel/perf_event_max_sample_rate.\n" | 1628 | "Hint:\tCheck /proc/sys/kernel/perf_event_max_sample_rate.\n" |
1629 | "Hint:\tThe current value is %d and %" PRIu64 " is being requested.", | 1629 | "Hint:\tThe current value is %d and %" PRIu64 " is being requested.", |
1630 | emsg, max_freq, first->attr.sample_freq); | 1630 | emsg, max_freq, first->core.attr.sample_freq); |
1631 | break; | 1631 | break; |
1632 | } | 1632 | } |
1633 | default: | 1633 | default: |
@@ -1782,7 +1782,7 @@ bool perf_evlist__exclude_kernel(struct evlist *evlist) | |||
1782 | struct evsel *evsel; | 1782 | struct evsel *evsel; |
1783 | 1783 | ||
1784 | evlist__for_each_entry(evlist, evsel) { | 1784 | evlist__for_each_entry(evlist, evsel) { |
1785 | if (!evsel->attr.exclude_kernel) | 1785 | if (!evsel->core.attr.exclude_kernel) |
1786 | return false; | 1786 | return false; |
1787 | } | 1787 | } |
1788 | 1788 | ||
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 172bcc2e198f..089582e644d7 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -170,15 +170,15 @@ static int __perf_evsel__calc_is_pos(u64 sample_type) | |||
170 | 170 | ||
171 | void perf_evsel__calc_id_pos(struct evsel *evsel) | 171 | void perf_evsel__calc_id_pos(struct evsel *evsel) |
172 | { | 172 | { |
173 | evsel->id_pos = __perf_evsel__calc_id_pos(evsel->attr.sample_type); | 173 | evsel->id_pos = __perf_evsel__calc_id_pos(evsel->core.attr.sample_type); |
174 | evsel->is_pos = __perf_evsel__calc_is_pos(evsel->attr.sample_type); | 174 | evsel->is_pos = __perf_evsel__calc_is_pos(evsel->core.attr.sample_type); |
175 | } | 175 | } |
176 | 176 | ||
177 | void __perf_evsel__set_sample_bit(struct evsel *evsel, | 177 | void __perf_evsel__set_sample_bit(struct evsel *evsel, |
178 | enum perf_event_sample_format bit) | 178 | enum perf_event_sample_format bit) |
179 | { | 179 | { |
180 | if (!(evsel->attr.sample_type & bit)) { | 180 | if (!(evsel->core.attr.sample_type & bit)) { |
181 | evsel->attr.sample_type |= bit; | 181 | evsel->core.attr.sample_type |= bit; |
182 | evsel->sample_size += sizeof(u64); | 182 | evsel->sample_size += sizeof(u64); |
183 | perf_evsel__calc_id_pos(evsel); | 183 | perf_evsel__calc_id_pos(evsel); |
184 | } | 184 | } |
@@ -187,8 +187,8 @@ void __perf_evsel__set_sample_bit(struct evsel *evsel, | |||
187 | void __perf_evsel__reset_sample_bit(struct evsel *evsel, | 187 | void __perf_evsel__reset_sample_bit(struct evsel *evsel, |
188 | enum perf_event_sample_format bit) | 188 | enum perf_event_sample_format bit) |
189 | { | 189 | { |
190 | if (evsel->attr.sample_type & bit) { | 190 | if (evsel->core.attr.sample_type & bit) { |
191 | evsel->attr.sample_type &= ~bit; | 191 | evsel->core.attr.sample_type &= ~bit; |
192 | evsel->sample_size -= sizeof(u64); | 192 | evsel->sample_size -= sizeof(u64); |
193 | perf_evsel__calc_id_pos(evsel); | 193 | perf_evsel__calc_id_pos(evsel); |
194 | } | 194 | } |
@@ -203,7 +203,7 @@ void perf_evsel__set_sample_id(struct evsel *evsel, | |||
203 | } else { | 203 | } else { |
204 | perf_evsel__set_sample_bit(evsel, ID); | 204 | perf_evsel__set_sample_bit(evsel, ID); |
205 | } | 205 | } |
206 | evsel->attr.read_format |= PERF_FORMAT_ID; | 206 | evsel->core.attr.read_format |= PERF_FORMAT_ID; |
207 | } | 207 | } |
208 | 208 | ||
209 | /** | 209 | /** |
@@ -227,10 +227,9 @@ bool perf_evsel__is_function_event(struct evsel *evsel) | |||
227 | void evsel__init(struct evsel *evsel, | 227 | void evsel__init(struct evsel *evsel, |
228 | struct perf_event_attr *attr, int idx) | 228 | struct perf_event_attr *attr, int idx) |
229 | { | 229 | { |
230 | perf_evsel__init(&evsel->core); | 230 | perf_evsel__init(&evsel->core, attr); |
231 | evsel->idx = idx; | 231 | evsel->idx = idx; |
232 | evsel->tracking = !idx; | 232 | evsel->tracking = !idx; |
233 | evsel->attr = *attr; | ||
234 | evsel->leader = evsel; | 233 | evsel->leader = evsel; |
235 | evsel->unit = ""; | 234 | evsel->unit = ""; |
236 | evsel->scale = 1.0; | 235 | evsel->scale = 1.0; |
@@ -259,9 +258,9 @@ struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx) | |||
259 | evsel__init(evsel, attr, idx); | 258 | evsel__init(evsel, attr, idx); |
260 | 259 | ||
261 | if (perf_evsel__is_bpf_output(evsel)) { | 260 | if (perf_evsel__is_bpf_output(evsel)) { |
262 | evsel->attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | | 261 | evsel->core.attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | |
263 | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD), | 262 | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD), |
264 | evsel->attr.sample_period = 1; | 263 | evsel->core.attr.sample_period = 1; |
265 | } | 264 | } |
266 | 265 | ||
267 | if (perf_evsel__is_clock(evsel)) { | 266 | if (perf_evsel__is_clock(evsel)) { |
@@ -387,7 +386,7 @@ static const char *__perf_evsel__hw_name(u64 config) | |||
387 | static int perf_evsel__add_modifiers(struct evsel *evsel, char *bf, size_t size) | 386 | static int perf_evsel__add_modifiers(struct evsel *evsel, char *bf, size_t size) |
388 | { | 387 | { |
389 | int colon = 0, r = 0; | 388 | int colon = 0, r = 0; |
390 | struct perf_event_attr *attr = &evsel->attr; | 389 | struct perf_event_attr *attr = &evsel->core.attr; |
391 | bool exclude_guest_default = false; | 390 | bool exclude_guest_default = false; |
392 | 391 | ||
393 | #define MOD_PRINT(context, mod) do { \ | 392 | #define MOD_PRINT(context, mod) do { \ |
@@ -422,7 +421,7 @@ static int perf_evsel__add_modifiers(struct evsel *evsel, char *bf, size_t size) | |||
422 | 421 | ||
423 | static int perf_evsel__hw_name(struct evsel *evsel, char *bf, size_t size) | 422 | static int perf_evsel__hw_name(struct evsel *evsel, char *bf, size_t size) |
424 | { | 423 | { |
425 | int r = scnprintf(bf, size, "%s", __perf_evsel__hw_name(evsel->attr.config)); | 424 | int r = scnprintf(bf, size, "%s", __perf_evsel__hw_name(evsel->core.attr.config)); |
426 | return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); | 425 | return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); |
427 | } | 426 | } |
428 | 427 | ||
@@ -448,7 +447,7 @@ static const char *__perf_evsel__sw_name(u64 config) | |||
448 | 447 | ||
449 | static int perf_evsel__sw_name(struct evsel *evsel, char *bf, size_t size) | 448 | static int perf_evsel__sw_name(struct evsel *evsel, char *bf, size_t size) |
450 | { | 449 | { |
451 | int r = scnprintf(bf, size, "%s", __perf_evsel__sw_name(evsel->attr.config)); | 450 | int r = scnprintf(bf, size, "%s", __perf_evsel__sw_name(evsel->core.attr.config)); |
452 | return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); | 451 | return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); |
453 | } | 452 | } |
454 | 453 | ||
@@ -472,7 +471,7 @@ static int __perf_evsel__bp_name(char *bf, size_t size, u64 addr, u64 type) | |||
472 | 471 | ||
473 | static int perf_evsel__bp_name(struct evsel *evsel, char *bf, size_t size) | 472 | static int perf_evsel__bp_name(struct evsel *evsel, char *bf, size_t size) |
474 | { | 473 | { |
475 | struct perf_event_attr *attr = &evsel->attr; | 474 | struct perf_event_attr *attr = &evsel->core.attr; |
476 | int r = __perf_evsel__bp_name(bf, size, attr->bp_addr, attr->bp_type); | 475 | int r = __perf_evsel__bp_name(bf, size, attr->bp_addr, attr->bp_type); |
477 | return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); | 476 | return r + perf_evsel__add_modifiers(evsel, bf + r, size - r); |
478 | } | 477 | } |
@@ -572,13 +571,13 @@ out_err: | |||
572 | 571 | ||
573 | static int perf_evsel__hw_cache_name(struct evsel *evsel, char *bf, size_t size) | 572 | static int perf_evsel__hw_cache_name(struct evsel *evsel, char *bf, size_t size) |
574 | { | 573 | { |
575 | int ret = __perf_evsel__hw_cache_name(evsel->attr.config, bf, size); | 574 | int ret = __perf_evsel__hw_cache_name(evsel->core.attr.config, bf, size); |
576 | return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); | 575 | return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); |
577 | } | 576 | } |
578 | 577 | ||
579 | static int perf_evsel__raw_name(struct evsel *evsel, char *bf, size_t size) | 578 | static int perf_evsel__raw_name(struct evsel *evsel, char *bf, size_t size) |
580 | { | 579 | { |
581 | int ret = scnprintf(bf, size, "raw 0x%" PRIx64, evsel->attr.config); | 580 | int ret = scnprintf(bf, size, "raw 0x%" PRIx64, evsel->core.attr.config); |
582 | return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); | 581 | return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); |
583 | } | 582 | } |
584 | 583 | ||
@@ -598,7 +597,7 @@ const char *perf_evsel__name(struct evsel *evsel) | |||
598 | if (evsel->name) | 597 | if (evsel->name) |
599 | return evsel->name; | 598 | return evsel->name; |
600 | 599 | ||
601 | switch (evsel->attr.type) { | 600 | switch (evsel->core.attr.type) { |
602 | case PERF_TYPE_RAW: | 601 | case PERF_TYPE_RAW: |
603 | perf_evsel__raw_name(evsel, bf, sizeof(bf)); | 602 | perf_evsel__raw_name(evsel, bf, sizeof(bf)); |
604 | break; | 603 | break; |
@@ -628,7 +627,7 @@ const char *perf_evsel__name(struct evsel *evsel) | |||
628 | 627 | ||
629 | default: | 628 | default: |
630 | scnprintf(bf, sizeof(bf), "unknown attr type: %d", | 629 | scnprintf(bf, sizeof(bf), "unknown attr type: %d", |
631 | evsel->attr.type); | 630 | evsel->core.attr.type); |
632 | break; | 631 | break; |
633 | } | 632 | } |
634 | 633 | ||
@@ -682,7 +681,7 @@ static void __perf_evsel__config_callchain(struct evsel *evsel, | |||
682 | struct callchain_param *param) | 681 | struct callchain_param *param) |
683 | { | 682 | { |
684 | bool function = perf_evsel__is_function_event(evsel); | 683 | bool function = perf_evsel__is_function_event(evsel); |
685 | struct perf_event_attr *attr = &evsel->attr; | 684 | struct perf_event_attr *attr = &evsel->core.attr; |
686 | 685 | ||
687 | perf_evsel__set_sample_bit(evsel, CALLCHAIN); | 686 | perf_evsel__set_sample_bit(evsel, CALLCHAIN); |
688 | 687 | ||
@@ -748,7 +747,7 @@ static void | |||
748 | perf_evsel__reset_callgraph(struct evsel *evsel, | 747 | perf_evsel__reset_callgraph(struct evsel *evsel, |
749 | struct callchain_param *param) | 748 | struct callchain_param *param) |
750 | { | 749 | { |
751 | struct perf_event_attr *attr = &evsel->attr; | 750 | struct perf_event_attr *attr = &evsel->core.attr; |
752 | 751 | ||
753 | perf_evsel__reset_sample_bit(evsel, CALLCHAIN); | 752 | perf_evsel__reset_sample_bit(evsel, CALLCHAIN); |
754 | if (param->record_mode == CALLCHAIN_LBR) { | 753 | if (param->record_mode == CALLCHAIN_LBR) { |
@@ -767,7 +766,7 @@ static void apply_config_terms(struct evsel *evsel, | |||
767 | { | 766 | { |
768 | struct perf_evsel_config_term *term; | 767 | struct perf_evsel_config_term *term; |
769 | struct list_head *config_terms = &evsel->config_terms; | 768 | struct list_head *config_terms = &evsel->config_terms; |
770 | struct perf_event_attr *attr = &evsel->attr; | 769 | struct perf_event_attr *attr = &evsel->core.attr; |
771 | /* callgraph default */ | 770 | /* callgraph default */ |
772 | struct callchain_param param = { | 771 | struct callchain_param param = { |
773 | .record_mode = callchain_param.record_mode, | 772 | .record_mode = callchain_param.record_mode, |
@@ -880,7 +879,7 @@ static void apply_config_terms(struct evsel *evsel, | |||
880 | if (sample_address) { | 879 | if (sample_address) { |
881 | perf_evsel__set_sample_bit(evsel, ADDR); | 880 | perf_evsel__set_sample_bit(evsel, ADDR); |
882 | perf_evsel__set_sample_bit(evsel, DATA_SRC); | 881 | perf_evsel__set_sample_bit(evsel, DATA_SRC); |
883 | evsel->attr.mmap_data = track; | 882 | evsel->core.attr.mmap_data = track; |
884 | } | 883 | } |
885 | perf_evsel__config_callchain(evsel, opts, ¶m); | 884 | perf_evsel__config_callchain(evsel, opts, ¶m); |
886 | } | 885 | } |
@@ -889,8 +888,8 @@ static void apply_config_terms(struct evsel *evsel, | |||
889 | 888 | ||
890 | static bool is_dummy_event(struct evsel *evsel) | 889 | static bool is_dummy_event(struct evsel *evsel) |
891 | { | 890 | { |
892 | return (evsel->attr.type == PERF_TYPE_SOFTWARE) && | 891 | return (evsel->core.attr.type == PERF_TYPE_SOFTWARE) && |
893 | (evsel->attr.config == PERF_COUNT_SW_DUMMY); | 892 | (evsel->core.attr.config == PERF_COUNT_SW_DUMMY); |
894 | } | 893 | } |
895 | 894 | ||
896 | /* | 895 | /* |
@@ -925,7 +924,7 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, | |||
925 | struct callchain_param *callchain) | 924 | struct callchain_param *callchain) |
926 | { | 925 | { |
927 | struct evsel *leader = evsel->leader; | 926 | struct evsel *leader = evsel->leader; |
928 | struct perf_event_attr *attr = &evsel->attr; | 927 | struct perf_event_attr *attr = &evsel->core.attr; |
929 | int track = evsel->tracking; | 928 | int track = evsel->tracking; |
930 | bool per_cpu = opts->target.default_per_cpu && !opts->target.per_thread; | 929 | bool per_cpu = opts->target.default_per_cpu && !opts->target.per_thread; |
931 | 930 | ||
@@ -986,14 +985,14 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, | |||
986 | * event to follow the master sample_type to ease up | 985 | * event to follow the master sample_type to ease up |
987 | * report. | 986 | * report. |
988 | */ | 987 | */ |
989 | attr->sample_type = leader->attr.sample_type; | 988 | attr->sample_type = leader->core.attr.sample_type; |
990 | } | 989 | } |
991 | 990 | ||
992 | if (opts->no_samples) | 991 | if (opts->no_samples) |
993 | attr->sample_freq = 0; | 992 | attr->sample_freq = 0; |
994 | 993 | ||
995 | if (opts->inherit_stat) { | 994 | if (opts->inherit_stat) { |
996 | evsel->attr.read_format |= | 995 | evsel->core.attr.read_format |= |
997 | PERF_FORMAT_TOTAL_TIME_ENABLED | | 996 | PERF_FORMAT_TOTAL_TIME_ENABLED | |
998 | PERF_FORMAT_TOTAL_TIME_RUNNING | | 997 | PERF_FORMAT_TOTAL_TIME_RUNNING | |
999 | PERF_FORMAT_ID; | 998 | PERF_FORMAT_ID; |
@@ -1011,7 +1010,7 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, | |||
1011 | * fault handler and its overall trickiness nature. | 1010 | * fault handler and its overall trickiness nature. |
1012 | */ | 1011 | */ |
1013 | if (perf_evsel__is_function_event(evsel)) | 1012 | if (perf_evsel__is_function_event(evsel)) |
1014 | evsel->attr.exclude_callchain_user = 1; | 1013 | evsel->core.attr.exclude_callchain_user = 1; |
1015 | 1014 | ||
1016 | if (callchain && callchain->enabled && !evsel->no_aux_samples) | 1015 | if (callchain && callchain->enabled && !evsel->no_aux_samples) |
1017 | perf_evsel__config_callchain(evsel, opts, callchain); | 1016 | perf_evsel__config_callchain(evsel, opts, callchain); |
@@ -1080,7 +1079,7 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, | |||
1080 | perf_evsel__set_sample_bit(evsel, TRANSACTION); | 1079 | perf_evsel__set_sample_bit(evsel, TRANSACTION); |
1081 | 1080 | ||
1082 | if (opts->running_time) { | 1081 | if (opts->running_time) { |
1083 | evsel->attr.read_format |= | 1082 | evsel->core.attr.read_format |= |
1084 | PERF_FORMAT_TOTAL_TIME_ENABLED | | 1083 | PERF_FORMAT_TOTAL_TIME_ENABLED | |
1085 | PERF_FORMAT_TOTAL_TIME_RUNNING; | 1084 | PERF_FORMAT_TOTAL_TIME_RUNNING; |
1086 | } | 1085 | } |
@@ -1127,7 +1126,7 @@ void perf_evsel__config(struct evsel *evsel, struct record_opts *opts, | |||
1127 | } | 1126 | } |
1128 | 1127 | ||
1129 | if (evsel->own_cpus || evsel->unit) | 1128 | if (evsel->own_cpus || evsel->unit) |
1130 | evsel->attr.read_format |= PERF_FORMAT_ID; | 1129 | evsel->core.attr.read_format |= PERF_FORMAT_ID; |
1131 | 1130 | ||
1132 | /* | 1131 | /* |
1133 | * Apply event specific term settings, | 1132 | * Apply event specific term settings, |
@@ -1382,7 +1381,7 @@ void perf_counts_values__scale(struct perf_counts_values *count, | |||
1382 | 1381 | ||
1383 | static int perf_evsel__read_size(struct evsel *evsel) | 1382 | static int perf_evsel__read_size(struct evsel *evsel) |
1384 | { | 1383 | { |
1385 | u64 read_format = evsel->attr.read_format; | 1384 | u64 read_format = evsel->core.attr.read_format; |
1386 | int entry = sizeof(u64); /* value */ | 1385 | int entry = sizeof(u64); /* value */ |
1387 | int size = 0; | 1386 | int size = 0; |
1388 | int nr = 1; | 1387 | int nr = 1; |
@@ -1448,7 +1447,7 @@ static int | |||
1448 | perf_evsel__process_group_data(struct evsel *leader, | 1447 | perf_evsel__process_group_data(struct evsel *leader, |
1449 | int cpu, int thread, u64 *data) | 1448 | int cpu, int thread, u64 *data) |
1450 | { | 1449 | { |
1451 | u64 read_format = leader->attr.read_format; | 1450 | u64 read_format = leader->core.attr.read_format; |
1452 | struct sample_read_value *v; | 1451 | struct sample_read_value *v; |
1453 | u64 nr, ena = 0, run = 0, i; | 1452 | u64 nr, ena = 0, run = 0, i; |
1454 | 1453 | ||
@@ -1486,7 +1485,7 @@ static int | |||
1486 | perf_evsel__read_group(struct evsel *leader, int cpu, int thread) | 1485 | perf_evsel__read_group(struct evsel *leader, int cpu, int thread) |
1487 | { | 1486 | { |
1488 | struct perf_stat_evsel *ps = leader->stats; | 1487 | struct perf_stat_evsel *ps = leader->stats; |
1489 | u64 read_format = leader->attr.read_format; | 1488 | u64 read_format = leader->core.attr.read_format; |
1490 | int size = perf_evsel__read_size(leader); | 1489 | int size = perf_evsel__read_size(leader); |
1491 | u64 *data = ps->group_data; | 1490 | u64 *data = ps->group_data; |
1492 | 1491 | ||
@@ -1515,7 +1514,7 @@ perf_evsel__read_group(struct evsel *leader, int cpu, int thread) | |||
1515 | 1514 | ||
1516 | int perf_evsel__read_counter(struct evsel *evsel, int cpu, int thread) | 1515 | int perf_evsel__read_counter(struct evsel *evsel, int cpu, int thread) |
1517 | { | 1516 | { |
1518 | u64 read_format = evsel->attr.read_format; | 1517 | u64 read_format = evsel->core.attr.read_format; |
1519 | 1518 | ||
1520 | if (read_format & PERF_FORMAT_GROUP) | 1519 | if (read_format & PERF_FORMAT_GROUP) |
1521 | return perf_evsel__read_group(evsel, cpu, thread); | 1520 | return perf_evsel__read_group(evsel, cpu, thread); |
@@ -1793,14 +1792,14 @@ static int perf_event_open(struct evsel *evsel, | |||
1793 | pid_t pid, int cpu, int group_fd, | 1792 | pid_t pid, int cpu, int group_fd, |
1794 | unsigned long flags) | 1793 | unsigned long flags) |
1795 | { | 1794 | { |
1796 | int precise_ip = evsel->attr.precise_ip; | 1795 | int precise_ip = evsel->core.attr.precise_ip; |
1797 | int fd; | 1796 | int fd; |
1798 | 1797 | ||
1799 | while (1) { | 1798 | while (1) { |
1800 | pr_debug2("sys_perf_event_open: pid %d cpu %d group_fd %d flags %#lx", | 1799 | pr_debug2("sys_perf_event_open: pid %d cpu %d group_fd %d flags %#lx", |
1801 | pid, cpu, group_fd, flags); | 1800 | pid, cpu, group_fd, flags); |
1802 | 1801 | ||
1803 | fd = sys_perf_event_open(&evsel->attr, pid, cpu, group_fd, flags); | 1802 | fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, group_fd, flags); |
1804 | if (fd >= 0) | 1803 | if (fd >= 0) |
1805 | break; | 1804 | break; |
1806 | 1805 | ||
@@ -1812,15 +1811,15 @@ static int perf_event_open(struct evsel *evsel, | |||
1812 | * We tried all the precise_ip values, and it's | 1811 | * We tried all the precise_ip values, and it's |
1813 | * still failing, so leave it to standard fallback. | 1812 | * still failing, so leave it to standard fallback. |
1814 | */ | 1813 | */ |
1815 | if (!evsel->attr.precise_ip) { | 1814 | if (!evsel->core.attr.precise_ip) { |
1816 | evsel->attr.precise_ip = precise_ip; | 1815 | evsel->core.attr.precise_ip = precise_ip; |
1817 | break; | 1816 | break; |
1818 | } | 1817 | } |
1819 | 1818 | ||
1820 | pr_debug2("\nsys_perf_event_open failed, error %d\n", -ENOTSUP); | 1819 | pr_debug2("\nsys_perf_event_open failed, error %d\n", -ENOTSUP); |
1821 | evsel->attr.precise_ip--; | 1820 | evsel->core.attr.precise_ip--; |
1822 | pr_debug2("decreasing precise_ip by one (%d)\n", evsel->attr.precise_ip); | 1821 | pr_debug2("decreasing precise_ip by one (%d)\n", evsel->core.attr.precise_ip); |
1823 | display_attr(&evsel->attr); | 1822 | display_attr(&evsel->core.attr); |
1824 | } | 1823 | } |
1825 | 1824 | ||
1826 | return fd; | 1825 | return fd; |
@@ -1834,7 +1833,7 @@ int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, | |||
1834 | int pid = -1, err; | 1833 | int pid = -1, err; |
1835 | enum { NO_CHANGE, SET_TO_MAX, INCREASED_MAX } set_rlimit = NO_CHANGE; | 1834 | enum { NO_CHANGE, SET_TO_MAX, INCREASED_MAX } set_rlimit = NO_CHANGE; |
1836 | 1835 | ||
1837 | if (perf_missing_features.write_backward && evsel->attr.write_backward) | 1836 | if (perf_missing_features.write_backward && evsel->core.attr.write_backward) |
1838 | return -EINVAL; | 1837 | return -EINVAL; |
1839 | 1838 | ||
1840 | if (cpus == NULL) { | 1839 | if (cpus == NULL) { |
@@ -1877,31 +1876,31 @@ int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, | |||
1877 | 1876 | ||
1878 | fallback_missing_features: | 1877 | fallback_missing_features: |
1879 | if (perf_missing_features.clockid_wrong) | 1878 | if (perf_missing_features.clockid_wrong) |
1880 | evsel->attr.clockid = CLOCK_MONOTONIC; /* should always work */ | 1879 | evsel->core.attr.clockid = CLOCK_MONOTONIC; /* should always work */ |
1881 | if (perf_missing_features.clockid) { | 1880 | if (perf_missing_features.clockid) { |
1882 | evsel->attr.use_clockid = 0; | 1881 | evsel->core.attr.use_clockid = 0; |
1883 | evsel->attr.clockid = 0; | 1882 | evsel->core.attr.clockid = 0; |
1884 | } | 1883 | } |
1885 | if (perf_missing_features.cloexec) | 1884 | if (perf_missing_features.cloexec) |
1886 | flags &= ~(unsigned long)PERF_FLAG_FD_CLOEXEC; | 1885 | flags &= ~(unsigned long)PERF_FLAG_FD_CLOEXEC; |
1887 | if (perf_missing_features.mmap2) | 1886 | if (perf_missing_features.mmap2) |
1888 | evsel->attr.mmap2 = 0; | 1887 | evsel->core.attr.mmap2 = 0; |
1889 | if (perf_missing_features.exclude_guest) | 1888 | if (perf_missing_features.exclude_guest) |
1890 | evsel->attr.exclude_guest = evsel->attr.exclude_host = 0; | 1889 | evsel->core.attr.exclude_guest = evsel->core.attr.exclude_host = 0; |
1891 | if (perf_missing_features.lbr_flags) | 1890 | if (perf_missing_features.lbr_flags) |
1892 | evsel->attr.branch_sample_type &= ~(PERF_SAMPLE_BRANCH_NO_FLAGS | | 1891 | evsel->core.attr.branch_sample_type &= ~(PERF_SAMPLE_BRANCH_NO_FLAGS | |
1893 | PERF_SAMPLE_BRANCH_NO_CYCLES); | 1892 | PERF_SAMPLE_BRANCH_NO_CYCLES); |
1894 | if (perf_missing_features.group_read && evsel->attr.inherit) | 1893 | if (perf_missing_features.group_read && evsel->core.attr.inherit) |
1895 | evsel->attr.read_format &= ~(PERF_FORMAT_GROUP|PERF_FORMAT_ID); | 1894 | evsel->core.attr.read_format &= ~(PERF_FORMAT_GROUP|PERF_FORMAT_ID); |
1896 | if (perf_missing_features.ksymbol) | 1895 | if (perf_missing_features.ksymbol) |
1897 | evsel->attr.ksymbol = 0; | 1896 | evsel->core.attr.ksymbol = 0; |
1898 | if (perf_missing_features.bpf_event) | 1897 | if (perf_missing_features.bpf_event) |
1899 | evsel->attr.bpf_event = 0; | 1898 | evsel->core.attr.bpf_event = 0; |
1900 | retry_sample_id: | 1899 | retry_sample_id: |
1901 | if (perf_missing_features.sample_id_all) | 1900 | if (perf_missing_features.sample_id_all) |
1902 | evsel->attr.sample_id_all = 0; | 1901 | evsel->core.attr.sample_id_all = 0; |
1903 | 1902 | ||
1904 | display_attr(&evsel->attr); | 1903 | display_attr(&evsel->core.attr); |
1905 | 1904 | ||
1906 | for (cpu = 0; cpu < cpus->nr; cpu++) { | 1905 | for (cpu = 0; cpu < cpus->nr; cpu++) { |
1907 | 1906 | ||
@@ -2008,23 +2007,23 @@ try_fallback: | |||
2008 | * Must probe features in the order they were added to the | 2007 | * Must probe features in the order they were added to the |
2009 | * perf_event_attr interface. | 2008 | * perf_event_attr interface. |
2010 | */ | 2009 | */ |
2011 | if (!perf_missing_features.bpf_event && evsel->attr.bpf_event) { | 2010 | if (!perf_missing_features.bpf_event && evsel->core.attr.bpf_event) { |
2012 | perf_missing_features.bpf_event = true; | 2011 | perf_missing_features.bpf_event = true; |
2013 | pr_debug2("switching off bpf_event\n"); | 2012 | pr_debug2("switching off bpf_event\n"); |
2014 | goto fallback_missing_features; | 2013 | goto fallback_missing_features; |
2015 | } else if (!perf_missing_features.ksymbol && evsel->attr.ksymbol) { | 2014 | } else if (!perf_missing_features.ksymbol && evsel->core.attr.ksymbol) { |
2016 | perf_missing_features.ksymbol = true; | 2015 | perf_missing_features.ksymbol = true; |
2017 | pr_debug2("switching off ksymbol\n"); | 2016 | pr_debug2("switching off ksymbol\n"); |
2018 | goto fallback_missing_features; | 2017 | goto fallback_missing_features; |
2019 | } else if (!perf_missing_features.write_backward && evsel->attr.write_backward) { | 2018 | } else if (!perf_missing_features.write_backward && evsel->core.attr.write_backward) { |
2020 | perf_missing_features.write_backward = true; | 2019 | perf_missing_features.write_backward = true; |
2021 | pr_debug2("switching off write_backward\n"); | 2020 | pr_debug2("switching off write_backward\n"); |
2022 | goto out_close; | 2021 | goto out_close; |
2023 | } else if (!perf_missing_features.clockid_wrong && evsel->attr.use_clockid) { | 2022 | } else if (!perf_missing_features.clockid_wrong && evsel->core.attr.use_clockid) { |
2024 | perf_missing_features.clockid_wrong = true; | 2023 | perf_missing_features.clockid_wrong = true; |
2025 | pr_debug2("switching off clockid\n"); | 2024 | pr_debug2("switching off clockid\n"); |
2026 | goto fallback_missing_features; | 2025 | goto fallback_missing_features; |
2027 | } else if (!perf_missing_features.clockid && evsel->attr.use_clockid) { | 2026 | } else if (!perf_missing_features.clockid && evsel->core.attr.use_clockid) { |
2028 | perf_missing_features.clockid = true; | 2027 | perf_missing_features.clockid = true; |
2029 | pr_debug2("switching off use_clockid\n"); | 2028 | pr_debug2("switching off use_clockid\n"); |
2030 | goto fallback_missing_features; | 2029 | goto fallback_missing_features; |
@@ -2032,12 +2031,12 @@ try_fallback: | |||
2032 | perf_missing_features.cloexec = true; | 2031 | perf_missing_features.cloexec = true; |
2033 | pr_debug2("switching off cloexec flag\n"); | 2032 | pr_debug2("switching off cloexec flag\n"); |
2034 | goto fallback_missing_features; | 2033 | goto fallback_missing_features; |
2035 | } else if (!perf_missing_features.mmap2 && evsel->attr.mmap2) { | 2034 | } else if (!perf_missing_features.mmap2 && evsel->core.attr.mmap2) { |
2036 | perf_missing_features.mmap2 = true; | 2035 | perf_missing_features.mmap2 = true; |
2037 | pr_debug2("switching off mmap2\n"); | 2036 | pr_debug2("switching off mmap2\n"); |
2038 | goto fallback_missing_features; | 2037 | goto fallback_missing_features; |
2039 | } else if (!perf_missing_features.exclude_guest && | 2038 | } else if (!perf_missing_features.exclude_guest && |
2040 | (evsel->attr.exclude_guest || evsel->attr.exclude_host)) { | 2039 | (evsel->core.attr.exclude_guest || evsel->core.attr.exclude_host)) { |
2041 | perf_missing_features.exclude_guest = true; | 2040 | perf_missing_features.exclude_guest = true; |
2042 | pr_debug2("switching off exclude_guest, exclude_host\n"); | 2041 | pr_debug2("switching off exclude_guest, exclude_host\n"); |
2043 | goto fallback_missing_features; | 2042 | goto fallback_missing_features; |
@@ -2046,15 +2045,15 @@ try_fallback: | |||
2046 | pr_debug2("switching off sample_id_all\n"); | 2045 | pr_debug2("switching off sample_id_all\n"); |
2047 | goto retry_sample_id; | 2046 | goto retry_sample_id; |
2048 | } else if (!perf_missing_features.lbr_flags && | 2047 | } else if (!perf_missing_features.lbr_flags && |
2049 | (evsel->attr.branch_sample_type & | 2048 | (evsel->core.attr.branch_sample_type & |
2050 | (PERF_SAMPLE_BRANCH_NO_CYCLES | | 2049 | (PERF_SAMPLE_BRANCH_NO_CYCLES | |
2051 | PERF_SAMPLE_BRANCH_NO_FLAGS))) { | 2050 | PERF_SAMPLE_BRANCH_NO_FLAGS))) { |
2052 | perf_missing_features.lbr_flags = true; | 2051 | perf_missing_features.lbr_flags = true; |
2053 | pr_debug2("switching off branch sample type no (cycles/flags)\n"); | 2052 | pr_debug2("switching off branch sample type no (cycles/flags)\n"); |
2054 | goto fallback_missing_features; | 2053 | goto fallback_missing_features; |
2055 | } else if (!perf_missing_features.group_read && | 2054 | } else if (!perf_missing_features.group_read && |
2056 | evsel->attr.inherit && | 2055 | evsel->core.attr.inherit && |
2057 | (evsel->attr.read_format & PERF_FORMAT_GROUP) && | 2056 | (evsel->core.attr.read_format & PERF_FORMAT_GROUP) && |
2058 | perf_evsel__is_group_leader(evsel)) { | 2057 | perf_evsel__is_group_leader(evsel)) { |
2059 | perf_missing_features.group_read = true; | 2058 | perf_missing_features.group_read = true; |
2060 | pr_debug2("switching off group read\n"); | 2059 | pr_debug2("switching off group read\n"); |
@@ -2100,7 +2099,7 @@ static int perf_evsel__parse_id_sample(const struct evsel *evsel, | |||
2100 | const union perf_event *event, | 2099 | const union perf_event *event, |
2101 | struct perf_sample *sample) | 2100 | struct perf_sample *sample) |
2102 | { | 2101 | { |
2103 | u64 type = evsel->attr.sample_type; | 2102 | u64 type = evsel->core.attr.sample_type; |
2104 | const u64 *array = event->sample.array; | 2103 | const u64 *array = event->sample.array; |
2105 | bool swapped = evsel->needs_swap; | 2104 | bool swapped = evsel->needs_swap; |
2106 | union u64_swap u; | 2105 | union u64_swap u; |
@@ -2189,7 +2188,7 @@ perf_event__check_size(union perf_event *event, unsigned int sample_size) | |||
2189 | int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, | 2188 | int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, |
2190 | struct perf_sample *data) | 2189 | struct perf_sample *data) |
2191 | { | 2190 | { |
2192 | u64 type = evsel->attr.sample_type; | 2191 | u64 type = evsel->core.attr.sample_type; |
2193 | bool swapped = evsel->needs_swap; | 2192 | bool swapped = evsel->needs_swap; |
2194 | const u64 *array; | 2193 | const u64 *array; |
2195 | u16 max_size = event->header.size; | 2194 | u16 max_size = event->header.size; |
@@ -2205,14 +2204,14 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, | |||
2205 | memset(data, 0, sizeof(*data)); | 2204 | memset(data, 0, sizeof(*data)); |
2206 | data->cpu = data->pid = data->tid = -1; | 2205 | data->cpu = data->pid = data->tid = -1; |
2207 | data->stream_id = data->id = data->time = -1ULL; | 2206 | data->stream_id = data->id = data->time = -1ULL; |
2208 | data->period = evsel->attr.sample_period; | 2207 | data->period = evsel->core.attr.sample_period; |
2209 | data->cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 2208 | data->cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; |
2210 | data->misc = event->header.misc; | 2209 | data->misc = event->header.misc; |
2211 | data->id = -1ULL; | 2210 | data->id = -1ULL; |
2212 | data->data_src = PERF_MEM_DATA_SRC_NONE; | 2211 | data->data_src = PERF_MEM_DATA_SRC_NONE; |
2213 | 2212 | ||
2214 | if (event->header.type != PERF_RECORD_SAMPLE) { | 2213 | if (event->header.type != PERF_RECORD_SAMPLE) { |
2215 | if (!evsel->attr.sample_id_all) | 2214 | if (!evsel->core.attr.sample_id_all) |
2216 | return 0; | 2215 | return 0; |
2217 | return perf_evsel__parse_id_sample(evsel, event, data); | 2216 | return perf_evsel__parse_id_sample(evsel, event, data); |
2218 | } | 2217 | } |
@@ -2285,7 +2284,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, | |||
2285 | } | 2284 | } |
2286 | 2285 | ||
2287 | if (type & PERF_SAMPLE_READ) { | 2286 | if (type & PERF_SAMPLE_READ) { |
2288 | u64 read_format = evsel->attr.read_format; | 2287 | u64 read_format = evsel->core.attr.read_format; |
2289 | 2288 | ||
2290 | OVERFLOW_CHECK_u64(array); | 2289 | OVERFLOW_CHECK_u64(array); |
2291 | if (read_format & PERF_FORMAT_GROUP) | 2290 | if (read_format & PERF_FORMAT_GROUP) |
@@ -2390,7 +2389,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, | |||
2390 | array++; | 2389 | array++; |
2391 | 2390 | ||
2392 | if (data->user_regs.abi) { | 2391 | if (data->user_regs.abi) { |
2393 | u64 mask = evsel->attr.sample_regs_user; | 2392 | u64 mask = evsel->core.attr.sample_regs_user; |
2394 | 2393 | ||
2395 | sz = hweight64(mask) * sizeof(u64); | 2394 | sz = hweight64(mask) * sizeof(u64); |
2396 | OVERFLOW_CHECK(array, sz, max_size); | 2395 | OVERFLOW_CHECK(array, sz, max_size); |
@@ -2446,7 +2445,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, | |||
2446 | array++; | 2445 | array++; |
2447 | 2446 | ||
2448 | if (data->intr_regs.abi != PERF_SAMPLE_REGS_ABI_NONE) { | 2447 | if (data->intr_regs.abi != PERF_SAMPLE_REGS_ABI_NONE) { |
2449 | u64 mask = evsel->attr.sample_regs_intr; | 2448 | u64 mask = evsel->core.attr.sample_regs_intr; |
2450 | 2449 | ||
2451 | sz = hweight64(mask) * sizeof(u64); | 2450 | sz = hweight64(mask) * sizeof(u64); |
2452 | OVERFLOW_CHECK(array, sz, max_size); | 2451 | OVERFLOW_CHECK(array, sz, max_size); |
@@ -2469,7 +2468,7 @@ int perf_evsel__parse_sample_timestamp(struct evsel *evsel, | |||
2469 | union perf_event *event, | 2468 | union perf_event *event, |
2470 | u64 *timestamp) | 2469 | u64 *timestamp) |
2471 | { | 2470 | { |
2472 | u64 type = evsel->attr.sample_type; | 2471 | u64 type = evsel->core.attr.sample_type; |
2473 | const u64 *array; | 2472 | const u64 *array; |
2474 | 2473 | ||
2475 | if (!(type & PERF_SAMPLE_TIME)) | 2474 | if (!(type & PERF_SAMPLE_TIME)) |
@@ -2480,7 +2479,7 @@ int perf_evsel__parse_sample_timestamp(struct evsel *evsel, | |||
2480 | .time = -1ULL, | 2479 | .time = -1ULL, |
2481 | }; | 2480 | }; |
2482 | 2481 | ||
2483 | if (!evsel->attr.sample_id_all) | 2482 | if (!evsel->core.attr.sample_id_all) |
2484 | return -1; | 2483 | return -1; |
2485 | if (perf_evsel__parse_id_sample(evsel, event, &data)) | 2484 | if (perf_evsel__parse_id_sample(evsel, event, &data)) |
2486 | return -1; | 2485 | return -1; |
@@ -2866,8 +2865,8 @@ bool perf_evsel__fallback(struct evsel *evsel, int err, | |||
2866 | int paranoid; | 2865 | int paranoid; |
2867 | 2866 | ||
2868 | if ((err == ENOENT || err == ENXIO || err == ENODEV) && | 2867 | if ((err == ENOENT || err == ENXIO || err == ENODEV) && |
2869 | evsel->attr.type == PERF_TYPE_HARDWARE && | 2868 | evsel->core.attr.type == PERF_TYPE_HARDWARE && |
2870 | evsel->attr.config == PERF_COUNT_HW_CPU_CYCLES) { | 2869 | evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES) { |
2871 | /* | 2870 | /* |
2872 | * If it's cycles then fall back to hrtimer based | 2871 | * If it's cycles then fall back to hrtimer based |
2873 | * cpu-clock-tick sw counter, which is always available even if | 2872 | * cpu-clock-tick sw counter, which is always available even if |
@@ -2879,12 +2878,12 @@ bool perf_evsel__fallback(struct evsel *evsel, int err, | |||
2879 | scnprintf(msg, msgsize, "%s", | 2878 | scnprintf(msg, msgsize, "%s", |
2880 | "The cycles event is not supported, trying to fall back to cpu-clock-ticks"); | 2879 | "The cycles event is not supported, trying to fall back to cpu-clock-ticks"); |
2881 | 2880 | ||
2882 | evsel->attr.type = PERF_TYPE_SOFTWARE; | 2881 | evsel->core.attr.type = PERF_TYPE_SOFTWARE; |
2883 | evsel->attr.config = PERF_COUNT_SW_CPU_CLOCK; | 2882 | evsel->core.attr.config = PERF_COUNT_SW_CPU_CLOCK; |
2884 | 2883 | ||
2885 | zfree(&evsel->name); | 2884 | zfree(&evsel->name); |
2886 | return true; | 2885 | return true; |
2887 | } else if (err == EACCES && !evsel->attr.exclude_kernel && | 2886 | } else if (err == EACCES && !evsel->core.attr.exclude_kernel && |
2888 | (paranoid = perf_event_paranoid()) > 1) { | 2887 | (paranoid = perf_event_paranoid()) > 1) { |
2889 | const char *name = perf_evsel__name(evsel); | 2888 | const char *name = perf_evsel__name(evsel); |
2890 | char *new_name; | 2889 | char *new_name; |
@@ -2903,7 +2902,7 @@ bool perf_evsel__fallback(struct evsel *evsel, int err, | |||
2903 | evsel->name = new_name; | 2902 | evsel->name = new_name; |
2904 | scnprintf(msg, msgsize, | 2903 | scnprintf(msg, msgsize, |
2905 | "kernel.perf_event_paranoid=%d, trying to fall back to excluding kernel samples", paranoid); | 2904 | "kernel.perf_event_paranoid=%d, trying to fall back to excluding kernel samples", paranoid); |
2906 | evsel->attr.exclude_kernel = 1; | 2905 | evsel->core.attr.exclude_kernel = 1; |
2907 | 2906 | ||
2908 | return true; | 2907 | return true; |
2909 | } | 2908 | } |
@@ -3000,15 +2999,15 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, | |||
3000 | "No such device - did you specify an out-of-range profile CPU?"); | 2999 | "No such device - did you specify an out-of-range profile CPU?"); |
3001 | break; | 3000 | break; |
3002 | case EOPNOTSUPP: | 3001 | case EOPNOTSUPP: |
3003 | if (evsel->attr.sample_period != 0) | 3002 | if (evsel->core.attr.sample_period != 0) |
3004 | return scnprintf(msg, size, | 3003 | return scnprintf(msg, size, |
3005 | "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'", | 3004 | "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'", |
3006 | perf_evsel__name(evsel)); | 3005 | perf_evsel__name(evsel)); |
3007 | if (evsel->attr.precise_ip) | 3006 | if (evsel->core.attr.precise_ip) |
3008 | return scnprintf(msg, size, "%s", | 3007 | return scnprintf(msg, size, "%s", |
3009 | "\'precise\' request may not be supported. Try removing 'p' modifier."); | 3008 | "\'precise\' request may not be supported. Try removing 'p' modifier."); |
3010 | #if defined(__i386__) || defined(__x86_64__) | 3009 | #if defined(__i386__) || defined(__x86_64__) |
3011 | if (evsel->attr.type == PERF_TYPE_HARDWARE) | 3010 | if (evsel->core.attr.type == PERF_TYPE_HARDWARE) |
3012 | return scnprintf(msg, size, "%s", | 3011 | return scnprintf(msg, size, "%s", |
3013 | "No hardware sampling interrupt available.\n"); | 3012 | "No hardware sampling interrupt available.\n"); |
3014 | #endif | 3013 | #endif |
@@ -3020,7 +3019,7 @@ int perf_evsel__open_strerror(struct evsel *evsel, struct target *target, | |||
3020 | "We found oprofile daemon running, please stop it and try again."); | 3019 | "We found oprofile daemon running, please stop it and try again."); |
3021 | break; | 3020 | break; |
3022 | case EINVAL: | 3021 | case EINVAL: |
3023 | if (evsel->attr.write_backward && perf_missing_features.write_backward) | 3022 | if (evsel->core.attr.write_backward && perf_missing_features.write_backward) |
3024 | return scnprintf(msg, size, "Reading from overwrite event is not supported by this kernel."); | 3023 | return scnprintf(msg, size, "Reading from overwrite event is not supported by this kernel."); |
3025 | if (perf_missing_features.clockid) | 3024 | if (perf_missing_features.clockid) |
3026 | return scnprintf(msg, size, "clockid feature not supported."); | 3025 | return scnprintf(msg, size, "clockid feature not supported."); |
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index d74cac6fe306..43f66158de3b 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -103,7 +103,6 @@ struct bpf_object; | |||
103 | struct evsel { | 103 | struct evsel { |
104 | struct perf_evsel core; | 104 | struct perf_evsel core; |
105 | struct evlist *evlist; | 105 | struct evlist *evlist; |
106 | struct perf_event_attr attr; | ||
107 | char *filter; | 106 | char *filter; |
108 | struct xyarray *fd; | 107 | struct xyarray *fd; |
109 | struct xyarray *sample_id; | 108 | struct xyarray *sample_id; |
@@ -327,21 +326,21 @@ u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sam | |||
327 | struct tep_format_field *perf_evsel__field(struct evsel *evsel, const char *name); | 326 | struct tep_format_field *perf_evsel__field(struct evsel *evsel, const char *name); |
328 | 327 | ||
329 | #define perf_evsel__match(evsel, t, c) \ | 328 | #define perf_evsel__match(evsel, t, c) \ |
330 | (evsel->attr.type == PERF_TYPE_##t && \ | 329 | (evsel->core.attr.type == PERF_TYPE_##t && \ |
331 | evsel->attr.config == PERF_COUNT_##c) | 330 | evsel->core.attr.config == PERF_COUNT_##c) |
332 | 331 | ||
333 | static inline bool perf_evsel__match2(struct evsel *e1, | 332 | static inline bool perf_evsel__match2(struct evsel *e1, |
334 | struct evsel *e2) | 333 | struct evsel *e2) |
335 | { | 334 | { |
336 | return (e1->attr.type == e2->attr.type) && | 335 | return (e1->core.attr.type == e2->core.attr.type) && |
337 | (e1->attr.config == e2->attr.config); | 336 | (e1->core.attr.config == e2->core.attr.config); |
338 | } | 337 | } |
339 | 338 | ||
340 | #define perf_evsel__cmp(a, b) \ | 339 | #define perf_evsel__cmp(a, b) \ |
341 | ((a) && \ | 340 | ((a) && \ |
342 | (b) && \ | 341 | (b) && \ |
343 | (a)->attr.type == (b)->attr.type && \ | 342 | (a)->core.attr.type == (b)->core.attr.type && \ |
344 | (a)->attr.config == (b)->attr.config) | 343 | (a)->core.attr.config == (b)->core.attr.config) |
345 | 344 | ||
346 | int perf_evsel__read(struct evsel *evsel, int cpu, int thread, | 345 | int perf_evsel__read(struct evsel *evsel, int cpu, int thread, |
347 | struct perf_counts_values *count); | 346 | struct perf_counts_values *count); |
@@ -490,12 +489,12 @@ for ((_evsel) = _leader; \ | |||
490 | 489 | ||
491 | static inline bool perf_evsel__has_branch_callstack(const struct evsel *evsel) | 490 | static inline bool perf_evsel__has_branch_callstack(const struct evsel *evsel) |
492 | { | 491 | { |
493 | return evsel->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; | 492 | return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; |
494 | } | 493 | } |
495 | 494 | ||
496 | static inline bool evsel__has_callchain(const struct evsel *evsel) | 495 | static inline bool evsel__has_callchain(const struct evsel *evsel) |
497 | { | 496 | { |
498 | return (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0; | 497 | return (evsel->core.attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0; |
499 | } | 498 | } |
500 | 499 | ||
501 | typedef int (*attr__fprintf_f)(FILE *, const char *, const char *, void *); | 500 | typedef int (*attr__fprintf_f)(FILE *, const char *, const char *, void *); |
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c index 1fddb7da4b51..3466eca34a00 100644 --- a/tools/perf/util/evsel_fprintf.c +++ b/tools/perf/util/evsel_fprintf.c | |||
@@ -60,22 +60,22 @@ int perf_evsel__fprintf(struct evsel *evsel, | |||
60 | printed += fprintf(fp, "%s", perf_evsel__name(evsel)); | 60 | printed += fprintf(fp, "%s", perf_evsel__name(evsel)); |
61 | 61 | ||
62 | if (details->verbose) { | 62 | if (details->verbose) { |
63 | printed += perf_event_attr__fprintf(fp, &evsel->attr, | 63 | printed += perf_event_attr__fprintf(fp, &evsel->core.attr, |
64 | __print_attr__fprintf, &first); | 64 | __print_attr__fprintf, &first); |
65 | } else if (details->freq) { | 65 | } else if (details->freq) { |
66 | const char *term = "sample_freq"; | 66 | const char *term = "sample_freq"; |
67 | 67 | ||
68 | if (!evsel->attr.freq) | 68 | if (!evsel->core.attr.freq) |
69 | term = "sample_period"; | 69 | term = "sample_period"; |
70 | 70 | ||
71 | printed += comma_fprintf(fp, &first, " %s=%" PRIu64, | 71 | printed += comma_fprintf(fp, &first, " %s=%" PRIu64, |
72 | term, (u64)evsel->attr.sample_freq); | 72 | term, (u64)evsel->core.attr.sample_freq); |
73 | } | 73 | } |
74 | 74 | ||
75 | if (details->trace_fields) { | 75 | if (details->trace_fields) { |
76 | struct tep_format_field *field; | 76 | struct tep_format_field *field; |
77 | 77 | ||
78 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { | 78 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) { |
79 | printed += comma_fprintf(fp, &first, " (not a tracepoint)"); | 79 | printed += comma_fprintf(fp, &first, " (not a tracepoint)"); |
80 | goto out; | 80 | goto out; |
81 | } | 81 | } |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 141de4425100..d81afe56392c 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -488,13 +488,13 @@ static int write_event_desc(struct feat_fd *ff, | |||
488 | /* | 488 | /* |
489 | * size of perf_event_attr struct | 489 | * size of perf_event_attr struct |
490 | */ | 490 | */ |
491 | sz = (u32)sizeof(evsel->attr); | 491 | sz = (u32)sizeof(evsel->core.attr); |
492 | ret = do_write(ff, &sz, sizeof(sz)); | 492 | ret = do_write(ff, &sz, sizeof(sz)); |
493 | if (ret < 0) | 493 | if (ret < 0) |
494 | return ret; | 494 | return ret; |
495 | 495 | ||
496 | evlist__for_each_entry(evlist, evsel) { | 496 | evlist__for_each_entry(evlist, evsel) { |
497 | ret = do_write(ff, &evsel->attr, sz); | 497 | ret = do_write(ff, &evsel->core.attr, sz); |
498 | if (ret < 0) | 498 | if (ret < 0) |
499 | return ret; | 499 | return ret; |
500 | /* | 500 | /* |
@@ -1575,7 +1575,7 @@ static void free_event_desc(struct evsel *events) | |||
1575 | if (!events) | 1575 | if (!events) |
1576 | return; | 1576 | return; |
1577 | 1577 | ||
1578 | for (evsel = events; evsel->attr.size; evsel++) { | 1578 | for (evsel = events; evsel->core.attr.size; evsel++) { |
1579 | zfree(&evsel->name); | 1579 | zfree(&evsel->name); |
1580 | zfree(&evsel->id); | 1580 | zfree(&evsel->id); |
1581 | } | 1581 | } |
@@ -1603,12 +1603,12 @@ static struct evsel *read_event_desc(struct feat_fd *ff) | |||
1603 | if (!buf) | 1603 | if (!buf) |
1604 | goto error; | 1604 | goto error; |
1605 | 1605 | ||
1606 | /* the last event terminates with evsel->attr.size == 0: */ | 1606 | /* the last event terminates with evsel->core.attr.size == 0: */ |
1607 | events = calloc(nre + 1, sizeof(*events)); | 1607 | events = calloc(nre + 1, sizeof(*events)); |
1608 | if (!events) | 1608 | if (!events) |
1609 | goto error; | 1609 | goto error; |
1610 | 1610 | ||
1611 | msz = sizeof(evsel->attr); | 1611 | msz = sizeof(evsel->core.attr); |
1612 | if (sz < msz) | 1612 | if (sz < msz) |
1613 | msz = sz; | 1613 | msz = sz; |
1614 | 1614 | ||
@@ -1625,7 +1625,7 @@ static struct evsel *read_event_desc(struct feat_fd *ff) | |||
1625 | if (ff->ph->needs_swap) | 1625 | if (ff->ph->needs_swap) |
1626 | perf_event__attr_swap(buf); | 1626 | perf_event__attr_swap(buf); |
1627 | 1627 | ||
1628 | memcpy(&evsel->attr, buf, msz); | 1628 | memcpy(&evsel->core.attr, buf, msz); |
1629 | 1629 | ||
1630 | if (do_read_u32(ff, &nr)) | 1630 | if (do_read_u32(ff, &nr)) |
1631 | goto error; | 1631 | goto error; |
@@ -1683,7 +1683,7 @@ static void print_event_desc(struct feat_fd *ff, FILE *fp) | |||
1683 | return; | 1683 | return; |
1684 | } | 1684 | } |
1685 | 1685 | ||
1686 | for (evsel = events; evsel->attr.size; evsel++) { | 1686 | for (evsel = events; evsel->core.attr.size; evsel++) { |
1687 | fprintf(fp, "# event : name = %s, ", evsel->name); | 1687 | fprintf(fp, "# event : name = %s, ", evsel->name); |
1688 | 1688 | ||
1689 | if (evsel->ids) { | 1689 | if (evsel->ids) { |
@@ -1696,7 +1696,7 @@ static void print_event_desc(struct feat_fd *ff, FILE *fp) | |||
1696 | fprintf(fp, " }"); | 1696 | fprintf(fp, " }"); |
1697 | } | 1697 | } |
1698 | 1698 | ||
1699 | perf_event_attr__fprintf(fp, &evsel->attr, __desc_attr__fprintf, NULL); | 1699 | perf_event_attr__fprintf(fp, &evsel->core.attr, __desc_attr__fprintf, NULL); |
1700 | 1700 | ||
1701 | fputc('\n', fp); | 1701 | fputc('\n', fp); |
1702 | } | 1702 | } |
@@ -2138,7 +2138,7 @@ process_event_desc(struct feat_fd *ff, void *data __maybe_unused) | |||
2138 | ff->events = events; | 2138 | ff->events = events; |
2139 | } | 2139 | } |
2140 | 2140 | ||
2141 | for (evsel = events; evsel->attr.size; evsel++) | 2141 | for (evsel = events; evsel->core.attr.size; evsel++) |
2142 | perf_evlist__set_event_name(session->evlist, evsel); | 2142 | perf_evlist__set_event_name(session->evlist, evsel); |
2143 | 2143 | ||
2144 | if (!session->data->is_pipe) | 2144 | if (!session->data->is_pipe) |
@@ -3071,7 +3071,7 @@ int perf_session__write_header(struct perf_session *session, | |||
3071 | 3071 | ||
3072 | evlist__for_each_entry(evlist, evsel) { | 3072 | evlist__for_each_entry(evlist, evsel) { |
3073 | f_attr = (struct perf_file_attr){ | 3073 | f_attr = (struct perf_file_attr){ |
3074 | .attr = evsel->attr, | 3074 | .attr = evsel->core.attr, |
3075 | .ids = { | 3075 | .ids = { |
3076 | .offset = evsel->id_offset, | 3076 | .offset = evsel->id_offset, |
3077 | .size = evsel->ids * sizeof(u64), | 3077 | .size = evsel->ids * sizeof(u64), |
@@ -3494,9 +3494,9 @@ static int perf_evsel__prepare_tracepoint_event(struct evsel *evsel, | |||
3494 | return -1; | 3494 | return -1; |
3495 | } | 3495 | } |
3496 | 3496 | ||
3497 | event = tep_find_event(pevent, evsel->attr.config); | 3497 | event = tep_find_event(pevent, evsel->core.attr.config); |
3498 | if (event == NULL) { | 3498 | if (event == NULL) { |
3499 | pr_debug("cannot find event format for %d\n", (int)evsel->attr.config); | 3499 | pr_debug("cannot find event format for %d\n", (int)evsel->core.attr.config); |
3500 | return -1; | 3500 | return -1; |
3501 | } | 3501 | } |
3502 | 3502 | ||
@@ -3517,7 +3517,7 @@ static int perf_evlist__prepare_tracepoint_events(struct evlist *evlist, | |||
3517 | struct evsel *pos; | 3517 | struct evsel *pos; |
3518 | 3518 | ||
3519 | evlist__for_each_entry(evlist, pos) { | 3519 | evlist__for_each_entry(evlist, pos) { |
3520 | if (pos->attr.type == PERF_TYPE_TRACEPOINT && | 3520 | if (pos->core.attr.type == PERF_TYPE_TRACEPOINT && |
3521 | perf_evsel__prepare_tracepoint_event(pos, pevent)) | 3521 | perf_evsel__prepare_tracepoint_event(pos, pevent)) |
3522 | return -1; | 3522 | return -1; |
3523 | } | 3523 | } |
@@ -3928,7 +3928,7 @@ int perf_event__synthesize_attrs(struct perf_tool *tool, | |||
3928 | int err = 0; | 3928 | int err = 0; |
3929 | 3929 | ||
3930 | evlist__for_each_entry(evlist, evsel) { | 3930 | evlist__for_each_entry(evlist, evsel) { |
3931 | err = perf_event__synthesize_attr(tool, &evsel->attr, evsel->ids, | 3931 | err = perf_event__synthesize_attr(tool, &evsel->core.attr, evsel->ids, |
3932 | evsel->id, process); | 3932 | evsel->id, process); |
3933 | if (err) { | 3933 | if (err) { |
3934 | pr_debug("failed to create perf header attribute\n"); | 3934 | pr_debug("failed to create perf header attribute\n"); |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index bb5437f549b6..821e0fe6cf26 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -2638,7 +2638,7 @@ int __hists__scnprintf_title(struct hists *hists, char *bf, size_t size, bool sh | |||
2638 | enable_ref = true; | 2638 | enable_ref = true; |
2639 | 2639 | ||
2640 | if (show_freq) | 2640 | if (show_freq) |
2641 | scnprintf(sample_freq_str, sizeof(sample_freq_str), " %d Hz,", evsel->attr.sample_freq); | 2641 | scnprintf(sample_freq_str, sizeof(sample_freq_str), " %d Hz,", evsel->core.attr.sample_freq); |
2642 | 2642 | ||
2643 | nr_samples = convert_unit(nr_samples, &unit); | 2643 | nr_samples = convert_unit(nr_samples, &unit); |
2644 | printed = scnprintf(bf, size, | 2644 | printed = scnprintf(bf, size, |
diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index 849a5b713b04..7eb9e6dc27dd 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c | |||
@@ -768,7 +768,7 @@ static int intel_bts_synth_events(struct intel_bts *bts, | |||
768 | int err; | 768 | int err; |
769 | 769 | ||
770 | evlist__for_each_entry(evlist, evsel) { | 770 | evlist__for_each_entry(evlist, evsel) { |
771 | if (evsel->attr.type == bts->pmu_type && evsel->ids) { | 771 | if (evsel->core.attr.type == bts->pmu_type && evsel->ids) { |
772 | found = true; | 772 | found = true; |
773 | break; | 773 | break; |
774 | } | 774 | } |
@@ -782,18 +782,18 @@ static int intel_bts_synth_events(struct intel_bts *bts, | |||
782 | memset(&attr, 0, sizeof(struct perf_event_attr)); | 782 | memset(&attr, 0, sizeof(struct perf_event_attr)); |
783 | attr.size = sizeof(struct perf_event_attr); | 783 | attr.size = sizeof(struct perf_event_attr); |
784 | attr.type = PERF_TYPE_HARDWARE; | 784 | attr.type = PERF_TYPE_HARDWARE; |
785 | attr.sample_type = evsel->attr.sample_type & PERF_SAMPLE_MASK; | 785 | attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK; |
786 | attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID | | 786 | attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID | |
787 | PERF_SAMPLE_PERIOD; | 787 | PERF_SAMPLE_PERIOD; |
788 | attr.sample_type &= ~(u64)PERF_SAMPLE_TIME; | 788 | attr.sample_type &= ~(u64)PERF_SAMPLE_TIME; |
789 | attr.sample_type &= ~(u64)PERF_SAMPLE_CPU; | 789 | attr.sample_type &= ~(u64)PERF_SAMPLE_CPU; |
790 | attr.exclude_user = evsel->attr.exclude_user; | 790 | attr.exclude_user = evsel->core.attr.exclude_user; |
791 | attr.exclude_kernel = evsel->attr.exclude_kernel; | 791 | attr.exclude_kernel = evsel->core.attr.exclude_kernel; |
792 | attr.exclude_hv = evsel->attr.exclude_hv; | 792 | attr.exclude_hv = evsel->core.attr.exclude_hv; |
793 | attr.exclude_host = evsel->attr.exclude_host; | 793 | attr.exclude_host = evsel->core.attr.exclude_host; |
794 | attr.exclude_guest = evsel->attr.exclude_guest; | 794 | attr.exclude_guest = evsel->core.attr.exclude_guest; |
795 | attr.sample_id_all = evsel->attr.sample_id_all; | 795 | attr.sample_id_all = evsel->core.attr.sample_id_all; |
796 | attr.read_format = evsel->attr.read_format; | 796 | attr.read_format = evsel->core.attr.read_format; |
797 | 797 | ||
798 | id = evsel->id[0] + 1000000000; | 798 | id = evsel->id[0] + 1000000000; |
799 | if (!id) | 799 | if (!id) |
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index c88e3d1ee9c7..4c52204868d8 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c | |||
@@ -726,8 +726,8 @@ static bool intel_pt_exclude_kernel(struct intel_pt *pt) | |||
726 | struct evsel *evsel; | 726 | struct evsel *evsel; |
727 | 727 | ||
728 | evlist__for_each_entry(pt->session->evlist, evsel) { | 728 | evlist__for_each_entry(pt->session->evlist, evsel) { |
729 | if (intel_pt_get_config(pt, &evsel->attr, NULL) && | 729 | if (intel_pt_get_config(pt, &evsel->core.attr, NULL) && |
730 | !evsel->attr.exclude_kernel) | 730 | !evsel->core.attr.exclude_kernel) |
731 | return false; | 731 | return false; |
732 | } | 732 | } |
733 | return true; | 733 | return true; |
@@ -742,7 +742,7 @@ static bool intel_pt_return_compression(struct intel_pt *pt) | |||
742 | return true; | 742 | return true; |
743 | 743 | ||
744 | evlist__for_each_entry(pt->session->evlist, evsel) { | 744 | evlist__for_each_entry(pt->session->evlist, evsel) { |
745 | if (intel_pt_get_config(pt, &evsel->attr, &config) && | 745 | if (intel_pt_get_config(pt, &evsel->core.attr, &config) && |
746 | (config & pt->noretcomp_bit)) | 746 | (config & pt->noretcomp_bit)) |
747 | return false; | 747 | return false; |
748 | } | 748 | } |
@@ -755,7 +755,7 @@ static bool intel_pt_branch_enable(struct intel_pt *pt) | |||
755 | u64 config; | 755 | u64 config; |
756 | 756 | ||
757 | evlist__for_each_entry(pt->session->evlist, evsel) { | 757 | evlist__for_each_entry(pt->session->evlist, evsel) { |
758 | if (intel_pt_get_config(pt, &evsel->attr, &config) && | 758 | if (intel_pt_get_config(pt, &evsel->core.attr, &config) && |
759 | (config & 1) && !(config & 0x2000)) | 759 | (config & 1) && !(config & 0x2000)) |
760 | return false; | 760 | return false; |
761 | } | 761 | } |
@@ -775,7 +775,7 @@ static unsigned int intel_pt_mtc_period(struct intel_pt *pt) | |||
775 | config >>= 1; | 775 | config >>= 1; |
776 | 776 | ||
777 | evlist__for_each_entry(pt->session->evlist, evsel) { | 777 | evlist__for_each_entry(pt->session->evlist, evsel) { |
778 | if (intel_pt_get_config(pt, &evsel->attr, &config)) | 778 | if (intel_pt_get_config(pt, &evsel->core.attr, &config)) |
779 | return (config & pt->mtc_freq_bits) >> shift; | 779 | return (config & pt->mtc_freq_bits) >> shift; |
780 | } | 780 | } |
781 | return 0; | 781 | return 0; |
@@ -791,9 +791,9 @@ static bool intel_pt_timeless_decoding(struct intel_pt *pt) | |||
791 | return true; | 791 | return true; |
792 | 792 | ||
793 | evlist__for_each_entry(pt->session->evlist, evsel) { | 793 | evlist__for_each_entry(pt->session->evlist, evsel) { |
794 | if (!(evsel->attr.sample_type & PERF_SAMPLE_TIME)) | 794 | if (!(evsel->core.attr.sample_type & PERF_SAMPLE_TIME)) |
795 | return true; | 795 | return true; |
796 | if (intel_pt_get_config(pt, &evsel->attr, &config)) { | 796 | if (intel_pt_get_config(pt, &evsel->core.attr, &config)) { |
797 | if (config & pt->tsc_bit) | 797 | if (config & pt->tsc_bit) |
798 | timeless_decoding = false; | 798 | timeless_decoding = false; |
799 | else | 799 | else |
@@ -808,8 +808,8 @@ static bool intel_pt_tracing_kernel(struct intel_pt *pt) | |||
808 | struct evsel *evsel; | 808 | struct evsel *evsel; |
809 | 809 | ||
810 | evlist__for_each_entry(pt->session->evlist, evsel) { | 810 | evlist__for_each_entry(pt->session->evlist, evsel) { |
811 | if (intel_pt_get_config(pt, &evsel->attr, NULL) && | 811 | if (intel_pt_get_config(pt, &evsel->core.attr, NULL) && |
812 | !evsel->attr.exclude_kernel) | 812 | !evsel->core.attr.exclude_kernel) |
813 | return true; | 813 | return true; |
814 | } | 814 | } |
815 | return false; | 815 | return false; |
@@ -825,7 +825,7 @@ static bool intel_pt_have_tsc(struct intel_pt *pt) | |||
825 | return false; | 825 | return false; |
826 | 826 | ||
827 | evlist__for_each_entry(pt->session->evlist, evsel) { | 827 | evlist__for_each_entry(pt->session->evlist, evsel) { |
828 | if (intel_pt_get_config(pt, &evsel->attr, &config)) { | 828 | if (intel_pt_get_config(pt, &evsel->core.attr, &config)) { |
829 | if (config & pt->tsc_bit) | 829 | if (config & pt->tsc_bit) |
830 | have_tsc = true; | 830 | have_tsc = true; |
831 | else | 831 | else |
@@ -1703,7 +1703,7 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq) | |||
1703 | union perf_event *event = ptq->event_buf; | 1703 | union perf_event *event = ptq->event_buf; |
1704 | struct intel_pt *pt = ptq->pt; | 1704 | struct intel_pt *pt = ptq->pt; |
1705 | struct evsel *evsel = pt->pebs_evsel; | 1705 | struct evsel *evsel = pt->pebs_evsel; |
1706 | u64 sample_type = evsel->attr.sample_type; | 1706 | u64 sample_type = evsel->core.attr.sample_type; |
1707 | u64 id = evsel->id[0]; | 1707 | u64 id = evsel->id[0]; |
1708 | u8 cpumode; | 1708 | u8 cpumode; |
1709 | 1709 | ||
@@ -1715,8 +1715,8 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq) | |||
1715 | sample.id = id; | 1715 | sample.id = id; |
1716 | sample.stream_id = id; | 1716 | sample.stream_id = id; |
1717 | 1717 | ||
1718 | if (!evsel->attr.freq) | 1718 | if (!evsel->core.attr.freq) |
1719 | sample.period = evsel->attr.sample_period; | 1719 | sample.period = evsel->core.attr.sample_period; |
1720 | 1720 | ||
1721 | /* No support for non-zero CS base */ | 1721 | /* No support for non-zero CS base */ |
1722 | if (items->has_ip) | 1722 | if (items->has_ip) |
@@ -1757,7 +1757,7 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq) | |||
1757 | if (sample_type & PERF_SAMPLE_REGS_INTR && | 1757 | if (sample_type & PERF_SAMPLE_REGS_INTR && |
1758 | items->mask[INTEL_PT_GP_REGS_POS]) { | 1758 | items->mask[INTEL_PT_GP_REGS_POS]) { |
1759 | u64 regs[sizeof(sample.intr_regs.mask)]; | 1759 | u64 regs[sizeof(sample.intr_regs.mask)]; |
1760 | u64 regs_mask = evsel->attr.sample_regs_intr; | 1760 | u64 regs_mask = evsel->core.attr.sample_regs_intr; |
1761 | u64 *pos; | 1761 | u64 *pos; |
1762 | 1762 | ||
1763 | sample.intr_regs.abi = items->is_32_bit ? | 1763 | sample.intr_regs.abi = items->is_32_bit ? |
@@ -2734,7 +2734,7 @@ static struct evsel *intel_pt_evsel(struct intel_pt *pt, | |||
2734 | struct evsel *evsel; | 2734 | struct evsel *evsel; |
2735 | 2735 | ||
2736 | evlist__for_each_entry(evlist, evsel) { | 2736 | evlist__for_each_entry(evlist, evsel) { |
2737 | if (evsel->attr.type == pt->pmu_type && evsel->ids) | 2737 | if (evsel->core.attr.type == pt->pmu_type && evsel->ids) |
2738 | return evsel; | 2738 | return evsel; |
2739 | } | 2739 | } |
2740 | 2740 | ||
@@ -2758,7 +2758,7 @@ static int intel_pt_synth_events(struct intel_pt *pt, | |||
2758 | memset(&attr, 0, sizeof(struct perf_event_attr)); | 2758 | memset(&attr, 0, sizeof(struct perf_event_attr)); |
2759 | attr.size = sizeof(struct perf_event_attr); | 2759 | attr.size = sizeof(struct perf_event_attr); |
2760 | attr.type = PERF_TYPE_HARDWARE; | 2760 | attr.type = PERF_TYPE_HARDWARE; |
2761 | attr.sample_type = evsel->attr.sample_type & PERF_SAMPLE_MASK; | 2761 | attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK; |
2762 | attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID | | 2762 | attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID | |
2763 | PERF_SAMPLE_PERIOD; | 2763 | PERF_SAMPLE_PERIOD; |
2764 | if (pt->timeless_decoding) | 2764 | if (pt->timeless_decoding) |
@@ -2767,13 +2767,13 @@ static int intel_pt_synth_events(struct intel_pt *pt, | |||
2767 | attr.sample_type |= PERF_SAMPLE_TIME; | 2767 | attr.sample_type |= PERF_SAMPLE_TIME; |
2768 | if (!pt->per_cpu_mmaps) | 2768 | if (!pt->per_cpu_mmaps) |
2769 | attr.sample_type &= ~(u64)PERF_SAMPLE_CPU; | 2769 | attr.sample_type &= ~(u64)PERF_SAMPLE_CPU; |
2770 | attr.exclude_user = evsel->attr.exclude_user; | 2770 | attr.exclude_user = evsel->core.attr.exclude_user; |
2771 | attr.exclude_kernel = evsel->attr.exclude_kernel; | 2771 | attr.exclude_kernel = evsel->core.attr.exclude_kernel; |
2772 | attr.exclude_hv = evsel->attr.exclude_hv; | 2772 | attr.exclude_hv = evsel->core.attr.exclude_hv; |
2773 | attr.exclude_host = evsel->attr.exclude_host; | 2773 | attr.exclude_host = evsel->core.attr.exclude_host; |
2774 | attr.exclude_guest = evsel->attr.exclude_guest; | 2774 | attr.exclude_guest = evsel->core.attr.exclude_guest; |
2775 | attr.sample_id_all = evsel->attr.sample_id_all; | 2775 | attr.sample_id_all = evsel->core.attr.sample_id_all; |
2776 | attr.read_format = evsel->attr.read_format; | 2776 | attr.read_format = evsel->core.attr.read_format; |
2777 | 2777 | ||
2778 | id = evsel->id[0] + 1000000000; | 2778 | id = evsel->id[0] + 1000000000; |
2779 | if (!id) | 2779 | if (!id) |
@@ -2857,7 +2857,7 @@ static int intel_pt_synth_events(struct intel_pt *pt, | |||
2857 | id += 1; | 2857 | id += 1; |
2858 | } | 2858 | } |
2859 | 2859 | ||
2860 | if (pt->synth_opts.pwr_events && (evsel->attr.config & 0x10)) { | 2860 | if (pt->synth_opts.pwr_events && (evsel->core.attr.config & 0x10)) { |
2861 | attr.config = PERF_SYNTH_INTEL_MWAIT; | 2861 | attr.config = PERF_SYNTH_INTEL_MWAIT; |
2862 | err = intel_pt_synth_event(session, "mwait", &attr, id); | 2862 | err = intel_pt_synth_event(session, "mwait", &attr, id); |
2863 | if (err) | 2863 | if (err) |
@@ -2913,7 +2913,7 @@ static bool intel_pt_find_switch(struct evlist *evlist) | |||
2913 | struct evsel *evsel; | 2913 | struct evsel *evsel; |
2914 | 2914 | ||
2915 | evlist__for_each_entry(evlist, evsel) { | 2915 | evlist__for_each_entry(evlist, evsel) { |
2916 | if (evsel->attr.context_switch) | 2916 | if (evsel->core.attr.context_switch) |
2917 | return true; | 2917 | return true; |
2918 | } | 2918 | } |
2919 | 2919 | ||
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 8df60703411a..bbeac4f66402 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c | |||
@@ -124,7 +124,7 @@ jit_validate_events(struct perf_session *session) | |||
124 | * check that all events use CLOCK_MONOTONIC | 124 | * check that all events use CLOCK_MONOTONIC |
125 | */ | 125 | */ |
126 | evlist__for_each_entry(session->evlist, evsel) { | 126 | evlist__for_each_entry(session->evlist, evsel) { |
127 | if (evsel->attr.use_clockid == 0 || evsel->attr.clockid != CLOCK_MONOTONIC) | 127 | if (evsel->core.attr.use_clockid == 0 || evsel->core.attr.clockid != CLOCK_MONOTONIC) |
128 | return -1; | 128 | return -1; |
129 | } | 129 | } |
130 | return 0; | 130 | return 0; |
@@ -779,7 +779,7 @@ jit_process(struct perf_session *session, | |||
779 | * perf sets the same sample type to all events as of now | 779 | * perf sets the same sample type to all events as of now |
780 | */ | 780 | */ |
781 | first = perf_evlist__first(session->evlist); | 781 | first = perf_evlist__first(session->evlist); |
782 | jd.sample_type = first->attr.sample_type; | 782 | jd.sample_type = first->core.attr.sample_type; |
783 | 783 | ||
784 | *nbytes = 0; | 784 | *nbytes = 0; |
785 | 785 | ||
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index ec0675b0caa8..f6ee7fbad3e4 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -2498,8 +2498,8 @@ static int thread__resolve_callchain_unwind(struct thread *thread, | |||
2498 | int max_stack) | 2498 | int max_stack) |
2499 | { | 2499 | { |
2500 | /* Can we do dwarf post unwind? */ | 2500 | /* Can we do dwarf post unwind? */ |
2501 | if (!((evsel->attr.sample_type & PERF_SAMPLE_REGS_USER) && | 2501 | if (!((evsel->core.attr.sample_type & PERF_SAMPLE_REGS_USER) && |
2502 | (evsel->attr.sample_type & PERF_SAMPLE_STACK_USER))) | 2502 | (evsel->core.attr.sample_type & PERF_SAMPLE_STACK_USER))) |
2503 | return 0; | 2503 | return 0; |
2504 | 2504 | ||
2505 | /* Bail out if nothing was captured. */ | 2505 | /* Bail out if nothing was captured. */ |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 10efc33c56a1..ec7ce18b999a 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -1590,16 +1590,16 @@ struct event_modifier { | |||
1590 | static int get_event_modifier(struct event_modifier *mod, char *str, | 1590 | static int get_event_modifier(struct event_modifier *mod, char *str, |
1591 | struct evsel *evsel) | 1591 | struct evsel *evsel) |
1592 | { | 1592 | { |
1593 | int eu = evsel ? evsel->attr.exclude_user : 0; | 1593 | int eu = evsel ? evsel->core.attr.exclude_user : 0; |
1594 | int ek = evsel ? evsel->attr.exclude_kernel : 0; | 1594 | int ek = evsel ? evsel->core.attr.exclude_kernel : 0; |
1595 | int eh = evsel ? evsel->attr.exclude_hv : 0; | 1595 | int eh = evsel ? evsel->core.attr.exclude_hv : 0; |
1596 | int eH = evsel ? evsel->attr.exclude_host : 0; | 1596 | int eH = evsel ? evsel->core.attr.exclude_host : 0; |
1597 | int eG = evsel ? evsel->attr.exclude_guest : 0; | 1597 | int eG = evsel ? evsel->core.attr.exclude_guest : 0; |
1598 | int eI = evsel ? evsel->attr.exclude_idle : 0; | 1598 | int eI = evsel ? evsel->core.attr.exclude_idle : 0; |
1599 | int precise = evsel ? evsel->attr.precise_ip : 0; | 1599 | int precise = evsel ? evsel->core.attr.precise_ip : 0; |
1600 | int precise_max = 0; | 1600 | int precise_max = 0; |
1601 | int sample_read = 0; | 1601 | int sample_read = 0; |
1602 | int pinned = evsel ? evsel->attr.pinned : 0; | 1602 | int pinned = evsel ? evsel->core.attr.pinned : 0; |
1603 | 1603 | ||
1604 | int exclude = eu | ek | eh; | 1604 | int exclude = eu | ek | eh; |
1605 | int exclude_GH = evsel ? evsel->exclude_GH : 0; | 1605 | int exclude_GH = evsel ? evsel->exclude_GH : 0; |
@@ -1717,20 +1717,20 @@ int parse_events__modifier_event(struct list_head *list, char *str, bool add) | |||
1717 | if (add && get_event_modifier(&mod, str, evsel)) | 1717 | if (add && get_event_modifier(&mod, str, evsel)) |
1718 | return -EINVAL; | 1718 | return -EINVAL; |
1719 | 1719 | ||
1720 | evsel->attr.exclude_user = mod.eu; | 1720 | evsel->core.attr.exclude_user = mod.eu; |
1721 | evsel->attr.exclude_kernel = mod.ek; | 1721 | evsel->core.attr.exclude_kernel = mod.ek; |
1722 | evsel->attr.exclude_hv = mod.eh; | 1722 | evsel->core.attr.exclude_hv = mod.eh; |
1723 | evsel->attr.precise_ip = mod.precise; | 1723 | evsel->core.attr.precise_ip = mod.precise; |
1724 | evsel->attr.exclude_host = mod.eH; | 1724 | evsel->core.attr.exclude_host = mod.eH; |
1725 | evsel->attr.exclude_guest = mod.eG; | 1725 | evsel->core.attr.exclude_guest = mod.eG; |
1726 | evsel->attr.exclude_idle = mod.eI; | 1726 | evsel->core.attr.exclude_idle = mod.eI; |
1727 | evsel->exclude_GH = mod.exclude_GH; | 1727 | evsel->exclude_GH = mod.exclude_GH; |
1728 | evsel->sample_read = mod.sample_read; | 1728 | evsel->sample_read = mod.sample_read; |
1729 | evsel->precise_max = mod.precise_max; | 1729 | evsel->precise_max = mod.precise_max; |
1730 | evsel->weak_group = mod.weak; | 1730 | evsel->weak_group = mod.weak; |
1731 | 1731 | ||
1732 | if (perf_evsel__is_group_leader(evsel)) | 1732 | if (perf_evsel__is_group_leader(evsel)) |
1733 | evsel->attr.pinned = mod.pinned; | 1733 | evsel->core.attr.pinned = mod.pinned; |
1734 | } | 1734 | } |
1735 | 1735 | ||
1736 | return 0; | 1736 | return 0; |
@@ -2071,7 +2071,7 @@ static int set_filter(struct evsel *evsel, const void *arg) | |||
2071 | return -1; | 2071 | return -1; |
2072 | } | 2072 | } |
2073 | 2073 | ||
2074 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT) { | 2074 | if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) { |
2075 | if (perf_evsel__append_tp_filter(evsel, str) < 0) { | 2075 | if (perf_evsel__append_tp_filter(evsel, str) < 0) { |
2076 | fprintf(stderr, | 2076 | fprintf(stderr, |
2077 | "not enough memory to hold filter string\n"); | 2077 | "not enough memory to hold filter string\n"); |
@@ -2082,7 +2082,7 @@ static int set_filter(struct evsel *evsel, const void *arg) | |||
2082 | } | 2082 | } |
2083 | 2083 | ||
2084 | while ((pmu = perf_pmu__scan(pmu)) != NULL) | 2084 | while ((pmu = perf_pmu__scan(pmu)) != NULL) |
2085 | if (pmu->type == evsel->attr.type) { | 2085 | if (pmu->type == evsel->core.attr.type) { |
2086 | found = true; | 2086 | found = true; |
2087 | break; | 2087 | break; |
2088 | } | 2088 | } |
@@ -2120,7 +2120,7 @@ static int add_exclude_perf_filter(struct evsel *evsel, | |||
2120 | { | 2120 | { |
2121 | char new_filter[64]; | 2121 | char new_filter[64]; |
2122 | 2122 | ||
2123 | if (evsel == NULL || evsel->attr.type != PERF_TYPE_TRACEPOINT) { | 2123 | if (evsel == NULL || evsel->core.attr.type != PERF_TYPE_TRACEPOINT) { |
2124 | fprintf(stderr, | 2124 | fprintf(stderr, |
2125 | "--exclude-perf option should follow a -e tracepoint option\n"); | 2125 | "--exclude-perf option should follow a -e tracepoint option\n"); |
2126 | return -1; | 2126 | return -1; |
@@ -2331,7 +2331,7 @@ static bool is_event_supported(u8 type, unsigned config) | |||
2331 | * by default as some ARM machines do not support it. | 2331 | * by default as some ARM machines do not support it. |
2332 | * | 2332 | * |
2333 | */ | 2333 | */ |
2334 | evsel->attr.exclude_kernel = 1; | 2334 | evsel->core.attr.exclude_kernel = 1; |
2335 | ret = evsel__open(evsel, NULL, tmap) >= 0; | 2335 | ret = evsel__open(evsel, NULL, tmap) >= 0; |
2336 | } | 2336 | } |
2337 | evsel__delete(evsel); | 2337 | evsel__delete(evsel); |
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index cf0a18d49018..23a4fa13b92d 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -337,7 +337,7 @@ static PyObject *pyrf_sample_event__repr(struct pyrf_event *pevent) | |||
337 | 337 | ||
338 | static bool is_tracepoint(struct pyrf_event *pevent) | 338 | static bool is_tracepoint(struct pyrf_event *pevent) |
339 | { | 339 | { |
340 | return pevent->evsel->attr.type == PERF_TYPE_TRACEPOINT; | 340 | return pevent->evsel->core.attr.type == PERF_TYPE_TRACEPOINT; |
341 | } | 341 | } |
342 | 342 | ||
343 | static PyObject* | 343 | static PyObject* |
@@ -389,7 +389,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) | |||
389 | if (!evsel->tp_format) { | 389 | if (!evsel->tp_format) { |
390 | struct tep_event *tp_format; | 390 | struct tep_event *tp_format; |
391 | 391 | ||
392 | tp_format = trace_event__tp_format_id(evsel->attr.config); | 392 | tp_format = trace_event__tp_format_id(evsel->core.attr.config); |
393 | if (!tp_format) | 393 | if (!tp_format) |
394 | return NULL; | 394 | return NULL; |
395 | 395 | ||
@@ -812,7 +812,7 @@ static PyObject *pyrf_evsel__open(struct pyrf_evsel *pevsel, | |||
812 | if (pcpus != NULL) | 812 | if (pcpus != NULL) |
813 | cpus = ((struct pyrf_cpu_map *)pcpus)->cpus; | 813 | cpus = ((struct pyrf_cpu_map *)pcpus)->cpus; |
814 | 814 | ||
815 | evsel->attr.inherit = inherit; | 815 | evsel->core.attr.inherit = inherit; |
816 | /* | 816 | /* |
817 | * This will group just the fds for this single evsel, to group | 817 | * This will group just the fds for this single evsel, to group |
818 | * multiple events, use evlist.open(). | 818 | * multiple events, use evlist.open(). |
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 3d3d732498e1..445788819969 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c | |||
@@ -29,7 +29,7 @@ static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str) | |||
29 | evsel = perf_evlist__first(evlist); | 29 | evsel = perf_evlist__first(evlist); |
30 | 30 | ||
31 | while (1) { | 31 | while (1) { |
32 | fd = sys_perf_event_open(&evsel->attr, pid, cpu, -1, flags); | 32 | fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); |
33 | if (fd < 0) { | 33 | if (fd < 0) { |
34 | if (pid == -1 && errno == EACCES) { | 34 | if (pid == -1 && errno == EACCES) { |
35 | pid = 0; | 35 | pid = 0; |
@@ -43,7 +43,7 @@ static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str) | |||
43 | 43 | ||
44 | fn(evsel); | 44 | fn(evsel); |
45 | 45 | ||
46 | fd = sys_perf_event_open(&evsel->attr, pid, cpu, -1, flags); | 46 | fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); |
47 | if (fd < 0) { | 47 | if (fd < 0) { |
48 | if (errno == EINVAL) | 48 | if (errno == EINVAL) |
49 | err = -EINVAL; | 49 | err = -EINVAL; |
@@ -80,17 +80,17 @@ static bool perf_probe_api(setup_probe_fn_t fn) | |||
80 | 80 | ||
81 | static void perf_probe_sample_identifier(struct evsel *evsel) | 81 | static void perf_probe_sample_identifier(struct evsel *evsel) |
82 | { | 82 | { |
83 | evsel->attr.sample_type |= PERF_SAMPLE_IDENTIFIER; | 83 | evsel->core.attr.sample_type |= PERF_SAMPLE_IDENTIFIER; |
84 | } | 84 | } |
85 | 85 | ||
86 | static void perf_probe_comm_exec(struct evsel *evsel) | 86 | static void perf_probe_comm_exec(struct evsel *evsel) |
87 | { | 87 | { |
88 | evsel->attr.comm_exec = 1; | 88 | evsel->core.attr.comm_exec = 1; |
89 | } | 89 | } |
90 | 90 | ||
91 | static void perf_probe_context_switch(struct evsel *evsel) | 91 | static void perf_probe_context_switch(struct evsel *evsel) |
92 | { | 92 | { |
93 | evsel->attr.context_switch = 1; | 93 | evsel->core.attr.context_switch = 1; |
94 | } | 94 | } |
95 | 95 | ||
96 | bool perf_can_sample_identifier(void) | 96 | bool perf_can_sample_identifier(void) |
@@ -155,7 +155,7 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts, | |||
155 | evlist__for_each_entry(evlist, evsel) { | 155 | evlist__for_each_entry(evlist, evsel) { |
156 | perf_evsel__config(evsel, opts, callchain); | 156 | perf_evsel__config(evsel, opts, callchain); |
157 | if (evsel->tracking && use_comm_exec) | 157 | if (evsel->tracking && use_comm_exec) |
158 | evsel->attr.comm_exec = 1; | 158 | evsel->core.attr.comm_exec = 1; |
159 | } | 159 | } |
160 | 160 | ||
161 | if (opts->full_auxtrace) { | 161 | if (opts->full_auxtrace) { |
@@ -170,7 +170,7 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts, | |||
170 | struct evsel *first = perf_evlist__first(evlist); | 170 | struct evsel *first = perf_evlist__first(evlist); |
171 | 171 | ||
172 | evlist__for_each_entry(evlist, evsel) { | 172 | evlist__for_each_entry(evlist, evsel) { |
173 | if (evsel->attr.sample_type == first->attr.sample_type) | 173 | if (evsel->core.attr.sample_type == first->core.attr.sample_type) |
174 | continue; | 174 | continue; |
175 | use_sample_identifier = perf_can_sample_identifier(); | 175 | use_sample_identifier = perf_can_sample_identifier(); |
176 | break; | 176 | break; |
@@ -284,7 +284,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str) | |||
284 | } | 284 | } |
285 | 285 | ||
286 | while (1) { | 286 | while (1) { |
287 | fd = sys_perf_event_open(&evsel->attr, pid, cpu, -1, | 287 | fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, |
288 | perf_event_open_cloexec_flag()); | 288 | perf_event_open_cloexec_flag()); |
289 | if (fd < 0) { | 289 | if (fd < 0) { |
290 | if (pid == -1 && errno == EACCES) { | 290 | if (pid == -1 && errno == EACCES) { |
diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c index 59d78a9fe703..d078ae8353c8 100644 --- a/tools/perf/util/s390-cpumsf.c +++ b/tools/perf/util/s390-cpumsf.c | |||
@@ -935,7 +935,7 @@ s390_cpumsf_process_event(struct perf_session *session, | |||
935 | /* Handle event with raw data */ | 935 | /* Handle event with raw data */ |
936 | ev_bc000 = perf_evlist__event2evsel(session->evlist, event); | 936 | ev_bc000 = perf_evlist__event2evsel(session->evlist, event); |
937 | if (ev_bc000 && | 937 | if (ev_bc000 && |
938 | ev_bc000->attr.config == PERF_EVENT_CPUM_CF_DIAG) | 938 | ev_bc000->core.attr.config == PERF_EVENT_CPUM_CF_DIAG) |
939 | err = s390_cpumcf_dumpctr(sf, sample); | 939 | err = s390_cpumcf_dumpctr(sf, sample); |
940 | return err; | 940 | return err; |
941 | } | 941 | } |
diff --git a/tools/perf/util/s390-sample-raw.c b/tools/perf/util/s390-sample-raw.c index 6c709647cd8e..d311c81464e5 100644 --- a/tools/perf/util/s390-sample-raw.c +++ b/tools/perf/util/s390-sample-raw.c | |||
@@ -210,7 +210,7 @@ void perf_evlist__s390_sample_raw(struct evlist *evlist, union perf_event *event | |||
210 | 210 | ||
211 | ev_bc000 = perf_evlist__event2evsel(evlist, event); | 211 | ev_bc000 = perf_evlist__event2evsel(evlist, event); |
212 | if (ev_bc000 == NULL || | 212 | if (ev_bc000 == NULL || |
213 | ev_bc000->attr.config != PERF_EVENT_CPUM_CF_DIAG) | 213 | ev_bc000->core.attr.config != PERF_EVENT_CPUM_CF_DIAG) |
214 | return; | 214 | return; |
215 | 215 | ||
216 | /* Display raw data on screen */ | 216 | /* Display raw data on screen */ |
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index 98dcdb9a79a4..01ebf10b8bf4 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c | |||
@@ -353,11 +353,11 @@ static void perl_process_tracepoint(struct perf_sample *sample, | |||
353 | 353 | ||
354 | dSP; | 354 | dSP; |
355 | 355 | ||
356 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 356 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) |
357 | return; | 357 | return; |
358 | 358 | ||
359 | if (!event) { | 359 | if (!event) { |
360 | pr_debug("ug! no event found for type %" PRIu64, (u64)evsel->attr.config); | 360 | pr_debug("ug! no event found for type %" PRIu64, (u64)evsel->core.attr.config); |
361 | return; | 361 | return; |
362 | } | 362 | } |
363 | 363 | ||
@@ -442,7 +442,7 @@ static void perl_process_event_generic(union perf_event *event, | |||
442 | SAVETMPS; | 442 | SAVETMPS; |
443 | PUSHMARK(SP); | 443 | PUSHMARK(SP); |
444 | XPUSHs(sv_2mortal(newSVpvn((const char *)event, event->header.size))); | 444 | XPUSHs(sv_2mortal(newSVpvn((const char *)event, event->header.size))); |
445 | XPUSHs(sv_2mortal(newSVpvn((const char *)&evsel->attr, sizeof(evsel->attr)))); | 445 | XPUSHs(sv_2mortal(newSVpvn((const char *)&evsel->core.attr, sizeof(evsel->core.attr)))); |
446 | XPUSHs(sv_2mortal(newSVpvn((const char *)sample, sizeof(*sample)))); | 446 | XPUSHs(sv_2mortal(newSVpvn((const char *)sample, sizeof(*sample)))); |
447 | XPUSHs(sv_2mortal(newSVpvn((const char *)sample->raw_data, sample->raw_size))); | 447 | XPUSHs(sv_2mortal(newSVpvn((const char *)sample->raw_data, sample->raw_size))); |
448 | PUTBACK; | 448 | PUTBACK; |
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 106aec31c07c..78b40c1d688e 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c | |||
@@ -636,7 +636,7 @@ static void set_sample_read_in_dict(PyObject *dict_sample, | |||
636 | struct perf_sample *sample, | 636 | struct perf_sample *sample, |
637 | struct evsel *evsel) | 637 | struct evsel *evsel) |
638 | { | 638 | { |
639 | u64 read_format = evsel->attr.read_format; | 639 | u64 read_format = evsel->core.attr.read_format; |
640 | PyObject *values; | 640 | PyObject *values; |
641 | unsigned int i; | 641 | unsigned int i; |
642 | 642 | ||
@@ -707,7 +707,7 @@ static void set_regs_in_dict(PyObject *dict, | |||
707 | struct perf_sample *sample, | 707 | struct perf_sample *sample, |
708 | struct evsel *evsel) | 708 | struct evsel *evsel) |
709 | { | 709 | { |
710 | struct perf_event_attr *attr = &evsel->attr; | 710 | struct perf_event_attr *attr = &evsel->core.attr; |
711 | char bf[512]; | 711 | char bf[512]; |
712 | 712 | ||
713 | regs_map(&sample->intr_regs, attr->sample_regs_intr, bf, sizeof(bf)); | 713 | regs_map(&sample->intr_regs, attr->sample_regs_intr, bf, sizeof(bf)); |
@@ -737,7 +737,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, | |||
737 | Py_FatalError("couldn't create Python dictionary"); | 737 | Py_FatalError("couldn't create Python dictionary"); |
738 | 738 | ||
739 | pydict_set_item_string_decref(dict, "ev_name", _PyUnicode_FromString(perf_evsel__name(evsel))); | 739 | pydict_set_item_string_decref(dict, "ev_name", _PyUnicode_FromString(perf_evsel__name(evsel))); |
740 | pydict_set_item_string_decref(dict, "attr", _PyBytes_FromStringAndSize((const char *)&evsel->attr, sizeof(evsel->attr))); | 740 | pydict_set_item_string_decref(dict, "attr", _PyBytes_FromStringAndSize((const char *)&evsel->core.attr, sizeof(evsel->core.attr))); |
741 | 741 | ||
742 | pydict_set_item_string_decref(dict_sample, "pid", | 742 | pydict_set_item_string_decref(dict_sample, "pid", |
743 | _PyLong_FromLong(sample->pid)); | 743 | _PyLong_FromLong(sample->pid)); |
@@ -809,7 +809,7 @@ static void python_process_tracepoint(struct perf_sample *sample, | |||
809 | 809 | ||
810 | if (!event) { | 810 | if (!event) { |
811 | snprintf(handler_name, sizeof(handler_name), | 811 | snprintf(handler_name, sizeof(handler_name), |
812 | "ug! no event found for type %" PRIu64, (u64)evsel->attr.config); | 812 | "ug! no event found for type %" PRIu64, (u64)evsel->core.attr.config); |
813 | Py_FatalError(handler_name); | 813 | Py_FatalError(handler_name); |
814 | } | 814 | } |
815 | 815 | ||
@@ -1163,7 +1163,7 @@ static void python_export_synth(struct db_export *dbe, struct export_sample *es) | |||
1163 | t = tuple_new(3); | 1163 | t = tuple_new(3); |
1164 | 1164 | ||
1165 | tuple_set_u64(t, 0, es->db_id); | 1165 | tuple_set_u64(t, 0, es->db_id); |
1166 | tuple_set_u64(t, 1, es->evsel->attr.config); | 1166 | tuple_set_u64(t, 1, es->evsel->core.attr.config); |
1167 | tuple_set_bytes(t, 2, es->sample->raw_data, es->sample->raw_size); | 1167 | tuple_set_bytes(t, 2, es->sample->raw_data, es->sample->raw_size); |
1168 | 1168 | ||
1169 | call_object(tables->synth_handler, t, "synth_data"); | 1169 | call_object(tables->synth_handler, t, "synth_data"); |
@@ -1178,7 +1178,7 @@ static int python_export_sample(struct db_export *dbe, | |||
1178 | 1178 | ||
1179 | python_export_sample_table(dbe, es); | 1179 | python_export_sample_table(dbe, es); |
1180 | 1180 | ||
1181 | if (es->evsel->attr.type == PERF_TYPE_SYNTH && tables->synth_handler) | 1181 | if (es->evsel->core.attr.type == PERF_TYPE_SYNTH && tables->synth_handler) |
1182 | python_export_synth(dbe, es); | 1182 | python_export_synth(dbe, es); |
1183 | 1183 | ||
1184 | return 0; | 1184 | return 0; |
@@ -1316,7 +1316,7 @@ static void python_process_event(union perf_event *event, | |||
1316 | { | 1316 | { |
1317 | struct tables *tables = &tables_global; | 1317 | struct tables *tables = &tables_global; |
1318 | 1318 | ||
1319 | switch (evsel->attr.type) { | 1319 | switch (evsel->core.attr.type) { |
1320 | case PERF_TYPE_TRACEPOINT: | 1320 | case PERF_TYPE_TRACEPOINT: |
1321 | python_process_tracepoint(sample, evsel, al); | 1321 | python_process_tracepoint(sample, evsel, al); |
1322 | break; | 1322 | break; |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 62d37440cbee..1f3dc7a8cee6 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -154,7 +154,7 @@ static bool perf_session__has_comm_exec(struct perf_session *session) | |||
154 | struct evsel *evsel; | 154 | struct evsel *evsel; |
155 | 155 | ||
156 | evlist__for_each_entry(session->evlist, evsel) { | 156 | evlist__for_each_entry(session->evlist, evsel) { |
157 | if (evsel->attr.comm_exec) | 157 | if (evsel->core.attr.comm_exec) |
158 | return true; | 158 | return true; |
159 | } | 159 | } |
160 | 160 | ||
@@ -1210,7 +1210,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event, | |||
1210 | event->header.misc, sample->pid, sample->tid, sample->ip, | 1210 | event->header.misc, sample->pid, sample->tid, sample->ip, |
1211 | sample->period, sample->addr); | 1211 | sample->period, sample->addr); |
1212 | 1212 | ||
1213 | sample_type = evsel->attr.sample_type; | 1213 | sample_type = evsel->core.attr.sample_type; |
1214 | 1214 | ||
1215 | if (evsel__has_callchain(evsel)) | 1215 | if (evsel__has_callchain(evsel)) |
1216 | callchain__printf(evsel, sample); | 1216 | callchain__printf(evsel, sample); |
@@ -1240,7 +1240,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event, | |||
1240 | printf("... transaction: %" PRIx64 "\n", sample->transaction); | 1240 | printf("... transaction: %" PRIx64 "\n", sample->transaction); |
1241 | 1241 | ||
1242 | if (sample_type & PERF_SAMPLE_READ) | 1242 | if (sample_type & PERF_SAMPLE_READ) |
1243 | sample_read__printf(sample, evsel->attr.read_format); | 1243 | sample_read__printf(sample, evsel->core.attr.read_format); |
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | static void dump_read(struct evsel *evsel, union perf_event *event) | 1246 | static void dump_read(struct evsel *evsel, union perf_event *event) |
@@ -1258,7 +1258,7 @@ static void dump_read(struct evsel *evsel, union perf_event *event) | |||
1258 | if (!evsel) | 1258 | if (!evsel) |
1259 | return; | 1259 | return; |
1260 | 1260 | ||
1261 | read_format = evsel->attr.read_format; | 1261 | read_format = evsel->core.attr.read_format; |
1262 | 1262 | ||
1263 | if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) | 1263 | if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) |
1264 | printf("... time enabled : %" PRIu64 "\n", read_event->time_enabled); | 1264 | printf("... time enabled : %" PRIu64 "\n", read_event->time_enabled); |
@@ -1355,8 +1355,8 @@ static int | |||
1355 | struct machine *machine) | 1355 | struct machine *machine) |
1356 | { | 1356 | { |
1357 | /* We know evsel != NULL. */ | 1357 | /* We know evsel != NULL. */ |
1358 | u64 sample_type = evsel->attr.sample_type; | 1358 | u64 sample_type = evsel->core.attr.sample_type; |
1359 | u64 read_format = evsel->attr.read_format; | 1359 | u64 read_format = evsel->core.attr.read_format; |
1360 | 1360 | ||
1361 | /* Standard sample delivery. */ | 1361 | /* Standard sample delivery. */ |
1362 | if (!(sample_type & PERF_SAMPLE_READ)) | 1362 | if (!(sample_type & PERF_SAMPLE_READ)) |
@@ -1709,7 +1709,7 @@ perf_session__warn_order(const struct perf_session *session) | |||
1709 | bool should_warn = true; | 1709 | bool should_warn = true; |
1710 | 1710 | ||
1711 | evlist__for_each_entry(session->evlist, evsel) { | 1711 | evlist__for_each_entry(session->evlist, evsel) { |
1712 | if (evsel->attr.write_backward) | 1712 | if (evsel->core.attr.write_backward) |
1713 | should_warn = false; | 1713 | should_warn = false; |
1714 | } | 1714 | } |
1715 | 1715 | ||
@@ -2186,7 +2186,7 @@ bool perf_session__has_traces(struct perf_session *session, const char *msg) | |||
2186 | struct evsel *evsel; | 2186 | struct evsel *evsel; |
2187 | 2187 | ||
2188 | evlist__for_each_entry(session->evlist, evsel) { | 2188 | evlist__for_each_entry(session->evlist, evsel) { |
2189 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT) | 2189 | if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) |
2190 | return true; | 2190 | return true; |
2191 | } | 2191 | } |
2192 | 2192 | ||
@@ -2263,7 +2263,7 @@ struct evsel *perf_session__find_first_evtype(struct perf_session *session, | |||
2263 | struct evsel *pos; | 2263 | struct evsel *pos; |
2264 | 2264 | ||
2265 | evlist__for_each_entry(session->evlist, pos) { | 2265 | evlist__for_each_entry(session->evlist, pos) { |
2266 | if (pos->attr.type == type) | 2266 | if (pos->core.attr.type == type) |
2267 | return pos; | 2267 | return pos; |
2268 | } | 2268 | } |
2269 | return NULL; | 2269 | return NULL; |
@@ -2282,7 +2282,7 @@ int perf_session__cpu_bitmap(struct perf_session *session, | |||
2282 | if (!evsel) | 2282 | if (!evsel) |
2283 | continue; | 2283 | continue; |
2284 | 2284 | ||
2285 | if (!(evsel->attr.sample_type & PERF_SAMPLE_CPU)) { | 2285 | if (!(evsel->core.attr.sample_type & PERF_SAMPLE_CPU)) { |
2286 | pr_err("File does not contain CPU events. " | 2286 | pr_err("File does not contain CPU events. " |
2287 | "Remove -C option to proceed.\n"); | 2287 | "Remove -C option to proceed.\n"); |
2288 | return -1; | 2288 | return -1; |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index fa3cc2112b82..f9a38a1dd4d1 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -726,7 +726,7 @@ sort__trace_cmp(struct hist_entry *left, struct hist_entry *right) | |||
726 | struct evsel *evsel; | 726 | struct evsel *evsel; |
727 | 727 | ||
728 | evsel = hists_to_evsel(left->hists); | 728 | evsel = hists_to_evsel(left->hists); |
729 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 729 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) |
730 | return 0; | 730 | return 0; |
731 | 731 | ||
732 | if (left->trace_output == NULL) | 732 | if (left->trace_output == NULL) |
@@ -743,7 +743,7 @@ static int hist_entry__trace_snprintf(struct hist_entry *he, char *bf, | |||
743 | struct evsel *evsel; | 743 | struct evsel *evsel; |
744 | 744 | ||
745 | evsel = hists_to_evsel(he->hists); | 745 | evsel = hists_to_evsel(he->hists); |
746 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 746 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) |
747 | return scnprintf(bf, size, "%-.*s", width, "N/A"); | 747 | return scnprintf(bf, size, "%-.*s", width, "N/A"); |
748 | 748 | ||
749 | if (he->trace_output == NULL) | 749 | if (he->trace_output == NULL) |
@@ -2391,7 +2391,7 @@ static int add_all_dynamic_fields(struct evlist *evlist, bool raw_trace, | |||
2391 | struct evsel *evsel; | 2391 | struct evsel *evsel; |
2392 | 2392 | ||
2393 | evlist__for_each_entry(evlist, evsel) { | 2393 | evlist__for_each_entry(evlist, evsel) { |
2394 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 2394 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) |
2395 | continue; | 2395 | continue; |
2396 | 2396 | ||
2397 | ret = add_evsel_fields(evsel, raw_trace, level); | 2397 | ret = add_evsel_fields(evsel, raw_trace, level); |
@@ -2409,7 +2409,7 @@ static int add_all_matching_fields(struct evlist *evlist, | |||
2409 | struct tep_format_field *field; | 2409 | struct tep_format_field *field; |
2410 | 2410 | ||
2411 | evlist__for_each_entry(evlist, evsel) { | 2411 | evlist__for_each_entry(evlist, evsel) { |
2412 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 2412 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) |
2413 | continue; | 2413 | continue; |
2414 | 2414 | ||
2415 | field = tep_find_any_field(evsel->tp_format, field_name); | 2415 | field = tep_find_any_field(evsel->tp_format, field_name); |
@@ -2470,7 +2470,7 @@ static int add_dynamic_entry(struct evlist *evlist, const char *tok, | |||
2470 | goto out; | 2470 | goto out; |
2471 | } | 2471 | } |
2472 | 2472 | ||
2473 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { | 2473 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) { |
2474 | pr_debug("%s is not a tracepoint event\n", event_name); | 2474 | pr_debug("%s is not a tracepoint event\n", event_name); |
2475 | ret = -EINVAL; | 2475 | ret = -EINVAL; |
2476 | goto out; | 2476 | goto out; |
@@ -2728,7 +2728,7 @@ static const char *get_default_sort_order(struct evlist *evlist) | |||
2728 | goto out_no_evlist; | 2728 | goto out_no_evlist; |
2729 | 2729 | ||
2730 | evlist__for_each_entry(evlist, evsel) { | 2730 | evlist__for_each_entry(evlist, evsel) { |
2731 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { | 2731 | if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) { |
2732 | use_trace = false; | 2732 | use_trace = false; |
2733 | break; | 2733 | break; |
2734 | } | 2734 | } |
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index b1a2571f7c8f..99bda99a1b2d 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c | |||
@@ -366,7 +366,7 @@ static void abs_printout(struct perf_stat_config *config, | |||
366 | static bool is_mixed_hw_group(struct evsel *counter) | 366 | static bool is_mixed_hw_group(struct evsel *counter) |
367 | { | 367 | { |
368 | struct evlist *evlist = counter->evlist; | 368 | struct evlist *evlist = counter->evlist; |
369 | u32 pmu_type = counter->attr.type; | 369 | u32 pmu_type = counter->core.attr.type; |
370 | struct evsel *pos; | 370 | struct evsel *pos; |
371 | 371 | ||
372 | if (counter->nr_members < 2) | 372 | if (counter->nr_members < 2) |
@@ -374,13 +374,13 @@ static bool is_mixed_hw_group(struct evsel *counter) | |||
374 | 374 | ||
375 | evlist__for_each_entry(evlist, pos) { | 375 | evlist__for_each_entry(evlist, pos) { |
376 | /* software events can be part of any hardware group */ | 376 | /* software events can be part of any hardware group */ |
377 | if (pos->attr.type == PERF_TYPE_SOFTWARE) | 377 | if (pos->core.attr.type == PERF_TYPE_SOFTWARE) |
378 | continue; | 378 | continue; |
379 | if (pmu_type == PERF_TYPE_SOFTWARE) { | 379 | if (pmu_type == PERF_TYPE_SOFTWARE) { |
380 | pmu_type = pos->attr.type; | 380 | pmu_type = pos->core.attr.type; |
381 | continue; | 381 | continue; |
382 | } | 382 | } |
383 | if (pmu_type != pos->attr.type) | 383 | if (pmu_type != pos->core.attr.type) |
384 | return true; | 384 | return true; |
385 | } | 385 | } |
386 | 386 | ||
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index d81bcab2e64c..2ed5e0066c70 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c | |||
@@ -150,15 +150,15 @@ static int evsel_context(struct evsel *evsel) | |||
150 | { | 150 | { |
151 | int ctx = 0; | 151 | int ctx = 0; |
152 | 152 | ||
153 | if (evsel->attr.exclude_kernel) | 153 | if (evsel->core.attr.exclude_kernel) |
154 | ctx |= CTX_BIT_KERNEL; | 154 | ctx |= CTX_BIT_KERNEL; |
155 | if (evsel->attr.exclude_user) | 155 | if (evsel->core.attr.exclude_user) |
156 | ctx |= CTX_BIT_USER; | 156 | ctx |= CTX_BIT_USER; |
157 | if (evsel->attr.exclude_hv) | 157 | if (evsel->core.attr.exclude_hv) |
158 | ctx |= CTX_BIT_HV; | 158 | ctx |= CTX_BIT_HV; |
159 | if (evsel->attr.exclude_host) | 159 | if (evsel->core.attr.exclude_host) |
160 | ctx |= CTX_BIT_HOST; | 160 | ctx |= CTX_BIT_HOST; |
161 | if (evsel->attr.exclude_idle) | 161 | if (evsel->core.attr.exclude_idle) |
162 | ctx |= CTX_BIT_IDLE; | 162 | ctx |= CTX_BIT_IDLE; |
163 | 163 | ||
164 | return ctx; | 164 | return ctx; |
@@ -829,8 +829,8 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, | |||
829 | else | 829 | else |
830 | print_metric(config, ctxp, NULL, NULL, "of all branches", 0); | 830 | print_metric(config, ctxp, NULL, NULL, "of all branches", 0); |
831 | } else if ( | 831 | } else if ( |
832 | evsel->attr.type == PERF_TYPE_HW_CACHE && | 832 | evsel->core.attr.type == PERF_TYPE_HW_CACHE && |
833 | evsel->attr.config == ( PERF_COUNT_HW_CACHE_L1D | | 833 | evsel->core.attr.config == ( PERF_COUNT_HW_CACHE_L1D | |
834 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | | 834 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | |
835 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { | 835 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { |
836 | 836 | ||
@@ -839,8 +839,8 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, | |||
839 | else | 839 | else |
840 | print_metric(config, ctxp, NULL, NULL, "of all L1-dcache hits", 0); | 840 | print_metric(config, ctxp, NULL, NULL, "of all L1-dcache hits", 0); |
841 | } else if ( | 841 | } else if ( |
842 | evsel->attr.type == PERF_TYPE_HW_CACHE && | 842 | evsel->core.attr.type == PERF_TYPE_HW_CACHE && |
843 | evsel->attr.config == ( PERF_COUNT_HW_CACHE_L1I | | 843 | evsel->core.attr.config == ( PERF_COUNT_HW_CACHE_L1I | |
844 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | | 844 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | |
845 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { | 845 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { |
846 | 846 | ||
@@ -849,8 +849,8 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, | |||
849 | else | 849 | else |
850 | print_metric(config, ctxp, NULL, NULL, "of all L1-icache hits", 0); | 850 | print_metric(config, ctxp, NULL, NULL, "of all L1-icache hits", 0); |
851 | } else if ( | 851 | } else if ( |
852 | evsel->attr.type == PERF_TYPE_HW_CACHE && | 852 | evsel->core.attr.type == PERF_TYPE_HW_CACHE && |
853 | evsel->attr.config == ( PERF_COUNT_HW_CACHE_DTLB | | 853 | evsel->core.attr.config == ( PERF_COUNT_HW_CACHE_DTLB | |
854 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | | 854 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | |
855 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { | 855 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { |
856 | 856 | ||
@@ -859,8 +859,8 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, | |||
859 | else | 859 | else |
860 | print_metric(config, ctxp, NULL, NULL, "of all dTLB cache hits", 0); | 860 | print_metric(config, ctxp, NULL, NULL, "of all dTLB cache hits", 0); |
861 | } else if ( | 861 | } else if ( |
862 | evsel->attr.type == PERF_TYPE_HW_CACHE && | 862 | evsel->core.attr.type == PERF_TYPE_HW_CACHE && |
863 | evsel->attr.config == ( PERF_COUNT_HW_CACHE_ITLB | | 863 | evsel->core.attr.config == ( PERF_COUNT_HW_CACHE_ITLB | |
864 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | | 864 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | |
865 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { | 865 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { |
866 | 866 | ||
@@ -869,8 +869,8 @@ void perf_stat__print_shadow_stats(struct perf_stat_config *config, | |||
869 | else | 869 | else |
870 | print_metric(config, ctxp, NULL, NULL, "of all iTLB cache hits", 0); | 870 | print_metric(config, ctxp, NULL, NULL, "of all iTLB cache hits", 0); |
871 | } else if ( | 871 | } else if ( |
872 | evsel->attr.type == PERF_TYPE_HW_CACHE && | 872 | evsel->core.attr.type == PERF_TYPE_HW_CACHE && |
873 | evsel->attr.config == ( PERF_COUNT_HW_CACHE_LL | | 873 | evsel->core.attr.config == ( PERF_COUNT_HW_CACHE_LL | |
874 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | | 874 | ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | |
875 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { | 875 | ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { |
876 | 876 | ||
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 63f7815ceb4f..632bf72cf780 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c | |||
@@ -441,7 +441,7 @@ int create_perf_stat_counter(struct evsel *evsel, | |||
441 | struct perf_stat_config *config, | 441 | struct perf_stat_config *config, |
442 | struct target *target) | 442 | struct target *target) |
443 | { | 443 | { |
444 | struct perf_event_attr *attr = &evsel->attr; | 444 | struct perf_event_attr *attr = &evsel->core.attr; |
445 | struct evsel *leader = evsel->leader; | 445 | struct evsel *leader = evsel->leader; |
446 | 446 | ||
447 | attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | | 447 | attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | |
diff --git a/tools/perf/util/top.c b/tools/perf/util/top.c index 3bbbdac2c550..f533f1aac045 100644 --- a/tools/perf/util/top.c +++ b/tools/perf/util/top.c | |||
@@ -73,7 +73,7 @@ size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size) | |||
73 | if (top->evlist->core.nr_entries == 1) { | 73 | if (top->evlist->core.nr_entries == 1) { |
74 | struct evsel *first = perf_evlist__first(top->evlist); | 74 | struct evsel *first = perf_evlist__first(top->evlist); |
75 | ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", | 75 | ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", |
76 | (uint64_t)first->attr.sample_period, | 76 | (uint64_t)first->core.attr.sample_period, |
77 | opts->freq ? "Hz" : ""); | 77 | opts->freq ? "Hz" : ""); |
78 | } | 78 | } |
79 | 79 | ||
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c index 7efdbb182ea1..2f8a0601a546 100644 --- a/tools/perf/util/trace-event-info.c +++ b/tools/perf/util/trace-event-info.c | |||
@@ -409,7 +409,7 @@ get_tracepoints_path(struct list_head *pattrs) | |||
409 | int nr_tracepoints = 0; | 409 | int nr_tracepoints = 0; |
410 | 410 | ||
411 | list_for_each_entry(pos, pattrs, core.node) { | 411 | list_for_each_entry(pos, pattrs, core.node) { |
412 | if (pos->attr.type != PERF_TYPE_TRACEPOINT) | 412 | if (pos->core.attr.type != PERF_TYPE_TRACEPOINT) |
413 | continue; | 413 | continue; |
414 | ++nr_tracepoints; | 414 | ++nr_tracepoints; |
415 | 415 | ||
@@ -425,7 +425,7 @@ get_tracepoints_path(struct list_head *pattrs) | |||
425 | } | 425 | } |
426 | 426 | ||
427 | try_id: | 427 | try_id: |
428 | ppath->next = tracepoint_id_to_path(pos->attr.config); | 428 | ppath->next = tracepoint_id_to_path(pos->core.attr.config); |
429 | if (!ppath->next) { | 429 | if (!ppath->next) { |
430 | error: | 430 | error: |
431 | pr_debug("No memory to alloc tracepoints list\n"); | 431 | pr_debug("No memory to alloc tracepoints list\n"); |
@@ -444,7 +444,7 @@ bool have_tracepoints(struct list_head *pattrs) | |||
444 | struct evsel *pos; | 444 | struct evsel *pos; |
445 | 445 | ||
446 | list_for_each_entry(pos, pattrs, core.node) | 446 | list_for_each_entry(pos, pattrs, core.node) |
447 | if (pos->attr.type == PERF_TYPE_TRACEPOINT) | 447 | if (pos->core.attr.type == PERF_TYPE_TRACEPOINT) |
448 | return true; | 448 | return true; |
449 | 449 | ||
450 | return false; | 450 | return false; |