Lines Matching full:events
25 static int do_count_loop(struct event *events, bool is_p9, s64 *miss_percent) in do_count_loop() argument
38 event_read(&events[0]); in do_count_loop()
39 event_read(&events[1]); in do_count_loop()
41 // We could scale all the events by running/enabled but we're lazy in do_count_loop()
43 FAIL_IF(events[0].result.running != events[0].result.enabled); in do_count_loop()
44 FAIL_IF(events[1].result.running != events[1].result.enabled); in do_count_loop()
46 pred = events[0].result.value; in do_count_loop()
47 mpred = events[1].result.value; in do_count_loop()
50 event_read(&events[2]); in do_count_loop()
51 event_read(&events[3]); in do_count_loop()
52 FAIL_IF(events[2].result.running != events[2].result.enabled); in do_count_loop()
53 FAIL_IF(events[3].result.running != events[3].result.enabled); in do_count_loop()
55 pred += events[2].result.value; in do_count_loop()
56 mpred += events[3].result.value; in do_count_loop()
133 struct event events[4]; in spectre_v2_test() local
137 // The PMU events we use only work on Power8 or later in spectre_v2_test()
146 memset(events, 0, sizeof(events)); in spectre_v2_test()
148 setup_event(&events[0], PM_BR_PRED_CCACHE, "PM_BR_PRED_CCACHE"); in spectre_v2_test()
149 setup_event(&events[1], PM_BR_MPRED_CCACHE, "PM_BR_MPRED_CCACHE"); in spectre_v2_test()
150 FAIL_IF(event_open(&events[0])); in spectre_v2_test()
151 FAIL_IF(event_open_with_group(&events[1], events[0].fd) == -1); in spectre_v2_test()
157 setup_event(&events[2], PM_BR_PRED_PCACHE, "PM_BR_PRED_PCACHE"); in spectre_v2_test()
158 setup_event(&events[3], PM_BR_MPRED_PCACHE, "PM_BR_MPRED_PCACHE"); in spectre_v2_test()
160 FAIL_IF(event_open_with_group(&events[2], events[0].fd) == -1); in spectre_v2_test()
161 FAIL_IF(event_open_with_group(&events[3], events[0].fd) == -1); in spectre_v2_test()
164 FAIL_IF(do_count_loop(events, is_p9, &miss_percent)); in spectre_v2_test()
166 event_report_justified(&events[0], 18, 10); in spectre_v2_test()
167 event_report_justified(&events[1], 18, 10); in spectre_v2_test()
168 event_close(&events[0]); in spectre_v2_test()
169 event_close(&events[1]); in spectre_v2_test()
172 event_report_justified(&events[2], 18, 10); in spectre_v2_test()
173 event_report_justified(&events[3], 18, 10); in spectre_v2_test()
174 event_close(&events[2]); in spectre_v2_test()
175 event_close(&events[3]); in spectre_v2_test()