0001
0002
0003
0004
0005
0006 #include <stdio.h>
0007 #include <stdlib.h>
0008
0009 #include "../event.h"
0010 #include "misc.h"
0011 #include "utils.h"
0012
0013 extern void thirty_two_instruction_loop(int loops);
0014
0015
0016
0017
0018
0019 static int mmcr0_pmcjce(void)
0020 {
0021 struct event event;
0022 u64 *intr_regs;
0023
0024
0025 SKIP_IF(check_pvr_for_sampling_tests());
0026
0027
0028 event_init_sampling(&event, 0x500fa);
0029 event.attr.sample_regs_intr = platform_extended_mask;
0030 FAIL_IF(event_open(&event));
0031 event.mmap_buffer = event_sample_buf_mmap(event.fd, 1);
0032
0033 FAIL_IF(event_enable(&event));
0034
0035
0036 thirty_two_instruction_loop(10000);
0037
0038 FAIL_IF(event_disable(&event));
0039
0040
0041 FAIL_IF(!collect_samples(event.mmap_buffer));
0042
0043 intr_regs = get_intr_regs(&event, event.mmap_buffer);
0044
0045
0046 FAIL_IF(!intr_regs);
0047
0048
0049 FAIL_IF(!get_mmcr0_pmcjce(get_reg_value(intr_regs, "MMCR0"), 5));
0050
0051 event_close(&event);
0052 return 0;
0053 }
0054
0055 int main(void)
0056 {
0057 return test_harness(mmcr0_pmcjce, "mmcr0_pmcjce");
0058 }