perfcounter tools: make rdclock an inline function
authorThomas Gleixner <tglx@linutronix.de>
Fri, 1 May 2009 16:39:47 +0000 (18:39 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 1 May 2009 16:39:47 +0000 (18:39 +0200)
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Documentation/perf_counter/perf.h

index 391fcc73148afb4c8325445a64af148e4531ef7f..fb1423072286e9d563f69e4a0bce434201ac7c53 100644 (file)
@@ -8,13 +8,17 @@
 #define PR_TASK_PERF_COUNTERS_DISABLE   31
 #define PR_TASK_PERF_COUNTERS_ENABLE    32
 
-#define rdclock()                                      \
-({                                                     \
-       struct timespec ts;                             \
-                                                       \
-       clock_gettime(CLOCK_MONOTONIC, &ts);            \
-       ts.tv_sec * 1000000000ULL + ts.tv_nsec;         \
-})
+#ifndef NSEC_PER_SEC
+# define NSEC_PER_SEC                  1000000000ULL
+#endif
+
+static inline unsigned long long rdclock(void)
+{
+       struct timespec ts;
+
+       clock_gettime(CLOCK_MONOTONIC, &ts);
+       return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
+}
 
 /*
  * Pick up some kernel type conventions: