return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
+#ifdef RDTSC_TIMERS
double
DT_Mdep_GetCpuMhz (
void )
return strtod (mhz_str, NULL) / DT_TSC_BASE;
}
+#else /* !RDTSC_TIMERS */
+
+double
+DT_Mdep_GetCpuMhz (
+ void )
+{
+ return 1;
+}
+#endif
unsigned long
#include <string.h>
#include <sys/times.h>
-#ifdef __ia64__
-#include <asm/timex.h>
-#endif
-
/* Default Device Name */
#define DT_MdepDeviceName "ofa-v2-ib0"
/*
* Timing
*/
-
+#ifdef RDTSC_TIMERS
typedef unsigned long long int DT_Mdep_TimeStamp;
static _INLINE_ DT_Mdep_TimeStamp
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
#else
-
#ifdef __ia64__
- unsigned long x;
-
- x = get_cycles ();
- return x;
+ unsigned long ret;
+ __asm__ __volatile__ ("mov %0=ar.itc" : "=r"(ret));
+ return ret;
#else
#if defined(__PPC__) || defined(__PPC64__)
unsigned int tbl, tbu0, tbu1;
#endif
#endif
}
+#else /* !RDTSC_TIMERS */
+/*
+ * Get timestamp, microseconds, (relative to some fixed point)
+ */
+typedef double DT_Mdep_TimeStamp;
+
+static _INLINE_ DT_Mdep_TimeStamp
+DT_Mdep_GetTimeStamp ( void )
+{
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return (tv.tv_sec * 1000000 + tv.tv_usec);
+}
+#endif
+
/*
* Define long format types to be used in *printf format strings. We
" Operation Type : %s\n"
" Number of Operations : %u\n"
" Segment Size : %u\n"
- " Number of Segments : %u bytes\n"
+ " Number of Segments : %u \n"
" Pipeline Length : %u\n\n",
DT_PerformanceModeToString (cmd->mode),
DT_TransferTypeToString (cmd->op.transfer_type),