From 9df1172100ceb5d65d93531399a6e15d16a73fa6 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 7 Feb 2011 13:17:47 -0500 Subject: [PATCH] ust: #ifdef CLOCK_TRACE and CLOCK_TRACE_FREQ for powerpc builds CLOCK_TRACE and CLOCK_TRACE_FREQ are introduced for x86 and x86-64 but are used in non #ifdef'd code sections. This patch does not attempt to extend support to powerpc for those clocks, but instead fixes compiliation errors and makes powerpc use CLOCK_MONOTONIC as the fallback. Compile tested only. Signed-off-by: Bruce Ashfield --- include/ust/clock.h | 2 ++ libust/tracectl.c | 4 ++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/ust/clock.h b/include/ust/clock.h index 04785fc..306cd7c 100644 --- a/include/ust/clock.h +++ b/include/ust/clock.h @@ -108,10 +108,12 @@ static __inline__ u64 trace_clock_frequency(void) struct timespec ts; union lttng_timespec *lts = (union lttng_timespec *) &ts; +#if __i386__ || __x86_64__ if (likely(ust_clock_source == CLOCK_TRACE)) { clock_gettime(CLOCK_TRACE_FREQ, &ts); return lts->lttng_ts; } +#endif return 1000000000LL; } diff --git a/libust/tracectl.c b/libust/tracectl.c index e877e62..2e39bdb 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -1269,11 +1269,15 @@ static void __attribute__((constructor)) init() /* Get clock the clock source type */ /* Default clock source */ +#if __i386__ || __x86_64__ ust_clock_source = CLOCK_TRACE; if (clock_gettime(ust_clock_source, &ts) != 0) { ust_clock_source = CLOCK_MONOTONIC; DBG("UST traces will not be synchronized with LTTng traces"); } +#else + ust_clock_source = CLOCK_MONOTONIC; +#endif autoprobe_val = getenv("UST_AUTOPROBE"); if (autoprobe_val) { -- 1.7.0.4