This source file includes following definitions.
- close_clears_pmcc
- main
1
2
3
4
5
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <setjmp.h>
9 #include <signal.h>
10
11 #include "ebb.h"
12
13
14
15
16
17
18
19 int close_clears_pmcc(void)
20 {
21 struct event event;
22
23 SKIP_IF(!ebb_is_supported());
24
25 event_init_named(&event, 0x1001e, "cycles");
26 event_leader_ebb_init(&event);
27
28 FAIL_IF(event_open(&event));
29
30 ebb_enable_pmc_counting(1);
31 setup_ebb_handler(standard_ebb_callee);
32 ebb_global_enable();
33 FAIL_IF(ebb_event_enable(&event));
34
35 mtspr(SPRN_PMC1, pmc_sample_period(sample_period));
36
37 while (ebb_state.stats.ebb_count < 1)
38 FAIL_IF(core_busy_loop());
39
40 ebb_global_disable();
41 event_close(&event);
42
43 FAIL_IF(ebb_state.stats.ebb_count == 0);
44
45
46
47
48 FAIL_IF(catch_sigill(write_pmc1));
49
50
51 mfspr(SPRN_EBBHR);
52 mfspr(SPRN_EBBRR);
53 mfspr(SPRN_BESCR);
54
55 return 0;
56 }
57
58 int main(void)
59 {
60 return test_harness(close_clears_pmcc, "close_clears_pmcc");
61 }