Re: LTTng on ARM - timestamps

Mathieu Desnoyers <[email protected]> Sat, 28 Jul 2007 13:20:56 -0400
Newsgroups gmane.linux.kernel.tracing
Message-ID <20070728172056.GA7068@Krystal>
Hi Richard,

You will also need the following patch:

LTTng clock heartbeat use ltt clock

LTT heartbeat should use the get timestamp32 instead of get_cycles().

Signed-off-by: Mathieu Desnoyers <[email protected]>
---
 ltt/ltt-heartbeat.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6-lttng/ltt/ltt-heartbeat.c
===================================================================
--- linux-2.6-lttng.orig/ltt/ltt-heartbeat.c	2007-07-28 13:16:46.000000000 -0400
+++ linux-2.6-lttng/ltt/ltt-heartbeat.c	2007-07-28 13:17:52.000000000 -0400
@@ -75,7 +75,7 @@ static void ltt_heartbeat_update_synthet
 
 	preempt_disable();
 	cpu_synth = &synthetic_tsc[smp_processor_id()];
-	tsc = (u32)get_cycles();	/* We deal with a 32 LSB TSC */
+	tsc = ltt_get_timestamp32();	/* We deal with a 32 LSB TSC */
 
 	if (tsc < cpu_synth->tsc[cpu_synth->index][1]) {
 		unsigned int new_index = cpu_synth->index ? 0 : 1; /* 0 <-> 1 */
@@ -110,7 +110,7 @@ u64 ltt_heartbeat_read_synthetic_tsc(voi
 	preempt_disable();
 	cpu_synth = &synthetic_tsc[smp_processor_id()];
 	index = cpu_synth->index; /* atomic read */
-	tsc = (u32)get_cycles();	/* We deal with a 32 LSB TSC */
+	tsc = ltt_get_timestamp32();	/* We deal with a 32 LSB TSC */
 
 	if (tsc < cpu_synth->tsc[index][1]) {
 		/* Overflow */

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68