[lttng-dev] [PATCH] fix timestamps on architectures without CONFIG_KTIME_SCALAR

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu Sep 6 10:27:27 EDT 2012


* Gerlando Falauto (gerlando.falauto at keymile.com) wrote:
> 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.

merged!

Will make its way into stable-2.0 too.

Thanks!

Mathieu

> 
> Signed-off-by: Gerlando Falauto <gerlando.falauto at keymile.com>
> ---
>  wrapper/trace-clock.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/wrapper/trace-clock.h b/wrapper/trace-clock.h
> index 6ea9e81..bced61c 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)
> -- 
> 1.7.10.1
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list