parse-events.c (8f8c106886983f7963df76d33bf9e42df8ec3e8a) | parse-events.c (9854934b055cfc37b3acdff5323dd2060745a774) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2#include "parse-events.h" 3#include "evsel.h" 4#include "evlist.h" 5#include <api/fs/fs.h> 6#include "tests.h" 7#include "debug.h" 8#include "pmu.h" --- 7 unchanged lines hidden (view full) --- 16#include <unistd.h> 17#include <linux/kernel.h> 18#include <linux/hw_breakpoint.h> 19#include <api/fs/tracing_path.h> 20 21#define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \ 22 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD) 23 | 1// SPDX-License-Identifier: GPL-2.0 2#include "parse-events.h" 3#include "evsel.h" 4#include "evlist.h" 5#include <api/fs/fs.h> 6#include "tests.h" 7#include "debug.h" 8#include "pmu.h" --- 7 unchanged lines hidden (view full) --- 16#include <unistd.h> 17#include <linux/kernel.h> 18#include <linux/hw_breakpoint.h> 19#include <api/fs/tracing_path.h> 20 21#define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \ 22 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD) 23 |
24static bool test_config(const struct evsel *evsel, __u64 expected_config) 25{ 26 __u32 type = evsel->core.attr.type; 27 __u64 config = evsel->core.attr.config; 28 29 if (type == PERF_TYPE_HARDWARE || type == PERF_TYPE_HW_CACHE) { 30 /* 31 * HARDWARE and HW_CACHE events encode the PMU's extended type 32 * in the top 32-bits. Mask in order to ignore. 33 */ 34 config &= PERF_HW_EVENT_MASK; 35 } 36 return config == expected_config; 37} 38 |
|
24#ifdef HAVE_LIBTRACEEVENT 25 26#if defined(__s390x__) 27/* Return true if kvm module is available and loaded. Test this 28 * and return success when trace point kvm_s390_create_vm 29 * exists. Otherwise this test always fails. 30 */ 31static bool kvm_s390_create_vm_valid(void) --- 50 unchanged lines hidden (view full) --- 82#endif /* HAVE_LIBTRACEEVENT */ 83 84static int test__checkevent_raw(struct evlist *evlist) 85{ 86 struct evsel *evsel = evlist__first(evlist); 87 88 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 89 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 39#ifdef HAVE_LIBTRACEEVENT 40 41#if defined(__s390x__) 42/* Return true if kvm module is available and loaded. Test this 43 * and return success when trace point kvm_s390_create_vm 44 * exists. Otherwise this test always fails. 45 */ 46static bool kvm_s390_create_vm_valid(void) --- 50 unchanged lines hidden (view full) --- 97#endif /* HAVE_LIBTRACEEVENT */ 98 99static int test__checkevent_raw(struct evlist *evlist) 100{ 101 struct evsel *evsel = evlist__first(evlist); 102 103 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 104 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
90 TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); | 105 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a)); |
91 return TEST_OK; 92} 93 94static int test__checkevent_numeric(struct evlist *evlist) 95{ 96 struct evsel *evsel = evlist__first(evlist); 97 98 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 99 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); | 106 return TEST_OK; 107} 108 109static int test__checkevent_numeric(struct evlist *evlist) 110{ 111 struct evsel *evsel = evlist__first(evlist); 112 113 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 114 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
100 TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); | 115 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1)); |
101 return TEST_OK; 102} 103 104static int test__checkevent_symbolic_name(struct evlist *evlist) 105{ 106 struct evsel *evsel = evlist__first(evlist); 107 108 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 109 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 116 return TEST_OK; 117} 118 119static int test__checkevent_symbolic_name(struct evlist *evlist) 120{ 121 struct evsel *evsel = evlist__first(evlist); 122 123 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 124 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
110 TEST_ASSERT_VAL("wrong config", 111 PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); | 125 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS)); |
112 return TEST_OK; 113} 114 115static int test__checkevent_symbolic_name_config(struct evlist *evlist) 116{ 117 struct evsel *evsel = evlist__first(evlist); 118 119 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 120 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 126 return TEST_OK; 127} 128 129static int test__checkevent_symbolic_name_config(struct evlist *evlist) 130{ 131 struct evsel *evsel = evlist__first(evlist); 132 133 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 134 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
121 TEST_ASSERT_VAL("wrong config", 122 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 135 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
123 /* 124 * The period value gets configured within evlist__config, 125 * while this test executes only parse events method. 126 */ 127 TEST_ASSERT_VAL("wrong period", 128 0 == evsel->core.attr.sample_period); 129 TEST_ASSERT_VAL("wrong config1", 130 0 == evsel->core.attr.config1); 131 TEST_ASSERT_VAL("wrong config2", 132 1 == evsel->core.attr.config2); 133 return TEST_OK; 134} 135 136static int test__checkevent_symbolic_alias(struct evlist *evlist) 137{ 138 struct evsel *evsel = evlist__first(evlist); 139 140 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 141 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); | 136 /* 137 * The period value gets configured within evlist__config, 138 * while this test executes only parse events method. 139 */ 140 TEST_ASSERT_VAL("wrong period", 141 0 == evsel->core.attr.sample_period); 142 TEST_ASSERT_VAL("wrong config1", 143 0 == evsel->core.attr.config1); 144 TEST_ASSERT_VAL("wrong config2", 145 1 == evsel->core.attr.config2); 146 return TEST_OK; 147} 148 149static int test__checkevent_symbolic_alias(struct evlist *evlist) 150{ 151 struct evsel *evsel = evlist__first(evlist); 152 153 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 154 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
142 TEST_ASSERT_VAL("wrong config", 143 PERF_COUNT_SW_PAGE_FAULTS == evsel->core.attr.config); | 155 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_PAGE_FAULTS)); |
144 return TEST_OK; 145} 146 147static int test__checkevent_genhw(struct evlist *evlist) 148{ 149 struct evsel *evsel = evlist__first(evlist); 150 151 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 152 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type); | 156 return TEST_OK; 157} 158 159static int test__checkevent_genhw(struct evlist *evlist) 160{ 161 struct evsel *evsel = evlist__first(evlist); 162 163 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 164 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type); |
153 TEST_ASSERT_VAL("wrong config", (1 << 16) == evsel->core.attr.config); | 165 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1 << 16)); |
154 return TEST_OK; 155} 156 157static int test__checkevent_breakpoint(struct evlist *evlist) 158{ 159 struct evsel *evsel = evlist__first(evlist); 160 161 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 162 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); | 166 return TEST_OK; 167} 168 169static int test__checkevent_breakpoint(struct evlist *evlist) 170{ 171 struct evsel *evsel = evlist__first(evlist); 172 173 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 174 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
163 TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); | 175 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0)); |
164 TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == 165 evsel->core.attr.bp_type); 166 TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == 167 evsel->core.attr.bp_len); 168 return TEST_OK; 169} 170 171static int test__checkevent_breakpoint_x(struct evlist *evlist) 172{ 173 struct evsel *evsel = evlist__first(evlist); 174 175 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 176 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); | 176 TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == 177 evsel->core.attr.bp_type); 178 TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == 179 evsel->core.attr.bp_len); 180 return TEST_OK; 181} 182 183static int test__checkevent_breakpoint_x(struct evlist *evlist) 184{ 185 struct evsel *evsel = evlist__first(evlist); 186 187 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 188 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
177 TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); | 189 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0)); |
178 TEST_ASSERT_VAL("wrong bp_type", 179 HW_BREAKPOINT_X == evsel->core.attr.bp_type); 180 TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->core.attr.bp_len); 181 return TEST_OK; 182} 183 184static int test__checkevent_breakpoint_r(struct evlist *evlist) 185{ 186 struct evsel *evsel = evlist__first(evlist); 187 188 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 189 TEST_ASSERT_VAL("wrong type", 190 PERF_TYPE_BREAKPOINT == evsel->core.attr.type); | 190 TEST_ASSERT_VAL("wrong bp_type", 191 HW_BREAKPOINT_X == evsel->core.attr.bp_type); 192 TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->core.attr.bp_len); 193 return TEST_OK; 194} 195 196static int test__checkevent_breakpoint_r(struct evlist *evlist) 197{ 198 struct evsel *evsel = evlist__first(evlist); 199 200 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 201 TEST_ASSERT_VAL("wrong type", 202 PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
191 TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); | 203 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0)); |
192 TEST_ASSERT_VAL("wrong bp_type", 193 HW_BREAKPOINT_R == evsel->core.attr.bp_type); 194 TEST_ASSERT_VAL("wrong bp_len", 195 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); 196 return TEST_OK; 197} 198 199static int test__checkevent_breakpoint_w(struct evlist *evlist) 200{ 201 struct evsel *evsel = evlist__first(evlist); 202 203 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 204 TEST_ASSERT_VAL("wrong type", 205 PERF_TYPE_BREAKPOINT == evsel->core.attr.type); | 204 TEST_ASSERT_VAL("wrong bp_type", 205 HW_BREAKPOINT_R == evsel->core.attr.bp_type); 206 TEST_ASSERT_VAL("wrong bp_len", 207 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); 208 return TEST_OK; 209} 210 211static int test__checkevent_breakpoint_w(struct evlist *evlist) 212{ 213 struct evsel *evsel = evlist__first(evlist); 214 215 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 216 TEST_ASSERT_VAL("wrong type", 217 PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
206 TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); | 218 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0)); |
207 TEST_ASSERT_VAL("wrong bp_type", 208 HW_BREAKPOINT_W == evsel->core.attr.bp_type); 209 TEST_ASSERT_VAL("wrong bp_len", 210 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); 211 return TEST_OK; 212} 213 214static int test__checkevent_breakpoint_rw(struct evlist *evlist) 215{ 216 struct evsel *evsel = evlist__first(evlist); 217 218 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 219 TEST_ASSERT_VAL("wrong type", 220 PERF_TYPE_BREAKPOINT == evsel->core.attr.type); | 219 TEST_ASSERT_VAL("wrong bp_type", 220 HW_BREAKPOINT_W == evsel->core.attr.bp_type); 221 TEST_ASSERT_VAL("wrong bp_len", 222 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); 223 return TEST_OK; 224} 225 226static int test__checkevent_breakpoint_rw(struct evlist *evlist) 227{ 228 struct evsel *evsel = evlist__first(evlist); 229 230 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 231 TEST_ASSERT_VAL("wrong type", 232 PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
221 TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); | 233 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0)); |
222 TEST_ASSERT_VAL("wrong bp_type", 223 (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->core.attr.bp_type); 224 TEST_ASSERT_VAL("wrong bp_len", 225 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); 226 return TEST_OK; 227} 228 229#ifdef HAVE_LIBTRACEEVENT --- 212 unchanged lines hidden (view full) --- 442 443static int test__checkevent_pmu(struct evlist *evlist) 444{ 445 446 struct evsel *evsel = evlist__first(evlist); 447 448 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 449 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 234 TEST_ASSERT_VAL("wrong bp_type", 235 (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->core.attr.bp_type); 236 TEST_ASSERT_VAL("wrong bp_len", 237 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); 238 return TEST_OK; 239} 240 241#ifdef HAVE_LIBTRACEEVENT --- 212 unchanged lines hidden (view full) --- 454 455static int test__checkevent_pmu(struct evlist *evlist) 456{ 457 458 struct evsel *evsel = evlist__first(evlist); 459 460 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 461 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
450 TEST_ASSERT_VAL("wrong config", 10 == evsel->core.attr.config); | 462 TEST_ASSERT_VAL("wrong config", test_config(evsel, 10)); |
451 TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1); 452 TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2); 453 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3); 454 /* 455 * The period value gets configured within evlist__config, 456 * while this test executes only parse events method. 457 */ 458 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); --- 5 unchanged lines hidden (view full) --- 464static int test__checkevent_list(struct evlist *evlist) 465{ 466 struct evsel *evsel = evlist__first(evlist); 467 468 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 469 470 /* r1 */ 471 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 463 TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1); 464 TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2); 465 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3); 466 /* 467 * The period value gets configured within evlist__config, 468 * while this test executes only parse events method. 469 */ 470 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); --- 5 unchanged lines hidden (view full) --- 476static int test__checkevent_list(struct evlist *evlist) 477{ 478 struct evsel *evsel = evlist__first(evlist); 479 480 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 481 482 /* r1 */ 483 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
472 TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); | 484 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1)); |
473 TEST_ASSERT_VAL("wrong config1", 0 == evsel->core.attr.config1); 474 TEST_ASSERT_VAL("wrong config2", 0 == evsel->core.attr.config2); 475 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3); 476 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 477 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 478 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 479 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 480 --- 6 unchanged lines hidden (view full) --- 487 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 488 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 489 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 490 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 491 492 /* 1:1:hp */ 493 evsel = evsel__next(evsel); 494 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); | 485 TEST_ASSERT_VAL("wrong config1", 0 == evsel->core.attr.config1); 486 TEST_ASSERT_VAL("wrong config2", 0 == evsel->core.attr.config2); 487 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3); 488 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 489 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 490 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 491 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 492 --- 6 unchanged lines hidden (view full) --- 499 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 500 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 501 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 502 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 503 504 /* 1:1:hp */ 505 evsel = evsel__next(evsel); 506 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
495 TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); | 507 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1)); |
496 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 497 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 498 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 499 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); 500 501 return TEST_OK; 502} 503#endif 504 505static int test__checkevent_pmu_name(struct evlist *evlist) 506{ 507 struct evsel *evsel = evlist__first(evlist); 508 509 /* cpu/config=1,name=krava/u */ 510 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 511 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 508 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 509 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 510 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 511 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); 512 513 return TEST_OK; 514} 515#endif 516 517static int test__checkevent_pmu_name(struct evlist *evlist) 518{ 519 struct evsel *evsel = evlist__first(evlist); 520 521 /* cpu/config=1,name=krava/u */ 522 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 523 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
512 TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); | 524 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1)); |
513 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "krava")); 514 515 /* cpu/config=2/u" */ 516 evsel = evsel__next(evsel); 517 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 518 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 525 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "krava")); 526 527 /* cpu/config=2/u" */ 528 evsel = evsel__next(evsel); 529 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 530 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
519 TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); | 531 TEST_ASSERT_VAL("wrong config", test_config(evsel, 2)); |
520 TEST_ASSERT_VAL("wrong name", 521 !strcmp(evsel__name(evsel), "cpu/config=2/u")); 522 523 return TEST_OK; 524} 525 526static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist) 527{ 528 struct evsel *evsel = evlist__first(evlist); 529 530 /* cpu/config=1,call-graph=fp,time,period=100000/ */ 531 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 532 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 532 TEST_ASSERT_VAL("wrong name", 533 !strcmp(evsel__name(evsel), "cpu/config=2/u")); 534 535 return TEST_OK; 536} 537 538static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist) 539{ 540 struct evsel *evsel = evlist__first(evlist); 541 542 /* cpu/config=1,call-graph=fp,time,period=100000/ */ 543 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 544 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
533 TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); | 545 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1)); |
534 /* 535 * The period, time and callgraph value gets configured within evlist__config, 536 * while this test executes only parse events method. 537 */ 538 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); 539 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); 540 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); 541 542 /* cpu/config=2,call-graph=no,time=0,period=2000/ */ 543 evsel = evsel__next(evsel); 544 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 546 /* 547 * The period, time and callgraph value gets configured within evlist__config, 548 * while this test executes only parse events method. 549 */ 550 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); 551 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); 552 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); 553 554 /* cpu/config=2,call-graph=no,time=0,period=2000/ */ 555 evsel = evsel__next(evsel); 556 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
545 TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); | 557 TEST_ASSERT_VAL("wrong config", test_config(evsel, 2)); |
546 /* 547 * The period, time and callgraph value gets configured within evlist__config, 548 * while this test executes only parse events method. 549 */ 550 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); 551 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); 552 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); 553 --- 137 unchanged lines hidden (view full) --- 691 struct evsel *evsel, *leader; 692 693 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 694 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 695 696 /* instructions:k */ 697 evsel = leader = evlist__first(evlist); 698 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 558 /* 559 * The period, time and callgraph value gets configured within evlist__config, 560 * while this test executes only parse events method. 561 */ 562 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); 563 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); 564 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); 565 --- 137 unchanged lines hidden (view full) --- 703 struct evsel *evsel, *leader; 704 705 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 706 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 707 708 /* instructions:k */ 709 evsel = leader = evlist__first(evlist); 710 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
699 TEST_ASSERT_VAL("wrong config", 700 PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); | 711 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS)); |
701 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 702 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 703 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 704 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 705 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 706 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 707 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 708 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 709 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 710 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 711 712 /* cycles:upp */ 713 evsel = evsel__next(evsel); 714 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 712 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 713 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 714 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 715 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 716 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 717 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 718 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 719 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 720 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 721 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 722 723 /* cycles:upp */ 724 evsel = evsel__next(evsel); 725 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
715 TEST_ASSERT_VAL("wrong config", 716 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 726 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
717 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 718 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 719 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 720 /* use of precise requires exclude_guest */ 721 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 722 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 723 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); 724 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 8 unchanged lines hidden (view full) --- 733 struct evsel *evsel, *leader; 734 735 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 736 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 737 738 /* faults + :ku modifier */ 739 evsel = leader = evlist__first(evlist); 740 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); | 727 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 728 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 729 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 730 /* use of precise requires exclude_guest */ 731 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 732 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 733 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); 734 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 8 unchanged lines hidden (view full) --- 743 struct evsel *evsel, *leader; 744 745 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 746 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 747 748 /* faults + :ku modifier */ 749 evsel = leader = evlist__first(evlist); 750 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
741 TEST_ASSERT_VAL("wrong config", 742 PERF_COUNT_SW_PAGE_FAULTS == evsel->core.attr.config); | 751 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_PAGE_FAULTS)); |
743 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 744 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 745 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 746 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 747 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 748 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 749 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 750 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 751 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 752 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 753 754 /* cache-references + :u modifier */ 755 evsel = evsel__next(evsel); 756 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 752 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 753 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 754 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 755 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 756 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 757 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 758 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 759 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 760 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 761 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 762 763 /* cache-references + :u modifier */ 764 evsel = evsel__next(evsel); 765 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
757 TEST_ASSERT_VAL("wrong config", 758 PERF_COUNT_HW_CACHE_REFERENCES == evsel->core.attr.config); | 766 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_REFERENCES)); |
759 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 760 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 761 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 762 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 763 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 764 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 765 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 766 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 767 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 768 769 /* cycles:k */ 770 evsel = evsel__next(evsel); 771 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 767 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 768 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 769 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 770 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 771 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 772 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 773 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 774 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 775 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 776 777 /* cycles:k */ 778 evsel = evsel__next(evsel); 779 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
772 TEST_ASSERT_VAL("wrong config", 773 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 780 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
774 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 775 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 776 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 777 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 778 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 779 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 780 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 781 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); --- 26 unchanged lines hidden (view full) --- 808 !strcmp(leader->group_name, "group1")); 809 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 810 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 811 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 812 813 /* group1 cycles:kppp */ 814 evsel = evsel__next(evsel); 815 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 781 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 782 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 783 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 784 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 785 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 786 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 787 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 788 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); --- 26 unchanged lines hidden (view full) --- 815 !strcmp(leader->group_name, "group1")); 816 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 817 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 818 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 819 820 /* group1 cycles:kppp */ 821 evsel = evsel__next(evsel); 822 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
816 TEST_ASSERT_VAL("wrong config", 817 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 823 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
818 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 819 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 820 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 821 /* use of precise requires exclude_guest */ 822 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 823 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 824 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 3); 825 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 826 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 827 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 828 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 829 830 /* group2 cycles + G modifier */ 831 evsel = leader = evsel__next(evsel); 832 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 824 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 825 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 826 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 827 /* use of precise requires exclude_guest */ 828 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 829 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 830 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 3); 831 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 832 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 833 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 834 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 835 836 /* group2 cycles + G modifier */ 837 evsel = leader = evsel__next(evsel); 838 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
833 TEST_ASSERT_VAL("wrong config", 834 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 839 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
835 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 836 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 837 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 838 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 839 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 840 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 841 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 842 TEST_ASSERT_VAL("wrong group name", 843 !strcmp(leader->group_name, "group2")); 844 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 845 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 846 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 847 848 /* group2 1:3 + G modifier */ 849 evsel = evsel__next(evsel); 850 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); | 840 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 841 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 842 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 843 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 844 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 845 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 846 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 847 TEST_ASSERT_VAL("wrong group name", 848 !strcmp(leader->group_name, "group2")); 849 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 850 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 851 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 852 853 /* group2 1:3 + G modifier */ 854 evsel = evsel__next(evsel); 855 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
851 TEST_ASSERT_VAL("wrong config", 3 == evsel->core.attr.config); | 856 TEST_ASSERT_VAL("wrong config", test_config(evsel, 3)); |
852 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 853 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 854 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 855 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 856 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 857 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 858 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 859 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 860 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 861 862 /* instructions:u */ 863 evsel = evsel__next(evsel); 864 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 857 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 858 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 859 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 860 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 861 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 862 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 863 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 864 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 865 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 866 867 /* instructions:u */ 868 evsel = evsel__next(evsel); 869 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
865 TEST_ASSERT_VAL("wrong config", 866 PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); | 870 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS)); |
867 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 868 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 869 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 870 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 871 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 872 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 873 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 874 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); --- 7 unchanged lines hidden (view full) --- 882 struct evsel *evsel, *leader; 883 884 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 885 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 886 887 /* cycles:u + p */ 888 evsel = leader = evlist__first(evlist); 889 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 871 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 872 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 873 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 874 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 875 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 876 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 877 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 878 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); --- 7 unchanged lines hidden (view full) --- 886 struct evsel *evsel, *leader; 887 888 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 889 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 890 891 /* cycles:u + p */ 892 evsel = leader = evlist__first(evlist); 893 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
890 TEST_ASSERT_VAL("wrong config", 891 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 894 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
892 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 893 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 894 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 895 /* use of precise requires exclude_guest */ 896 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 897 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 898 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 1); 899 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 900 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 901 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 902 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 903 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 904 905 /* instructions:kp + p */ 906 evsel = evsel__next(evsel); 907 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 895 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 896 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 897 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 898 /* use of precise requires exclude_guest */ 899 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 900 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 901 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 1); 902 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 903 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 904 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 905 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 906 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 907 908 /* instructions:kp + p */ 909 evsel = evsel__next(evsel); 910 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
908 TEST_ASSERT_VAL("wrong config", 909 PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); | 911 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS)); |
910 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 911 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 912 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 913 /* use of precise requires exclude_guest */ 914 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 915 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 916 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); 917 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 8 unchanged lines hidden (view full) --- 926 struct evsel *evsel, *leader; 927 928 TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->core.nr_entries); 929 TEST_ASSERT_VAL("wrong number of groups", 2 == evlist__nr_groups(evlist)); 930 931 /* cycles + G */ 932 evsel = leader = evlist__first(evlist); 933 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 912 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 913 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 914 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 915 /* use of precise requires exclude_guest */ 916 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 917 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 918 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); 919 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 8 unchanged lines hidden (view full) --- 928 struct evsel *evsel, *leader; 929 930 TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->core.nr_entries); 931 TEST_ASSERT_VAL("wrong number of groups", 2 == evlist__nr_groups(evlist)); 932 933 /* cycles + G */ 934 evsel = leader = evlist__first(evlist); 935 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
934 TEST_ASSERT_VAL("wrong config", 935 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 936 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
936 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 937 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 938 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 939 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 940 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 941 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 942 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 943 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 944 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 945 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 946 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 947 948 /* instructions + G */ 949 evsel = evsel__next(evsel); 950 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 937 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 938 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 939 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 940 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 941 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 942 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 943 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 944 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 945 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 946 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 947 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 948 949 /* instructions + G */ 950 evsel = evsel__next(evsel); 951 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
951 TEST_ASSERT_VAL("wrong config", 952 PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); | 952 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS)); |
953 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 954 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 955 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 956 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 957 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 958 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 959 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 960 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 961 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 962 963 /* cycles:G */ 964 evsel = leader = evsel__next(evsel); 965 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 953 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 954 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 955 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 956 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 957 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 958 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 959 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 960 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 961 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 962 963 /* cycles:G */ 964 evsel = leader = evsel__next(evsel); 965 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
966 TEST_ASSERT_VAL("wrong config", 967 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 966 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
968 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 969 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 970 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 971 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 972 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 973 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 974 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 975 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 976 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 977 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 978 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 979 980 /* instructions:G */ 981 evsel = evsel__next(evsel); 982 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 967 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 968 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 969 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 970 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 971 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 972 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 973 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 974 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 975 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 976 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 977 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); 978 979 /* instructions:G */ 980 evsel = evsel__next(evsel); 981 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
983 TEST_ASSERT_VAL("wrong config", 984 PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); | 982 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS)); |
985 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 986 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 987 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 988 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 989 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 990 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 991 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 992 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 993 994 /* cycles */ 995 evsel = evsel__next(evsel); 996 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 983 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 984 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 985 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 986 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 987 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 988 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 989 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 990 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); 991 992 /* cycles */ 993 evsel = evsel__next(evsel); 994 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
997 TEST_ASSERT_VAL("wrong config", 998 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 995 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
999 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1000 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1001 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1002 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1003 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1004 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1005 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1006 --- 5 unchanged lines hidden (view full) --- 1012 struct evsel *evsel, *leader; 1013 1014 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1015 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1016 1017 /* cycles + :H group modifier */ 1018 evsel = leader = evlist__first(evlist); 1019 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 996 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 997 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 998 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 999 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1000 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1001 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1002 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1003 --- 5 unchanged lines hidden (view full) --- 1009 struct evsel *evsel, *leader; 1010 1011 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1012 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1013 1014 /* cycles + :H group modifier */ 1015 evsel = leader = evlist__first(evlist); 1016 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1020 TEST_ASSERT_VAL("wrong config", 1021 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 1017 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1022 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1023 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1024 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1025 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1026 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1027 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1028 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1029 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1030 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1031 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1032 1033 /* cache-misses:G + :H group modifier */ 1034 evsel = evsel__next(evsel); 1035 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1018 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1019 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1020 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1021 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1022 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1023 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1024 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1025 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1026 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1027 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1028 1029 /* cache-misses:G + :H group modifier */ 1030 evsel = evsel__next(evsel); 1031 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1036 TEST_ASSERT_VAL("wrong config", 1037 PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); | 1032 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES)); |
1038 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1039 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1040 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1041 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1042 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1043 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1044 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1045 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 6 unchanged lines hidden (view full) --- 1052 struct evsel *evsel, *leader; 1053 1054 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1055 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1056 1057 /* cycles + :G group modifier */ 1058 evsel = leader = evlist__first(evlist); 1059 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1033 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1034 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1035 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1036 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1037 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1038 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1039 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1040 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 6 unchanged lines hidden (view full) --- 1047 struct evsel *evsel, *leader; 1048 1049 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1050 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1051 1052 /* cycles + :G group modifier */ 1053 evsel = leader = evlist__first(evlist); 1054 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1060 TEST_ASSERT_VAL("wrong config", 1061 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 1055 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1062 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1063 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1064 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1065 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1066 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 1067 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1068 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1069 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1070 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1071 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1072 1073 /* cache-misses:H + :G group modifier */ 1074 evsel = evsel__next(evsel); 1075 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1056 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1057 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1058 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1059 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1060 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 1061 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1062 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1063 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1064 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1065 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1066 1067 /* cache-misses:H + :G group modifier */ 1068 evsel = evsel__next(evsel); 1069 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1076 TEST_ASSERT_VAL("wrong config", 1077 PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); | 1070 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES)); |
1078 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1079 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1080 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1081 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1082 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1083 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1084 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1085 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 6 unchanged lines hidden (view full) --- 1092 struct evsel *evsel, *leader; 1093 1094 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1095 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1096 1097 /* cycles:G + :u group modifier */ 1098 evsel = leader = evlist__first(evlist); 1099 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1071 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1072 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1073 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1074 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1075 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1076 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1077 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1078 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 6 unchanged lines hidden (view full) --- 1085 struct evsel *evsel, *leader; 1086 1087 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1088 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1089 1090 /* cycles:G + :u group modifier */ 1091 evsel = leader = evlist__first(evlist); 1092 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1100 TEST_ASSERT_VAL("wrong config", 1101 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 1093 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1102 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1103 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1104 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1105 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1106 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 1107 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1108 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1109 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1110 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1111 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1112 1113 /* cache-misses:H + :u group modifier */ 1114 evsel = evsel__next(evsel); 1115 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1094 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1095 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1096 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1097 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1098 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 1099 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1100 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1101 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1102 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1103 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1104 1105 /* cache-misses:H + :u group modifier */ 1106 evsel = evsel__next(evsel); 1107 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1116 TEST_ASSERT_VAL("wrong config", 1117 PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); | 1108 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES)); |
1118 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1119 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1120 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1121 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1122 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1123 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1124 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1125 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 6 unchanged lines hidden (view full) --- 1132 struct evsel *evsel, *leader; 1133 1134 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1135 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1136 1137 /* cycles:G + :uG group modifier */ 1138 evsel = leader = evlist__first(evlist); 1139 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1109 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1110 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1111 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1112 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1113 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1114 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1115 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1116 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 6 unchanged lines hidden (view full) --- 1123 struct evsel *evsel, *leader; 1124 1125 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1126 TEST_ASSERT_VAL("wrong number of groups", 1 == evlist__nr_groups(evlist)); 1127 1128 /* cycles:G + :uG group modifier */ 1129 evsel = leader = evlist__first(evlist); 1130 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1140 TEST_ASSERT_VAL("wrong config", 1141 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 1131 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1142 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1143 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1144 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1145 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1146 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 1147 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1148 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1149 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1150 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1151 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1152 1153 /* cache-misses:H + :uG group modifier */ 1154 evsel = evsel__next(evsel); 1155 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1132 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1133 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1134 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1135 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1136 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); 1137 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1138 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1139 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); 1140 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); 1141 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); 1142 1143 /* cache-misses:H + :uG group modifier */ 1144 evsel = evsel__next(evsel); 1145 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1156 TEST_ASSERT_VAL("wrong config", 1157 PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); | 1146 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES)); |
1158 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1159 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1160 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1161 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1162 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1163 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1164 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1165 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 5 unchanged lines hidden (view full) --- 1171{ 1172 struct evsel *evsel, *leader; 1173 1174 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 1175 1176 /* cycles - sampling group leader */ 1177 evsel = leader = evlist__first(evlist); 1178 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1147 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1148 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1149 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1150 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); 1151 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1152 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1153 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1154 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); --- 5 unchanged lines hidden (view full) --- 1160{ 1161 struct evsel *evsel, *leader; 1162 1163 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 1164 1165 /* cycles - sampling group leader */ 1166 evsel = leader = evlist__first(evlist); 1167 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1179 TEST_ASSERT_VAL("wrong config", 1180 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 1168 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1181 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1182 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1183 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1184 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1185 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1186 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1187 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1188 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1189 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); 1190 1191 /* cache-misses - not sampling */ 1192 evsel = evsel__next(evsel); 1193 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1169 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1170 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1171 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1172 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1173 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1174 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1175 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1176 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1177 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); 1178 1179 /* cache-misses - not sampling */ 1180 evsel = evsel__next(evsel); 1181 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1194 TEST_ASSERT_VAL("wrong config", 1195 PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); | 1182 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES)); |
1196 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1197 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1198 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1199 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1200 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1201 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1202 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1203 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); 1204 1205 /* branch-misses - not sampling */ 1206 evsel = evsel__next(evsel); 1207 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1183 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1184 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1185 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1186 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1187 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1188 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1189 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1190 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); 1191 1192 /* branch-misses - not sampling */ 1193 evsel = evsel__next(evsel); 1194 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1208 TEST_ASSERT_VAL("wrong config", 1209 PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); | 1195 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES)); |
1210 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1211 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1212 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1213 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1214 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1215 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1216 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1217 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 6 unchanged lines hidden (view full) --- 1224{ 1225 struct evsel *evsel, *leader; 1226 1227 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1228 1229 /* instructions - sampling group leader */ 1230 evsel = leader = evlist__first(evlist); 1231 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1196 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1197 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1198 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); 1199 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1200 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1201 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1202 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1203 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 6 unchanged lines hidden (view full) --- 1210{ 1211 struct evsel *evsel, *leader; 1212 1213 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1214 1215 /* instructions - sampling group leader */ 1216 evsel = leader = evlist__first(evlist); 1217 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1232 TEST_ASSERT_VAL("wrong config", 1233 PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); | 1218 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS)); |
1234 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1235 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1236 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1237 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1238 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1239 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1240 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1241 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1242 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); 1243 1244 /* branch-misses - not sampling */ 1245 evsel = evsel__next(evsel); 1246 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1219 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1220 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1221 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1222 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1223 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1224 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1225 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1226 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1227 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); 1228 1229 /* branch-misses - not sampling */ 1230 evsel = evsel__next(evsel); 1231 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1247 TEST_ASSERT_VAL("wrong config", 1248 PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); | 1232 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES)); |
1249 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1250 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1251 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1252 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1253 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1254 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1255 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1256 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 19 unchanged lines hidden (view full) --- 1276{ 1277 struct evsel *evsel, *leader; 1278 1279 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 1280 1281 /* cycles - group leader */ 1282 evsel = leader = evlist__first(evlist); 1283 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1233 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1234 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1235 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); 1236 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); 1237 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); 1238 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); 1239 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1240 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); --- 19 unchanged lines hidden (view full) --- 1260{ 1261 struct evsel *evsel, *leader; 1262 1263 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 1264 1265 /* cycles - group leader */ 1266 evsel = leader = evlist__first(evlist); 1267 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1284 TEST_ASSERT_VAL("wrong config", 1285 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 1268 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1286 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1287 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1288 TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned); 1289 1290 /* cache-misses - can not be pinned, but will go on with the leader */ 1291 evsel = evsel__next(evsel); 1292 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1269 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1270 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1271 TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned); 1272 1273 /* cache-misses - can not be pinned, but will go on with the leader */ 1274 evsel = evsel__next(evsel); 1275 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1293 TEST_ASSERT_VAL("wrong config", 1294 PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); | 1276 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES)); |
1295 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); 1296 1297 /* branch-misses - ditto */ 1298 evsel = evsel__next(evsel); | 1277 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); 1278 1279 /* branch-misses - ditto */ 1280 evsel = evsel__next(evsel); |
1299 TEST_ASSERT_VAL("wrong config", 1300 PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); | 1281 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES)); |
1301 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); 1302 1303 return TEST_OK; 1304} 1305 1306static int test__checkevent_exclusive_modifier(struct evlist *evlist) 1307{ 1308 struct evsel *evsel = evlist__first(evlist); --- 11 unchanged lines hidden (view full) --- 1320{ 1321 struct evsel *evsel, *leader; 1322 1323 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 1324 1325 /* cycles - group leader */ 1326 evsel = leader = evlist__first(evlist); 1327 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1282 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); 1283 1284 return TEST_OK; 1285} 1286 1287static int test__checkevent_exclusive_modifier(struct evlist *evlist) 1288{ 1289 struct evsel *evsel = evlist__first(evlist); --- 11 unchanged lines hidden (view full) --- 1301{ 1302 struct evsel *evsel, *leader; 1303 1304 TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); 1305 1306 /* cycles - group leader */ 1307 evsel = leader = evlist__first(evlist); 1308 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1328 TEST_ASSERT_VAL("wrong config", 1329 PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); | 1309 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1330 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1331 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1332 TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive); 1333 1334 /* cache-misses - can not be pinned, but will go on with the leader */ 1335 evsel = evsel__next(evsel); 1336 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); | 1310 TEST_ASSERT_VAL("wrong group name", !evsel->group_name); 1311 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1312 TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive); 1313 1314 /* cache-misses - can not be pinned, but will go on with the leader */ 1315 evsel = evsel__next(evsel); 1316 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
1337 TEST_ASSERT_VAL("wrong config", 1338 PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); | 1317 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES)); |
1339 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); 1340 1341 /* branch-misses - ditto */ 1342 evsel = evsel__next(evsel); | 1318 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); 1319 1320 /* branch-misses - ditto */ 1321 evsel = evsel__next(evsel); |
1343 TEST_ASSERT_VAL("wrong config", 1344 PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); | 1322 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES)); |
1345 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); 1346 1347 return TEST_OK; 1348} 1349static int test__checkevent_breakpoint_len(struct evlist *evlist) 1350{ 1351 struct evsel *evsel = evlist__first(evlist); 1352 1353 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1354 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); | 1323 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); 1324 1325 return TEST_OK; 1326} 1327static int test__checkevent_breakpoint_len(struct evlist *evlist) 1328{ 1329 struct evsel *evsel = evlist__first(evlist); 1330 1331 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1332 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
1355 TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); | 1333 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0)); |
1356 TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == 1357 evsel->core.attr.bp_type); 1358 TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_1 == 1359 evsel->core.attr.bp_len); 1360 1361 return TEST_OK; 1362} 1363 1364static int test__checkevent_breakpoint_len_w(struct evlist *evlist) 1365{ 1366 struct evsel *evsel = evlist__first(evlist); 1367 1368 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1369 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); | 1334 TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == 1335 evsel->core.attr.bp_type); 1336 TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_1 == 1337 evsel->core.attr.bp_len); 1338 1339 return TEST_OK; 1340} 1341 1342static int test__checkevent_breakpoint_len_w(struct evlist *evlist) 1343{ 1344 struct evsel *evsel = evlist__first(evlist); 1345 1346 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1347 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
1370 TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); | 1348 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0)); |
1371 TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_W == 1372 evsel->core.attr.bp_type); 1373 TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_2 == 1374 evsel->core.attr.bp_len); 1375 1376 return TEST_OK; 1377} 1378 --- 11 unchanged lines hidden (view full) --- 1390} 1391 1392static int test__checkevent_precise_max_modifier(struct evlist *evlist) 1393{ 1394 struct evsel *evsel = evlist__first(evlist); 1395 1396 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1397 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); | 1349 TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_W == 1350 evsel->core.attr.bp_type); 1351 TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_2 == 1352 evsel->core.attr.bp_len); 1353 1354 return TEST_OK; 1355} 1356 --- 11 unchanged lines hidden (view full) --- 1368} 1369 1370static int test__checkevent_precise_max_modifier(struct evlist *evlist) 1371{ 1372 struct evsel *evsel = evlist__first(evlist); 1373 1374 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1375 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
1398 TEST_ASSERT_VAL("wrong config", 1399 PERF_COUNT_SW_TASK_CLOCK == evsel->core.attr.config); | 1376 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_TASK_CLOCK)); |
1400 return TEST_OK; 1401} 1402 1403static int test__checkevent_config_symbol(struct evlist *evlist) 1404{ 1405 struct evsel *evsel = evlist__first(evlist); 1406 1407 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "insn")); --- 41 unchanged lines hidden (view full) --- 1449 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "intel_pt//u")); 1450 return TEST_OK; 1451} 1452 1453static int test__checkevent_complex_name(struct evlist *evlist) 1454{ 1455 struct evsel *evsel = evlist__first(evlist); 1456 | 1377 return TEST_OK; 1378} 1379 1380static int test__checkevent_config_symbol(struct evlist *evlist) 1381{ 1382 struct evsel *evsel = evlist__first(evlist); 1383 1384 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "insn")); --- 41 unchanged lines hidden (view full) --- 1426 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "intel_pt//u")); 1427 return TEST_OK; 1428} 1429 1430static int test__checkevent_complex_name(struct evlist *evlist) 1431{ 1432 struct evsel *evsel = evlist__first(evlist); 1433 |
1457 TEST_ASSERT_VAL("wrong complex name parsing", evsel__name_is(evsel, "COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks")); | 1434 TEST_ASSERT_VAL("wrong complex name parsing", 1435 evsel__name_is(evsel, 1436 "COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks")); |
1458 return TEST_OK; 1459} 1460 1461static int test__checkevent_raw_pmu(struct evlist *evlist) 1462{ 1463 struct evsel *evsel = evlist__first(evlist); 1464 1465 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1466 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); | 1437 return TEST_OK; 1438} 1439 1440static int test__checkevent_raw_pmu(struct evlist *evlist) 1441{ 1442 struct evsel *evsel = evlist__first(evlist); 1443 1444 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1445 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
1467 TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); | 1446 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a)); |
1468 return TEST_OK; 1469} 1470 1471static int test__sym_event_slash(struct evlist *evlist) 1472{ 1473 struct evsel *evsel = evlist__first(evlist); 1474 1475 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); | 1447 return TEST_OK; 1448} 1449 1450static int test__sym_event_slash(struct evlist *evlist) 1451{ 1452 struct evsel *evsel = evlist__first(evlist); 1453 1454 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); |
1476 TEST_ASSERT_VAL("wrong config", evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES); | 1455 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1477 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1478 return TEST_OK; 1479} 1480 1481static int test__sym_event_dc(struct evlist *evlist) 1482{ 1483 struct evsel *evsel = evlist__first(evlist); 1484 1485 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); | 1456 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1457 return TEST_OK; 1458} 1459 1460static int test__sym_event_dc(struct evlist *evlist) 1461{ 1462 struct evsel *evsel = evlist__first(evlist); 1463 1464 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); |
1486 TEST_ASSERT_VAL("wrong config", evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES); | 1465 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); |
1487 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 1488 return TEST_OK; 1489} 1490 1491#ifdef HAVE_LIBTRACEEVENT 1492static int count_tracepoints(void) 1493{ 1494 struct dirent *events_ent; --- 50 unchanged lines hidden (view full) --- 1545#endif /* HAVE_LIBTRACEVENT */ 1546 1547static int test__hybrid_hw_event_with_pmu(struct evlist *evlist) 1548{ 1549 struct evsel *evsel = evlist__first(evlist); 1550 1551 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1552 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1466 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 1467 return TEST_OK; 1468} 1469 1470#ifdef HAVE_LIBTRACEEVENT 1471static int count_tracepoints(void) 1472{ 1473 struct dirent *events_ent; --- 50 unchanged lines hidden (view full) --- 1524#endif /* HAVE_LIBTRACEVENT */ 1525 1526static int test__hybrid_hw_event_with_pmu(struct evlist *evlist) 1527{ 1528 struct evsel *evsel = evlist__first(evlist); 1529 1530 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1531 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1553 TEST_ASSERT_VAL("wrong config", 0x3c == evsel->core.attr.config); | 1532 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x3c)); |
1554 return TEST_OK; 1555} 1556 1557static int test__hybrid_hw_group_event(struct evlist *evlist) 1558{ 1559 struct evsel *evsel, *leader; 1560 1561 evsel = leader = evlist__first(evlist); 1562 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1563 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1533 return TEST_OK; 1534} 1535 1536static int test__hybrid_hw_group_event(struct evlist *evlist) 1537{ 1538 struct evsel *evsel, *leader; 1539 1540 evsel = leader = evlist__first(evlist); 1541 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1542 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1564 TEST_ASSERT_VAL("wrong config", 0x3c == evsel->core.attr.config); | 1543 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x3c)); |
1565 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1566 1567 evsel = evsel__next(evsel); 1568 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1544 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1545 1546 evsel = evsel__next(evsel); 1547 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1569 TEST_ASSERT_VAL("wrong config", 0xc0 == evsel->core.attr.config); | 1548 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0xc0)); |
1570 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1571 return TEST_OK; 1572} 1573 1574static int test__hybrid_sw_hw_group_event(struct evlist *evlist) 1575{ 1576 struct evsel *evsel, *leader; 1577 1578 evsel = leader = evlist__first(evlist); 1579 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1580 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); 1581 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1582 1583 evsel = evsel__next(evsel); 1584 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1549 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1550 return TEST_OK; 1551} 1552 1553static int test__hybrid_sw_hw_group_event(struct evlist *evlist) 1554{ 1555 struct evsel *evsel, *leader; 1556 1557 evsel = leader = evlist__first(evlist); 1558 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1559 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); 1560 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1561 1562 evsel = evsel__next(evsel); 1563 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1585 TEST_ASSERT_VAL("wrong config", 0x3c == evsel->core.attr.config); | 1564 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x3c)); |
1586 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1587 return TEST_OK; 1588} 1589 1590static int test__hybrid_hw_sw_group_event(struct evlist *evlist) 1591{ 1592 struct evsel *evsel, *leader; 1593 1594 evsel = leader = evlist__first(evlist); 1595 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1596 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1565 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1566 return TEST_OK; 1567} 1568 1569static int test__hybrid_hw_sw_group_event(struct evlist *evlist) 1570{ 1571 struct evsel *evsel, *leader; 1572 1573 evsel = leader = evlist__first(evlist); 1574 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1575 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1597 TEST_ASSERT_VAL("wrong config", 0x3c == evsel->core.attr.config); | 1576 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x3c)); |
1598 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1599 1600 evsel = evsel__next(evsel); 1601 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); 1602 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1603 return TEST_OK; 1604} 1605 1606static int test__hybrid_group_modifier1(struct evlist *evlist) 1607{ 1608 struct evsel *evsel, *leader; 1609 1610 evsel = leader = evlist__first(evlist); 1611 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1612 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1577 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1578 1579 evsel = evsel__next(evsel); 1580 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); 1581 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1582 return TEST_OK; 1583} 1584 1585static int test__hybrid_group_modifier1(struct evlist *evlist) 1586{ 1587 struct evsel *evsel, *leader; 1588 1589 evsel = leader = evlist__first(evlist); 1590 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1591 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1613 TEST_ASSERT_VAL("wrong config", 0x3c == evsel->core.attr.config); | 1592 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x3c)); |
1614 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1615 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 1616 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1617 1618 evsel = evsel__next(evsel); 1619 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1593 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1594 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); 1595 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); 1596 1597 evsel = evsel__next(evsel); 1598 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1620 TEST_ASSERT_VAL("wrong config", 0xc0 == evsel->core.attr.config); | 1599 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0xc0)); |
1621 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1622 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1623 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1624 return TEST_OK; 1625} 1626 1627static int test__hybrid_raw1(struct evlist *evlist) 1628{ 1629 struct evsel *evsel = evlist__first(evlist); 1630 1631 if (!perf_pmu__hybrid_mounted("cpu_atom")) { 1632 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1633 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1600 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 1601 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); 1602 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); 1603 return TEST_OK; 1604} 1605 1606static int test__hybrid_raw1(struct evlist *evlist) 1607{ 1608 struct evsel *evsel = evlist__first(evlist); 1609 1610 if (!perf_pmu__hybrid_mounted("cpu_atom")) { 1611 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1612 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1634 TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); | 1613 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a)); |
1635 return TEST_OK; 1636 } 1637 1638 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1639 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1614 return TEST_OK; 1615 } 1616 1617 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); 1618 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1640 TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); | 1619 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a)); |
1641 1642 /* The type of second event is randome value */ 1643 evsel = evsel__next(evsel); | 1620 1621 /* The type of second event is randome value */ 1622 evsel = evsel__next(evsel); |
1644 TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); | 1623 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a)); |
1645 return TEST_OK; 1646} 1647 1648static int test__hybrid_raw2(struct evlist *evlist) 1649{ 1650 struct evsel *evsel = evlist__first(evlist); 1651 1652 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1653 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); | 1624 return TEST_OK; 1625} 1626 1627static int test__hybrid_raw2(struct evlist *evlist) 1628{ 1629 struct evsel *evsel = evlist__first(evlist); 1630 1631 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); 1632 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
1654 TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); | 1633 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a)); |
1655 return TEST_OK; 1656} 1657 1658static int test__hybrid_cache_event(struct evlist *evlist) 1659{ 1660 struct evsel *evsel = evlist__first(evlist); 1661 1662 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); --- 797 unchanged lines hidden --- | 1634 return TEST_OK; 1635} 1636 1637static int test__hybrid_cache_event(struct evlist *evlist) 1638{ 1639 struct evsel *evsel = evlist__first(evlist); 1640 1641 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); --- 797 unchanged lines hidden --- |