31static const char *
name =
"unknown";
50 gettimeofday( &
start, NULL );
65 static int last_count = -1;
67 double st_secs, last_secs;
69 gettimeofday( &now, NULL );
74 if ( last_secs <= 0.001 )
78 printf(
"[%d] %s, time = %.3f, total = %ld, last = %ld, rate = %.1f/sec\n",
80 ( (
double )
count ) / last_secs );
83 if ( last_count != -1 ) {
84 if (
count < .1 * last_count ) {
100 gettimeofday( &
start, NULL );
104 for (
x = 1.0;
x < 250000.0;
x += 1.0 )
107 printf(
"==>> SUM IS NEGATIVE !! <<==\n" );
109 gettimeofday( &now, NULL );
123 test_fail(
name, __LINE__,
"PAPI_create_eventset failed", 1 );
127 if (!
TESTS_QUIET) printf(
"Trouble adding event\n");
144run(
const char *str,
int len )
148 for ( n = 1; n <= len; n++ ) {
184 if ( access(
"./burn", X_OK ) == 0 )
185 (
quiet ? system(
"./burn TESTS_QUIET" ) : system(
"./burn" ) );
186 else if ( access(
"./ctests/burn", X_OK ) == 0 )
187 (
quiet ? system(
"./ctests/burn TESTS_QUIET" ) :
188 system(
"./ctests/burn" ) );
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.
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
static struct timeval start
Return codes and api definitions.
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)
static void print_rate(const char *str)
static struct timeval start last
static void my_papi_start(void)
static void run(const char *str, int len)
static int Event[MAX_EVENTS]
static int Threshold[MAX_EVENTS]
static void do_cycles(int program_time)
static void print_here(const char *str)
static void my_handler(int EventSet, void *pc, long long ovec, void *context)
static void zero_count(void)