提交 a92e7023 编写于 作者: T Thomas Gleixner

perfcounter tools: make rdclock an inline function

Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 6eda5838
...@@ -8,13 +8,17 @@ ...@@ -8,13 +8,17 @@
#define PR_TASK_PERF_COUNTERS_DISABLE 31 #define PR_TASK_PERF_COUNTERS_DISABLE 31
#define PR_TASK_PERF_COUNTERS_ENABLE 32 #define PR_TASK_PERF_COUNTERS_ENABLE 32
#define rdclock() \ #ifndef NSEC_PER_SEC
({ \ # define NSEC_PER_SEC 1000000000ULL
struct timespec ts; \ #endif
\
clock_gettime(CLOCK_MONOTONIC, &ts); \ static inline unsigned long long rdclock(void)
ts.tv_sec * 1000000000ULL + ts.tv_nsec; \ {
}) struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}
/* /*
* Pick up some kernel type conventions: * Pick up some kernel type conventions:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册