Beispiel #1
0
int
main (int argc, char *argv[])
{
  sphtimer_t timer_freg = sphfastcpufreq ();
  sphtimer_t timer_val = sphgettimer ();
  sphtimer_t before, after;
  struct timespec t100ms = { 0, 100000000L };
  struct timespec t1000ms = { 1, 0 };
  double seconds;

  printf ("Time Base Frequency = %lld\nTime Base value = %lld\n\n",
    timer_freg, timer_val);

  /* warm up PLT */
  nanosleep (&t100ms, NULL);

  printf ("nanosleep  100ms - ");
  before = sphgettimer ();
  nanosleep (&t100ms, NULL);
  after = sphgettimer ();

  seconds = (double) (after - before) / (double) timer_freg;
  printf ("delta=%012lld %f sec\n", (after - before), seconds);

  printf ("nanosleep 1000ms - ");
  before = sphgettimer ();
  nanosleep (&t1000ms, NULL);
  after = sphgettimer ();

  seconds = (double) (after - before) / (double) timer_freg;
  printf ("delta=%012lld %f sec\n", (after - before), seconds);

  return 0;
}
Beispiel #2
0
int
timed_basic_test (void)
{
  int rc = 0;

  sphtimer_t timer_freg = sphfastcpufreq ();
  sphtimer_t timer_val = sphgettimer ();
  sphtimer_t before, after;
  double seconds;
  int i, max_cnt;

  max_cnt = 1000000;

  printf ("timed_basic_test Freq=%lld, timer=%lld\n", timer_freg, timer_val);
  before = sphgettimer ();

  for (i = 0; i < max_cnt; i++)
    {
      sphdeGetPID ();
      sphdeGetTID ();
      sphgettimer ();
    }
  after = sphgettimer ();

  seconds = (double) (after - before) / (double) timer_freg;
  printf ("timed_basic_test %d iterations %f seconds\n", max_cnt, seconds);

  return rc;
}
Beispiel #3
0
int
timer_basic_test (void)
{
  int rc = 0;

  sphtimer_t timer_freg = sphfastcpufreq ();
  sphtimer_t timer_val = sphgettimer ();
  sphtimer_t before, after;
  struct timespec t100ms = { 0, 100000000L };
  struct timespec t1000ms = { 1, 0 };
  double seconds;

  printf ("timer_basic_test Freq=%lld, timer=%lld\n", timer_freg, timer_val);
  /* warm up PLT */
  nanosleep (&t100ms, NULL);

  before = sphgettimer ();
  nanosleep (&t100ms, NULL);
  after = sphgettimer ();

  seconds = (double) (after - before) / (double) timer_freg;
  if ((seconds < 0.1) && (seconds > 0.2))
    {
      printf ("100ms delta=%lld %f sec\n", (after - before), seconds);
      rc++;
    }

  before = sphgettimer ();
  nanosleep (&t1000ms, NULL);
  after = sphgettimer ();

  seconds = (double) (after - before) / (double) timer_freg;
  if ((seconds < 1.0) && (seconds > 1.2))
    {
      printf ("1000ms delta=%lld %f sec\n", (after - before), seconds);
      rc++;
    }

  return rc;
}
Beispiel #4
0
int
test_unitfast (block_size_t aSize)
{
  int rtn = 0;
  int i, rc;
  SPHSinglePCQueue_t pcqueue;
  block_size_t cap, units;
#ifdef SPH_TIMERTEST_VERIFY
  int j, k;
  sphtimer_t	tempt, startt, endt, freqt;
  double clock, nano, rate;
  long int p10;
#endif

  pcqueue = SPHSinglePCQueueCreateWithStride (4096, aSize);
  if ((pcqueue != NULL))
    {
      printf ("\nSPHSinglePCQueueCreateWithStride (%d, %zu) success \n", 4096,
	      aSize);

      cap = SPHSinglePCQueueFreeSpace (pcqueue);

      units = cap / aSize;

      printf ("SPHSinglePCQueueFreeSpace() = %zu units=%zu\n", cap, units);

      for (i = 0; i < units; i++)
	{
	  rc = lfPCQentry_fasttest (pcqueue, i, 0x12345678, 0xdeadbeef);
	  if (!rc)
	    {
	    }
	  else
	    {
	      printf ("SPHSinglePCQueueAllocStrideEntry (%p) failed\n",
		      pcqueue);
	      rtn++;
	      break;
	    }
	}

      printf ("SPHSinglePCQueueFreeSpace() = %zu\n",
	      SPHSinglePCQueueFreeSpace (pcqueue));

      /* in its current state the queue is not empty and is full */
      if (SPHSinglePCQueueEmpty (pcqueue))
	{
	  printf ("test_unitfast SPHSinglePCQueueEmpty(%p) failed\n",
		  pcqueue);
	  rtn++;
	}
      else
	{
	}
      if (SPHSinglePCQueueFull (pcqueue))
	{
	}
      else
	{
	  printf ("test_unitfast SPHSinglePCQueueFull(%p) failed\n", pcqueue);
	  rtn++;
	}

      for (i = 0; i < units; i++)
	{
	  rc = lfPCQentry_fastverify (pcqueue, i, 0x12345678, 0xdeadbeef);
	  if (!rc)
	    {
	    }
	  else
	    {
	      printf ("SPHSinglePCQueueGetNextComplete (%p) failed\n",
		      pcqueue);
	      rtn++;
	      break;
	    }
	}

      /* in its current state the queue is not full and is empty */
      if (SPHSinglePCQueueEmpty (pcqueue))
	{
	}
      else
	{
	  printf ("test_unitfast SPHSinglePCQueueEmpty(%p) failed\n",
		  pcqueue);
	  rtn++;
	}
      if (SPHSinglePCQueueFull (pcqueue))
	{
	  printf ("test_unitfast SPHSinglePCQueueFull(%p) failed\n", pcqueue);
	  rtn++;
	}

      printf ("test_unitfast() verify PCQueue complete\n\n");

#ifdef SPH_TIMERTEST_VERIFY
      j = 0;
      k = 0;
      p10 = 10000000;

      startt = sphgettimer ();
      for (i = 0; i < units; i++)
	{
	  rc = lfPCQentry_fasttest (pcqueue, k, 0x12345678, 0xdeadbeef);
	  if (!rc)
	    {
	    }
	  else
	    {
	      printf
		("test_unitfast() SPHSinglePCQueueAllocStrideEntry (%p) failed\n",
		 pcqueue);
	      rtn++;
	      break;
	    }
	  k++;
	}

      /* in its current state the queue is not empty and is full */
      if (SPHSinglePCQueueEmpty (pcqueue))
	{
	  printf ("test_unitfast SPHSinglePCQueueEmpty(%p) failed\n",
		  pcqueue);
	  rtn++;
	}
      else
	{
	}
      if (SPHSinglePCQueueFull (pcqueue))
	{
	}
      else
	{
	  printf ("test_unitfast SPHSinglePCQueueFull(%p) failed\n", pcqueue);
	  rtn++;
	}

      for (i = 0; i < p10; i++)
	{
	  rc = lfPCQentry_fastverify (pcqueue, j, 0x12345678, 0xdeadbeef);
	  if (!rc)
	    {
	    }
	  else
	    {
	      printf
		("test_unitfast() SPHSinglePCQueueGetNextComplete (%p) failed\n",
		 pcqueue);
	      rtn++;
	      break;
	    }
	  j++;

	  rc = lfPCQentry_fasttest (pcqueue, k, 0x12345678, 0xdeadbeef);
	  if (!rc)
	    {
	    }
	  else
	    {
	      printf
		("test_unitfast() SPHSinglePCQueueAllocStrideEntry (%p) failed\n",
		 pcqueue);
	      rtn++;
	      break;
	    }
	  k++;
	}

      for (i = 0; i < units; i++)
	{
	  rc = lfPCQentry_fastverify (pcqueue, j, 0x12345678, 0xdeadbeef);
	  if (!rc)
	    {
	    }
	  else
	    {
	      printf
		("test_unitfast() SPHSinglePCQueueGetNextComplete (%p) failed\n",
		 pcqueue);
	      rtn++;
	      break;
	    }
	  j++;
	}

      /* in its current state the queue is not full and is empty */
      if (SPHSinglePCQueueEmpty (pcqueue))
	{
	}
      else
	{
	  printf ("test_unitfast SPHSinglePCQueueEmpty(%p) failed\n",
		  pcqueue);
	  rtn++;
	}
      if (SPHSinglePCQueueFull (pcqueue))
	{
	  printf ("test_unitfast SPHSinglePCQueueFull(%p) failed\n", pcqueue);
	  rtn++;
	}

      endt = sphgettimer ();
      tempt = endt - startt;
      clock = tempt;
      freqt = sphfastcpufreq ();
      nano = (clock * 1000000000.0) / (double) freqt;
      nano = nano / p10;
      rate = p10 / (clock / (double) freqt);

      printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
	      startt, endt, tempt, freqt);

      printf ("test_unitfast X %ld ave= %6.2fns rate=%10.1f/s\n",
	      p10, nano, rate);

      printf ("test_unitfast() timed PCQueue complete\n\n");
#endif /* SPH_TIMERTEST_VERIFY */

      printf ("\nSPHSinglePCQueueDestroy (%p) \n", pcqueue);
      SPHSinglePCQueueDestroy (pcqueue);
    }
  else
    {
      printf ("SPHSinglePCQueueCreateWithStride (%d, %zu) failed \n", 4096,
	      aSize);
      rtn++;
    }

  return rtn;
}
Beispiel #5
0
int
test_unit (void)
{
	SPHLFLogger_t logger;
	SPHLFLoggerHandle_t *handle, handle0;
	sphtimer_t	tempt, startt, endt, freqt;
	unsigned int i, tempn_i, temp0_i, temp1_i, temp2_i;
	int rc, rtn = 0;
	int	*tarray;
	double clock, nano, rate;
	block_size_t cap, units, p10, log_alloc;
	SPHLFLoggerHandle_t *handlex, handle4, handle5;
	sphtimer_t entry_timestamp, prev_timestamp;
	SPHLFLogIterator_t *iter, iter0;
		
	log_alloc = SegmentSize;
	
	logger = SPHLFLoggerCreate (log_alloc);
	if ( logger )
	{
		printf("\nSPHLFLoggerCreate (%zu) success \n", log_alloc);

		cap = SPHLFLoggerFreeSpace( logger );
			
		units = cap / 128;
			
		printf("SPHLFLoggerFreeSpace() = %zu units=%zu\n",
			cap, units);

		for ( i = 0; i < units; i++ )
		{
			rc = lflogentry_test (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n", 
					logger);
				break;
			}
		}
#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			SPHLFLoggerFreeSpace( logger ));

		printf("\ntest_unit() verify log contents\n");
		iter = SPHLFLoggerCreateIterator(logger, &iter0);
		if (iter)
		{
			printf("  SPHLFLoggerCreateIterator(%p,%p) = %p succeeded\n",
				   logger, &iter0, iter);
		} else {
			printf("  SPHLFLoggerCreateIterator(%p,%p) = %p failed\n",
				   logger, &iter0, iter);
			return (rtn + 10);
		}

		handlex = SPHLFLoggerIteratorNext (iter, &handle4);
		printf("   SPHLFLoggerIteratorNext() [%p,%lx,%lx,%lx,%lx]\n",
			   iter->logger, iter->current, iter->free, iter->start_log, iter->end_log);
		if (handlex)
		{
			printf("  SPHLFLoggerIteratorNext(%p,%p) = %p succeeded\n",
				   logger, &handle4, handlex);
			printf("   @%p->id=%x\n",
				   handlex->entry, handlex->entry->entryID.idUnit);
			
			entry_timestamp = SPHLFLogEntryTimeStamp (handlex);
			temp0_i = SPHLFlogEntryGetNextInt(handlex);
			temp1_i = SPHLFlogEntryGetNextInt(handlex);
			temp2_i = SPHLFlogEntryGetNextInt(handlex);
			if ((temp0_i != 0)
			  ||  (temp1_i != 0x12345678)
			  ||  (temp2_i != 0xdeadbeef))
			{
				printf("  SPHLFLoggerIteratorNext() data mismatch found %d,%x,%x\n",
					   temp0_i, temp1_i, temp2_i);
				rtn++;
			}
		} else {
			printf("  SPHLFLoggerIteratorNext(%p,%p) = %p failed\n",
				   logger, &handle4, handlex);
			return (rtn + 10);
		}
		
		while (handlex)
		{
			tempn_i = temp0_i;
			prev_timestamp = entry_timestamp;
			handlex = SPHLFLoggerIteratorNext (iter, &handle5);
			if (handlex)
			{
				temp0_i = SPHLFlogEntryGetNextInt(handlex);
				temp1_i = SPHLFlogEntryGetNextInt(handlex);
				temp2_i = SPHLFlogEntryGetNextInt(handlex);
				entry_timestamp = SPHLFLogEntryTimeStamp (handlex);
				if ((temp0_i != (tempn_i+1))
				 ||  (temp1_i != 0x12345678)
				 ||  (temp2_i != 0xdeadbeef)
				 ||  (entry_timestamp < prev_timestamp))
				{
					printf("  SPHLFLoggerIteratorNext() data mismatch found %d,%x,%x, %llu,%llu\n",
						   temp0_i, temp1_i, temp2_i,
						   prev_timestamp, entry_timestamp);
					rtn++;
				}
			}
		}
		
		printf("test_unit() verify log complete\n\n");
#endif /* SPH_TIMERTEST_VERIFY */
		SPHLFLoggerResetAsync (logger);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		p10 = 10000000;
		while (p10 > units)
			p10 = p10 / 10;
			
		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_test (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n", 
					logger);
				break;
			}
		}
			
		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = p10 / (clock / (double)freqt);
			
		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);

		printf ("lflogentry_test X %zu ave= %6.2fns rate=%10.1f/s\n",
			p10, nano, rate);


