From: Mathieu Desnoyers Date: Thu, 6 Sep 2012 14:26:38 +0000 (-0400) Subject: fix timestamps on architectures without CONFIG_KTIME_SCALAR X-Git-Tag: v2.1.0-rc1~1 X-Git-Url: http://git.lttng.org/?p=lttng-modules.git;a=commitdiff_plain;h=cfaf9f3d3f9884557cd87f900bc5a0b353917b2b fix timestamps on architectures without CONFIG_KTIME_SCALAR trace_clock_monotonic_wrapper() should return a u64 representing the number of nanoseconds since system startup. ktime_get() provides that value directly within its .tv64 field only on those architectures defining CONFIG_KTIME_SCALAR, whereas in all other cases (e.g. PowerPC) a ktime_to_ns() conversion (which translates back to .tv64 when CONFIG_KTIME_SCALAR is defined) becomes necessary. Signed-off-by: Gerlando Falauto Signed-off-by: Mathieu Desnoyers --- diff --git a/wrapper/trace-clock.h b/wrapper/trace-clock.h index 6ea9e81c..bced61c2 100644 --- a/wrapper/trace-clock.h +++ b/wrapper/trace-clock.h @@ -46,7 +46,7 @@ static inline u64 trace_clock_monotonic_wrapper(void) return (u64) -EIO; ktime = ktime_get(); - return (u64) ktime.tv64; + return ktime_to_ns(ktime); } static inline u32 trace_clock_read32(void)