95{
97 const char *
name =
"unknown";
100
101
103
104
106
108
109
110 gettimeofday( &
start, NULL );
114
115
118 test_fail( __FILE__, __LINE__,
"PAPI_library_init failed", 1 );
119 }
120
123 printf( "[%d] %s, num_events = %d\n", getpid(),
125 }
126
127
129 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset failed", 1 );
130 }
131
132
135 if (!
quiet) printf(
"Trouble adding event\n");
136 test_skip( __FILE__, __LINE__,
"PAPI_add_event failed", 1 );
137 }
138 }
139
140
145 test_fail( __FILE__, __LINE__,
"PAPI_overflow failed", 1 );
146 }
147 }
148
149
151 test_fail( __FILE__, __LINE__,
"PAPI_start failed", 1 );
152 }
153
154
155
156
158
159
161 printf(
"[%d] %s, %s\n", getpid(),
name,
"stop");
162 }
163
166 }
167
169 printf("[%d] %s, %s\n", getpid(),
170 name,
"exec(./child_overflow)");
171 }
172
173
174
175 if ( access( "./child_overflow", X_OK ) == 0 )
176 execl( "./child_overflow", "./child_overflow",
177 (
quiet ?
"TESTS_QUIET" : NULL ), NULL );
178 else if ( access( "./ctests/child_overflow", X_OK ) == 0 )
179 execl( "./ctests/child_overflow", "./ctests/child_overflow",
180 (
quiet ?
"TESTS_QUIET" : NULL ), NULL );
181
183
184 return 0;
185}
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
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.
static struct timeval start last
static void run(const char *str, int len)
static int Event[MAX_EVENTS]
static int Threshold[MAX_EVENTS]
static void my_handler(int EventSet, void *pc, long long ovec, void *context)
static void do_cycles(int program_time)
static struct timeval start
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_skip(const char *file, int line, const char *call, int retval)