perf tests tsc: Add checking helper is_supported()
[linux-2.6-microblaze.git] / tools / perf / tests / perf-time-to-tsc.c
index aee97c1..a9560e0 100644 (file)
@@ -169,3 +169,16 @@ out_err:
        evlist__delete(evlist);
        return err;
 }
+
+bool test__tsc_is_supported(void)
+{
+       /*
+        * Except x86_64/i386 and Arm64, other archs don't support TSC in perf.
+        * Just enable the test for x86_64/i386 and Arm64 archs.
+        */
+#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
+       return true;
+#else
+       return false;
+#endif
+}