25 {
26
28
32
34 unsigned long long seconds;
35 unsigned long long ns;
36
38
39
43 }
44
46 printf("\nTesting PAPI_HW_INT\n");
47 }
48
52 }
53
56 if (!
quiet) printf(
"Could not add PAPI_HW_INT\n");
58 }
59
60
61
62
63
65 printf("\nRunning for 3 seconds\n");
66 }
67
68 clock_gettime(CLOCK_REALTIME,&before);
69
72
73 while(1) {
74 clock_gettime(CLOCK_REALTIME,&after);
75
76 seconds=after.tv_sec - before.tv_sec;
77 ns = after.tv_nsec - before.tv_nsec;
78 ns = (seconds*1000000000ULL)+ns;
79
80
81 if (ns>3000000000ULL) break;
82 }
83
85
88 }
89
91 printf(
"\tMeasured interrupts = %lld\n",
count);
92
93
94 printf("\tAssuming HZ=250, expect roughly 750\n");
95 }
96
97 if (!
quiet) printf(
"\n");
98
100 if (!
quiet) printf(
"Too few interrupts!\n");
101 test_fail( __FILE__, __LINE__,
"Too few interrupts!", 1 );
102 }
103
105
106 return 0;
107}
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
initialize the PAPI library.
Reset the hardware event counts in an event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)