summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-02-05 22:34:51 +0100
committerAndrea Canciani <ranma42@gmail.com>2010-03-31 16:13:05 +0200
commita81d347c2484e60ceec1d9dc81e1b88724496eaf (patch)
tree6d18bf7dad1e1ec978eadc825a5f4f17dd965a1d /perf
parent55ce0b774869e9fa614c6f9fec7905f7205cb5ff (diff)
perf: Fix timestamp computation on MacOS X
The OIL routines don't work as expected on MacOS X. The operating system gives access to the timestamp counter through the function mach_absolute_time. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'perf')
-rw-r--r--perf/cairo-perf-posix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/perf/cairo-perf-posix.c b/perf/cairo-perf-posix.c
index 68b78d01..50a415de 100644
--- a/perf/cairo-perf-posix.c
+++ b/perf/cairo-perf-posix.c
@@ -132,6 +132,13 @@ oil_profile_stamp_s390(void)
#endif
#endif
+#if defined(__APPLE__)
+#include <mach/mach_time.h>
+#undef OIL_STAMP
+#define OIL_STAMP mach_absolute_time
+#endif
+
+
typedef struct _cairo_perf_timer {
#if defined(CLOCK)
struct timespec tv_start;