54 static int last_count = -1;
56 double st_secs, last_secs;
63 if ( last_secs <= 0.001 )
67 printf(
"[%d] %s, time = %.3f, total = %ld, last = %ld, rate = %.1f/sec\n",
69 ( (
double )
count ) / last_secs );
72 if ( last_count != -1 ) {
73 if (
count < .1 * last_count ) {
74 test_fail( __FILE__, __LINE__,
"Interrupt rate changed!", 1 );
78 last_count = ( int )
count;
84 run(
const char *str,
int len )
88 for ( n = 1; n <= len; n++ ) {
95 main(
int argc,
char **argv )
100 const char *
name =
"unknown";
124 printf(
"[%d] %s, num_events = %d\n", getpid(),
130 test_fail(
name, __LINE__,
"PAPI_create_eventset failed", 1 );
136 if (!
quiet) printf(
"Trouble adding event.\n");
159 printf(
"[%d] %s, %s\n", getpid(),
name,
"stop");
168 printf(
"[%d] %s, %s\n", getpid(),
name,
"end");
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
int PAPI_add_event(int EventSet, int EventCode)
static void run(const char *str, int len)
int main(int argc, char **argv)
int PAPI_overflow(int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
static struct timeval start
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_library_init(int version)
static void print_rate(const char *str)
static void my_handler(int EventSet, void *pc, long long ovec, void *context)
static int Event[MAX_EVENTS]
int PAPI_create_eventset(int *EventSet)
static void do_cycles(int program_time)
int gettimeofday(void *ptr1, void *ptr2)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
static int Threshold[MAX_EVENTS]
int PAPI_start(int EventSet)
static struct timeval start last