32 static const char *
name =
"unknown";
66 static int last_count = -1;
68 double st_secs, last_secs;
75 if ( last_secs <= 0.001 )
79 printf(
"[%d] %s, time = %.3f, total = %ld, last = %ld, rate = %.1f/sec\n",
81 ( (
double )
count ) / last_secs );
84 if ( last_count != -1 ) {
85 if (
count < .1 * last_count ) {
90 last_count = ( int )
count;
105 for (
x = 1.0;
x < 250000.0;
x += 1.0 )
108 printf(
"==>> SUM IS NEGATIVE !! <<==\n" );
124 test_fail(
name, __LINE__,
"PAPI_create_eventset failed", 1 );
128 if (!
TESTS_QUIET) printf(
"Trouble adding event\n");
145 run(
const char *str,
int len )
149 for ( n = 1; n <= len; n++ ) {
186 if ( access(
"./child_overflow", X_OK ) == 0 ) {
187 if (
quiet) result=
system(
"./child_overflow TESTS_QUIET" );
188 else result=
system(
"./child_overflow" );
190 else if ( access(
"./ctests/child_overflow", X_OK ) == 0 ) {
191 if (
quiet) result=
system(
"./ctests/child_overflow TESTS_QUIET" );
192 else result=
system(
"./ctests/child_overflow" );
196 test_fail(__FILE__,__LINE__,
"system failed\n",1);
199 if (!
quiet) printf(
"Successfully returned from system\n");
int PAPI_add_event(int EventSet, int EventCode)
static void my_papi_start(void)
static int Threshold[MAX_EVENTS]
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)
static void print_rate(const char *str)
int PAPI_library_init(int version)
static void do_cycles(int program_time)
static int Event[MAX_EVENTS]
static void my_handler(int EventSet, void *pc, long long ovec, void *context)
int PAPI_create_eventset(int *EventSet)
static void zero_count(void)
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)
int main(int argc, char **argv)
static void print_here(const char *str)
static struct timeval start last
int PAPI_start(int EventSet)
static void run(const char *str, int len)
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]