summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-05-01 18:39:47 +0200
committerThomas Gleixner <tglx@linutronix.de>2009-05-01 18:39:47 +0200
commita92e70237c8abbd1c3241133bf72f2cd07c90eae (patch)
tree12064586f1dc140e9b0c40af1c9989727bda9860
parent6eda5838bc5771578986429cde4a0870e1e5f5e1 (diff)
downloadlwn-a92e70237c8abbd1c3241133bf72f2cd07c90eae.tar.gz
lwn-a92e70237c8abbd1c3241133bf72f2cd07c90eae.zip
perfcounter tools: make rdclock an inline function
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--Documentation/perf_counter/perf.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/Documentation/perf_counter/perf.h b/Documentation/perf_counter/perf.h
index 391fcc73148a..fb1423072286 100644
--- a/Documentation/perf_counter/perf.h
+++ b/Documentation/perf_counter/perf.h
@@ -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: