void *pthread_main(void *arg)
{
#if 0
   struct vperfctr *ptr = vperfctr_open();
   long long *lcyca;
   int i, iters = atoi(getenv("ITERS"));
   lcyca = (long long *) malloc(sizeof(long long) * iters);

   for (i = 0; i < iters; i++) {
      lcyca[i] = vperfctr_read_tsc(ptr);
   }

   for (i = 1; i < iters; i++)
      if (lcyca[i] - lcyca[i - 1] < 0)
         abort();
#endif
#if 0
   long long *lcyca;
   int i, iters = atoi(getenv("ITERS"));
   lcyca = (long long *) malloc(sizeof(long long) * iters);

   for (i = 0; i < iters; i++) {
      lcyca[i] = gethrvtime();
   }

   for (i = 1; i < iters; i++)
      if (lcyca[i] - lcyca[i - 1] < 0)
         abort();
#endif
   clockcore();
   return (NULL);
}
示例#2
0
void *
pthread_main( void *arg )
{
	( void ) arg;
	int retval = PAPI_register_thread(  );
	if ( retval != PAPI_OK ) {
	   test_fail( __FILE__, __LINE__, "PAPI_register_thread", retval );
	}

	clockcore(  );

	retval = PAPI_unregister_thread(  );
	if ( retval != PAPI_OK ) {
	   test_fail( __FILE__, __LINE__, "PAPI_unregister_thread", retval );
	}
	return NULL;
}