From 7c6406ef7bb59ef8ef6ce11046b46204e7841639 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 20 Oct 2018 16:44:01 +0200 Subject: [PATCH] tsc: inline calls to tsc_now() --- include/villas/tsc.h | 10 ++++++++-- lib/tsc.c | 7 ------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/villas/tsc.h b/include/villas/tsc.h index 6b689da5d..e643562f8 100644 --- a/include/villas/tsc.h +++ b/include/villas/tsc.h @@ -88,8 +88,14 @@ static inline uint64_t rdtsc() return tsc; } +__attribute__((unused,always_inline)) +static uint64_t tsc_now(struct tsc *t) +{ + return t->rdtscp_supported + ? rdtscp() + : rdtsc(); +} + int tsc_init(struct tsc *t); uint64_t tsc_rate_to_cycles(struct tsc *t, double rate); - -uint64_t tsc_now(struct tsc *t); diff --git a/lib/tsc.c b/lib/tsc.c index fa40f468a..8cdede979 100644 --- a/lib/tsc.c +++ b/lib/tsc.c @@ -75,10 +75,3 @@ uint64_t tsc_rate_to_cycles(struct tsc *t, double rate) { return t->frequency / rate; } - -uint64_t tsc_now(struct tsc *t) -{ - return t->rdtscp_supported - ? rdtscp() - : rdtsc(); -}