#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		SPHLFLoggerResetAsync (logger);


#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */
					
		p10 = 10000000;
		while (p10 > units)
			p10 = p10 / 10;
			
		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_fasttest (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n", 
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = p10 / (clock / (double)freqt);

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);
			
		printf ("lflogentry_fasttest X %zu ave= %6.2fns rate=%10.1f/s\n",
			p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		SPHLFLoggerResetAsync (logger);
		SPHLFLoggerSetCachePrefetch(logger, 1);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		p10 = 10000000;
		while (p10 > units)
			p10 = p10 / 10;

		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_fasttest (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n",
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = p10 / (clock / (double)freqt);

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);

		printf ("lflogentry_fasttest prefetch0 X %zu ave= %6.2fns rate=%10.1f/s\n",
			p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		SPHLFLoggerResetAsync (logger);
		SPHLFLoggerSetCachePrefetch(logger, 2);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		p10 = 10000000;
		while (p10 > units)
			p10 = p10 / 10;

		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_fasttest (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n",
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = p10 / (clock / (double)freqt);

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);

		printf ("lflogentry_fasttest prefetch1 X %zu ave= %6.2fns rate=%10.1f/s\n",
			p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		SPHLFLoggerResetAsync (logger);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		p10 = 10000000;
		while (p10 > units)
			p10 = p10 / 10;

		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_fastteststrong (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n",
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = p10 / (clock / (double)freqt);

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);

		printf ("lflogentry_fastteststrong X %zu ave= %6.2fns rate=%10.1f/s\n",
			p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		SPHLFLoggerResetAsync (logger);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		p10 = 10000000;
		while (p10 > units)
			p10 = p10 / 10;

		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_fasttestweak (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n",
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = p10 / (clock / (double)freqt);

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);

		printf ("lflogentry_fasttestweak X %zu ave= %6.2fns rate=%10.1f/s\n",
			p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		SPHLFLoggerResetAsync (logger);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		p10 = 10000000;
		while (p10 > units)
			p10 = p10 / 10;

		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_fasttestnolockweak (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocTimeStamped (%p) failed\n",
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = p10 / (clock / (double)freqt);

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);

		printf ("lflogentry_fasttestnolockweak X %zu ave= %6.2fns rate=%10.1f/s\n",
			p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		printf("\nSPHLFLoggerDestroy (%p) \n", logger);
		SPHLFLoggerDestroy( logger );
	} else
		printf("SPHLFLoggerCreate (%zu) failed \n", log_alloc);

	logger = SPHLFCircularLoggerCreate (log_alloc, 128);
	if ( logger )
	{
		printf("\nSPHLFCirgularLoggerCreate (%zu) success \n", log_alloc);

		rc += SPHLFLoggerPrefetch(logger);
		
		cap = SPHLFLoggerFreeSpace( logger );
		units = cap / 128;
		
		printf("SPHLFLoggerFreeSpace() = %zu, units=%zu\n",
		       cap, units);

		for ( i = 0; i < units; i++ )
		{
			handle = SPHLFLoggerAllocStrideTimeStamped (logger,
								0, 0,
								&handle0);
			if ( handle )
			{
			} else {
				printf("SPHLFLoggerAllocStrideTimeStamped (%p) failed\n", 
					logger);
			}
		}

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */
					
		p10 = 100000000;

		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_stridetest (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocStrideTimeStamped (%p) failed\n", 
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = 1000000000.0 / nano;

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);
		printf ("lflogentry_stridetest X %zu ave= %6.2fns rate=%10.1f/s\n",
				p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("\ntest_unit() verify log contents\n");
		iter = SPHLFLoggerCreateIterator(logger, &iter0);
		if (iter)
		{
			printf("  SPHLFLoggerCreateIterator(%p,%p) = %p succeeded\n",
				   logger, &iter0, iter);
		} else {
			printf("  SPHLFLoggerCreateIterator(%p,%p) = %p failed\n",
				   logger, &iter0, iter);
			return (rtn + 10);
		}

		handlex = SPHLFLoggerIteratorNext (iter, &handle4);
		printf("   SPHLFLoggerIteratorNext() [%p,%lx,%lx,%lx,%lx]\n",
			   iter->logger, iter->current, iter->free, iter->start_log, iter->end_log);
		if (handlex)
		{
			printf("  SPHLFLoggerIteratorNext(%p,%p) = %p succeeded\n",
				   logger, &handle4, handlex);
			printf("   @%p->id=%x\n",
				   handlex->entry, handlex->entry->entryID.idUnit);
			
			entry_timestamp = SPHLFLogEntryTimeStamp (handlex);
			tarray = (int*)SPHLFLogEntryGetFreePtr(handlex);
			temp0_i = tarray[0];
			temp1_i = tarray[1];
			temp2_i = tarray[2];
			if ((temp1_i != 0x12345678)
			  ||  (temp2_i != 0xdeadbeef))
			{
				printf("  SPHLFLoggerIteratorNext() data mismatch found %d,%x,%x\n",
					   temp0_i, temp1_i, temp2_i);
				rtn++;
			}
		} else {
			printf("  SPHLFLoggerIteratorNext(%p,%p) = %p failed\n",
				   logger, &handle4, handlex);
			return (rtn + 10);
		}
		
		while (handlex)
		{
			tempn_i = temp0_i;
			prev_timestamp = entry_timestamp;
			handlex = SPHLFLoggerIteratorNext (iter, &handle5);
			if (handlex)
			{
				temp0_i = SPHLFlogEntryGetNextInt(handlex);
				temp1_i = SPHLFlogEntryGetNextInt(handlex);
				temp2_i = SPHLFlogEntryGetNextInt(handlex);
				entry_timestamp = SPHLFLogEntryTimeStamp (handlex);
				if ((temp0_i != (tempn_i+1))
				 ||  (temp1_i != 0x12345678)
				 ||  (temp2_i != 0xdeadbeef)
				 ||  (entry_timestamp < prev_timestamp))
				{
					printf("  SPHLFLoggerIteratorNext() data mismatch found %d,%x,%x, %llu,%llu\n",
						   temp0_i, temp1_i, temp2_i,
						   prev_timestamp, entry_timestamp);
					rtn++;
				}
			}
		}
		
		printf("test_unit() verify log complete\n\n");
			
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		SPHLFLoggerResetAsync (logger);

#ifdef SPH_TIMERTEST_VERIFY
		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */

		p10 = 100000000;

		startt = sphgettimer();
		for ( i = 0; i < p10; i++ )
		{
			rc = lflogentry_stridetestnolock (logger, i, 0x12345678, 0xdeadbeef);
			if ( !rc )
			{
			} else {
				printf("SPHLFLoggerAllocStrideTimeStampedNoLock (%p) failed\n",
					logger);
				break;
			}
		}

		endt = sphgettimer();
		tempt = endt -startt;
		clock = tempt;
		freqt = sphfastcpufreq();
		nano = (clock * 1000000000.0) / (double)freqt;
		nano = nano / p10;
		rate = 1000000000.0 / nano;

		printf ("\nstartt=%lld, endt=%lld, deltat=%lld, freqt=%lld\n",
			startt, endt, tempt, freqt);
		printf ("lflogentry_stridetestnolock X %zu ave= %6.2fns rate=%10.1f/s\n",
				p10, nano, rate);

#ifdef SPH_TIMERTEST_VERIFY
		printf("\ntest_unit() verify log contents\n");
		iter = SPHLFLoggerCreateIterator(logger, &iter0);
		if (iter)
		{
			printf("  SPHLFLoggerCreateIterator(%p,%p) = %p succeeded\n",
				   logger, &iter0, iter);
		} else {
			printf("  SPHLFLoggerCreateIterator(%p,%p) = %p failed\n",
				   logger, &iter0, iter);
			return (rtn + 10);
		}

		handlex = SPHLFLoggerIteratorNext (iter, &handle4);
		printf("   SPHLFLoggerIteratorNext() [%p,%lx,%lx,%lx,%lx]\n",
			   iter->logger, iter->current, iter->free, iter->start_log, iter->end_log);
		if (handlex)
		{
			printf("  SPHLFLoggerIteratorNext(%p,%p) = %p succeeded\n",
				   logger, &handle4, handlex);
			printf("   @%p->id=%x\n",
				   handlex->entry, handlex->entry->entryID.idUnit);

			entry_timestamp = SPHLFLogEntryTimeStamp (handlex);
			tarray = (int*)SPHLFLogEntryGetFreePtr(handlex);
			temp0_i = tarray[0];
			temp1_i = tarray[1];
			temp2_i = tarray[2];
			if ((temp1_i != 0x12345678)
			  ||  (temp2_i != 0xdeadbeef))
			{
				printf("  SPHLFLoggerIteratorNext() data mismatch found %d,%x,%x\n",
					   temp0_i, temp1_i, temp2_i);
				rtn++;
			}
		} else {
			printf("  SPHLFLoggerIteratorNext(%p,%p) = %p failed\n",
				   logger, &handle4, handlex);
			return (rtn + 10);
		}

		while (handlex)
		{
			tempn_i = temp0_i;
			prev_timestamp = entry_timestamp;
			handlex = SPHLFLoggerIteratorNext (iter, &handle5);
			if (handlex)
			{
				temp0_i = SPHLFlogEntryGetNextInt(handlex);
				temp1_i = SPHLFlogEntryGetNextInt(handlex);
				temp2_i = SPHLFlogEntryGetNextInt(handlex);
				entry_timestamp = SPHLFLogEntryTimeStamp (handlex);
				if ((temp0_i != (tempn_i+1))
				 ||  (temp1_i != 0x12345678)
				 ||  (temp2_i != 0xdeadbeef)
				 ||  (entry_timestamp < prev_timestamp))
				{
					printf("  SPHLFLoggerIteratorNext() data mismatch found %d,%x,%x, %llu,%llu\n",
						   temp0_i, temp1_i, temp2_i,
						   prev_timestamp, entry_timestamp);
					rtn++;
				}
			}
		}

		printf("test_unit() verify log complete\n\n");

		printf("SPHLFLoggerFreeSpace() = %zu\n",
			   SPHLFLoggerFreeSpace( logger ));
#endif /* SPH_TIMERTEST_VERIFY */


		printf("\nSPHLFLoggerDestroy (%p) \n", logger);
		SPHLFLoggerDestroy( logger );
	} else
		printf("SPHLFLoggerCreate (%zu) failed \n", log_alloc);

	return rtn;
}