aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/perf_counter/perf.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-05-01 12:39:47 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-05-01 12:39:47 -0400
commita92e70237c8abbd1c3241133bf72f2cd07c90eae (patch)
tree12064586f1dc140e9b0c40af1c9989727bda9860 /Documentation/perf_counter/perf.h
parent6eda5838bc5771578986429cde4a0870e1e5f5e1 (diff)
perfcounter tools: make rdclock an inline function
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'Documentation/perf_counter/perf.h')
-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 391fcc73148..fb142307228 100644
--- a/Documentation/perf_counter/perf.h
+++ b/Documentation/perf_counter/perf.h
@@ -8,13 +8,17 @@
8#define PR_TASK_PERF_COUNTERS_DISABLE 31 8#define PR_TASK_PERF_COUNTERS_DISABLE 31
9#define PR_TASK_PERF_COUNTERS_ENABLE 32 9#define PR_TASK_PERF_COUNTERS_ENABLE 32
10 10
11#define rdclock() \ 11#ifndef NSEC_PER_SEC
12({ \ 12# define NSEC_PER_SEC 1000000000ULL
13 struct timespec ts; \ 13#endif
14 \ 14
15 clock_gettime(CLOCK_MONOTONIC, &ts); \ 15static inline unsigned long long rdclock(void)
16 ts.tv_sec * 1000000000ULL + ts.tv_nsec; \ 16{
17}) 17 struct timespec ts;
18
19 clock_gettime(CLOCK_MONOTONIC, &ts);
20 return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
21}
18 22
19/* 23/*
20 * Pick up some kernel type conventions: 24 * Pick up some kernel type conventions: