50{
56 long long lwrflow = 0, error, max_error = 0;
57 long long vals[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
58
60
64
68 printf(
"ovf_info = %d (%#x)\n",
options.ovf_info.type,
70
74 printf( "sub_info->hardware_intr = %d\n\n",
75 options2.sub_info->hardware_intr );
76
79
81
82
83#if ((defined(linux) && (defined(__i386__) || (defined __x86_64__))) )
84 if ( !strncmp( hwinfo->
model_string,
"Intel Pentium 4", 15 ) ) {
86 }
else if ( !strncmp( hwinfo->
model_string,
"AMD K7", 6 ) ) {
87
88 }
else if ( !strncmp( hwinfo->
model_string,
"AMD K8", 6 ) ) {
89
90 }
else if ( !strncmp( hwinfo->
model_string,
"Intel Core", 10 ) ) {
91 evt3 = 0;
92 } else
93 evt3 = 0;
94#endif
95
99
102 test_fail( __FILE__, __LINE__,
"PAPI_add_event:PAPI_TOT_INS",
retval );
105 test_fail( __FILE__, __LINE__,
"PAPI_add_event:PAPI_TOT_CYC",
retval );
106 if ( evt3 ) {
110 }
114
118
119 for (
i = 0;
i < 1000000;
i++ ) {
120 if (
i % 1000 == 0 ) {
122
126 dash = 0;
127 printf( "Main loop read vals :" );
128 for (
i = 0;
i < 3 ;
i++ )
129 printf(
"%lld ", vals[
i] );
130 printf( "\n" );
132 error =
ovrflow - ( lwrflow + vals[0] ) / 2;
133 printf( "Difference: %lld\n", error );
135 if ( abs( error ) > max_error )
136 max_error = abs( error );
137 }
138 lwrflow = vals[0];
140 dash = 1;
141 printf( "---------------------\n" );
142 }
143 }
144 }
145
149
153
157
158 printf( "Verification:\n" );
159 printf
160 ( "Maximum absolute difference between overflow value\nand adjacent measured values is: %lld\n",
161 max_error );
163 printf(
"This exceeds the error limit: %d\n",
ERRORFLOW );
164 test_fail( __FILE__, __LINE__,
"Overflows", 1 );
165 }
166 printf(
"This is within the error limit: %d\n",
ERRORFLOW );
168 exit( 1 );
169}
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
get information about the system hardware
Get PAPI library or event set options.
initialize the PAPI library.
Set up an event set to begin registering overflows.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
void handler(int EventSet, void *address, long long overflow_vector, void *context)
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)
char model_string[PAPI_MAX_STR_LEN]
A pointer to the following is passed to PAPI_set/get_opt()