Skip to contentSkip to conversation

fix timestamps on architectures without CONFIG_KTIME_SCALAR

PATCH Mathieu Desnoyers 1 participant 2 messages Sep 6, 2012 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · * Gerlando Falauto ([email protected]) 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

Quoted 27 lines
---
 wrapper/trace-clock.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
wrapper/trace-clock.h +1 -1
index 6ea9e81..bced61c 100644
@@ -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)
Signature · 7 lines
1.7.10.1


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

A message that is not in the archive (sent off-list or not yet received): 20120906142726.GJ3630@Krystal

#3 lore raw
Quoted 9 lines · * Mathieu Desnoyers ([email protected]) wrote:
Quoted 7 lines · * Gerlando Falauto ([email protected]) 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.

Quoted 3 lines

merged!

Will make its way into stable-2.0 too.

I did manage to mess the "From" of the patch in my merge though. I forgot to attribute the commit to you as the author. Sorry about that !

You still appear in the signed-off-by lines though.

Thanks,

Mathieu

Quoted 43 lines

Thanks!

Mathieu

Quoted 27 lines
---
 wrapper/trace-clock.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
wrapper/trace-clock.h +1 -1
index 6ea9e81..bced61c 100644
@@ -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)
Signature · 7 lines
1.7.10.1


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 9 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com