Lines Matching refs:counter

94 static void start_counter(unsigned long counter, unsigned long start_flags,  in start_counter()  argument
99 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_START, counter, 1, start_flags, in start_counter()
101 __GUEST_ASSERT(ret.error == 0, "Unable to start counter %ld\n", counter); in start_counter()
105 static void stop_reset_counter(unsigned long counter, unsigned long stop_flags) in stop_reset_counter() argument
109 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_STOP, counter, 1, in stop_reset_counter()
112 "Unable to stop counter %ld\n", counter); in stop_reset_counter()
115 static void stop_counter(unsigned long counter, unsigned long stop_flags) in stop_counter() argument
119 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_STOP, counter, 1, stop_flags, in stop_counter()
122 counter, ret.error); in stop_counter()
259 unsigned long counter; in test_pmu_event() local
263 counter = get_counter_index(0, counter_mask_available, 0, event); in test_pmu_event()
264 counter_value_pre = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event()
267 start_counter(counter, 0, 0); in test_pmu_event()
269 stop_counter(counter, 0); in test_pmu_event()
271 counter_value_post = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event()
281 start_counter(counter, SBI_PMU_START_FLAG_SET_INIT_VALUE, ULONG_MAX/2); in test_pmu_event()
282 stop_counter(counter, 0); in test_pmu_event()
283 counter_value_pre = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event()
285 start_counter(counter, SBI_PMU_START_FLAG_SET_INIT_VALUE, counter_init_value); in test_pmu_event()
286 stop_counter(counter, 0); in test_pmu_event()
287 counter_value_post = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event()
293 start_counter(counter, SBI_PMU_START_FLAG_SET_INIT_VALUE, counter_init_value); in test_pmu_event()
295 stop_counter(counter, 0); in test_pmu_event()
297 counter_value_post = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event()
302 stop_reset_counter(counter, 0); in test_pmu_event()
307 unsigned long counter; in test_pmu_event_snapshot() local
312 counter = get_counter_index(0, counter_mask_available, 0, event); in test_pmu_event_snapshot()
313 counter_value_pre = read_counter(counter, ctrinfo_arr[counter]); in test_pmu_event_snapshot()
316 start_counter(counter, 0, 0); in test_pmu_event_snapshot()
318 stop_counter(counter, SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT); in test_pmu_event_snapshot()
332 start_counter(counter, SBI_PMU_START_FLAG_INIT_SNAPSHOT, 0); in test_pmu_event_snapshot()
333 stop_counter(counter, SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT); in test_pmu_event_snapshot()
337 start_counter(counter, SBI_PMU_START_FLAG_INIT_SNAPSHOT, 0); in test_pmu_event_snapshot()
338 stop_counter(counter, SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT); in test_pmu_event_snapshot()
346 start_counter(counter, SBI_PMU_START_FLAG_INIT_SNAPSHOT, 0); in test_pmu_event_snapshot()
348 stop_counter(counter, SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT); in test_pmu_event_snapshot()
355 stop_reset_counter(counter, 0); in test_pmu_event_snapshot()
360 unsigned long counter; in test_pmu_event_overflow() local
365 counter = get_counter_index(0, counter_mask_available, 0, event); in test_pmu_event_overflow()
366 counter_in_use = counter; in test_pmu_event_overflow()
370 start_counter(counter, SBI_PMU_START_FLAG_INIT_SNAPSHOT, 0); in test_pmu_event_overflow()
374 stop_counter(counter, SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT); in test_pmu_event_overflow()
382 stop_reset_counter(counter, 0); in test_pmu_event_overflow()