]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/perf_local: disable tests on unsupported archs 5342/head
authorKefu Chai <kchai@redhat.com>
Fri, 24 Jul 2015 16:25:37 +0000 (00:25 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 25 Jul 2015 02:10:34 +0000 (10:10 +0800)
* maybe we can have div32 tests on aarch64, but i don't
  think "udiv|sdiv" supports 64bits numerator. probably
  we can use float divde for the benchmark...
* disable cpuid test on non-intel archs.

Fixes: #12453
Reported-by: Tom Deneau <tom.deneau@amd.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/perf_local.cc

index ba3bc0fa086deade6ae1cc8783095726f8266950..2d75351efb010b235a39702a22cd8fe1dee2e56c 100644 (file)
@@ -381,6 +381,7 @@ double cond_ping_pong()
 // probably pick worse values.
 double div32()
 {
+#if defined(__i386__) || defined(__x86_64__)
   int count = 1000000;
   uint64_t start = Cycles::rdtsc();
   // NB: Expect an x86 processor exception is there's overflow.
@@ -397,6 +398,9 @@ double div32()
   }
   uint64_t stop = Cycles::rdtsc();
   return Cycles::to_seconds(stop - start)/count;
+#else
+  return -1;
+#endif
 }
 
 // Measure the cost of a 64-bit divide. Divides don't take a constant
@@ -659,6 +663,7 @@ double perf_prefetch()
 #endif
 }
 
+#if defined(__i386__) || defined(__x86_64__)
 /**
  * This function is used to seralize machine instructions so that no
  * instructions that appear after it in the current thread can run before any
@@ -674,9 +679,11 @@ static inline void serialize() {
         : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
         : "a" (1U));
 }
+#endif
 
 // Measure the cost of cpuid
 double perf_serialize() {
+#if defined(__i386__) || defined(__x86_64__)
   int count = 1000000;
   uint64_t start = Cycles::rdtsc();
   for (int i = 0; i < count; i++) {
@@ -684,6 +691,9 @@ double perf_serialize() {
   }
   uint64_t stop = Cycles::rdtsc();
   return Cycles::to_seconds(stop - start)/count;
+#else
+  return -1;
+#endif
 }
 
 // Measure the cost of an lfence instruction.