2 * Copyright 2014, Michael Ellerman, IBM Corp.
3 * Licensed under GPLv2.
13 * Basic test that counts user cycles and takes EBBs.
19 event_init_named(&event, 0x1001e, "cycles");
20 event_leader_ebb_init(&event);
22 event.attr.exclude_kernel = 1;
23 event.attr.exclude_hv = 1;
24 event.attr.exclude_idle = 1;
26 FAIL_IF(event_open(&event));
28 ebb_enable_pmc_counting(1);
29 setup_ebb_handler(standard_ebb_callee);
31 FAIL_IF(ebb_event_enable(&event));
33 mtspr(SPRN_PMC1, pmc_sample_period(sample_period));
35 while (ebb_state.stats.ebb_count < 10) {
36 FAIL_IF(core_busy_loop());
37 FAIL_IF(ebb_check_mmcr0());
43 count_pmc(1, sample_period);
49 FAIL_IF(ebb_state.stats.ebb_count == 0);
50 FAIL_IF(!ebb_check_count(1, sample_period, 100));
57 return test_harness(cycles, "cycles");