fix timestamps on architectures without CONFIG_KTIME_SCALAR
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 6 Sep 2012 14:26:38 +0000 (10:26 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 6 Sep 2012 14:26:38 +0000 (10:26 -0400)
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 <gerlando.falauto@keymile.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wrapper/trace-clock.h

index 6ea9e81cb6e44cbb0e172a595cbe33d2f9ae95de..bced61c25aa8dfb1b7ec732e96f20037fa685205 100644 (file)
@@ -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)
This page took 0.029703 seconds and 4 git commands to generate.