[ltt-dev] Kernel crashes when creating a trace

Mathieu Desnoyers mathieu.desnoyers at polymtl.ca
Tue Nov 17 16:53:52 EST 2009


* Ashwin Tanugula (ashwin.tanugula at broadcom.com) wrote:
>  
> 
> -----Original Message-----
> From: Mathieu Desnoyers [mailto:mathieu.desnoyers at polymtl.ca] 
> Sent: Tuesday, November 17, 2009 1:32 PM
> To: Ashwin Tanugula
> Cc: ltt-dev at lists.casi.polymtl.ca
> Subject: Re: [ltt-dev] Kernel crashes when creating a trace
> 
> 
> > > > And can you try with this patch on top of 0.172 for the MIPS32 trace clock ?
> > >
> > >With this patch, the kernel hangs during ltt-armall
> > >
> 
> > Thinking about it.. that's really weird. ltt-armall is not using the trace clock in any way. So this is probably a random effect, I don't see > any possible causality link between the trace clock patch and ltt-armall execution (if tracing is not active while you run ltt-armall).
> 
> I guess you are right, I rebooted the board and ran it again.
> 
> It actually hangs while running lttctl
> 
> Connecting /proc/sys/debug/ltt/markers/rcu/classic_callback
> Connecting /proc/sys/debug/ltt/markers/softirq_state/softirq_vec
> Connecting /proc/sys/debug/ltt/markers/swap_state/statedump_swap_files
> Connecting /proc/sys/debug/ltt/markers/task_state/process_state
> Connecting /proc/sys/debug/ltt/markers/userspace/event
> Connecting /proc/sys/debug/ltt/markers/vm_state/vm_map
> # 
> # 
> # 
> # cd ltt-control-0.75-15112009/lttctl/.libs/
> # lttctl -C -w /tmp/trace1 trace1
> Linux Trace Toolkit Trace Control 0.75-15112009
> 

OK, it makes more sense. Can you try the latest lttng with this patch
then ?


trace clock provide sleep free get put

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
---
 kernel/trace/trace-clock-32-to-64.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6-lttng/kernel/trace/trace-clock-32-to-64.c
===================================================================
--- linux-2.6-lttng.orig/kernel/trace/trace-clock-32-to-64.c	2009-11-17 17:28:21.000000000 -0500
+++ linux-2.6-lttng/kernel/trace/trace-clock-32-to-64.c	2009-11-17 17:30:33.000000000 -0500
@@ -232,21 +232,27 @@ static int __cpuinit hotcpu_callback(str
 	switch (action) {
 	case CPU_UP_PREPARE:
 	case CPU_UP_PREPARE_FROZEN:
+		spin_lock(&synthetic_tsc_lock);
 		if (synthetic_tsc_refcount)
 			prepare_synthetic_tsc(hotcpu);
+		spin_unlock(&synthetic_tsc_lock);
 		break;
 	case CPU_ONLINE:
 	case CPU_ONLINE_FROZEN:
+		spin_lock(&synthetic_tsc_lock);
 		if (synthetic_tsc_refcount)
 			enable_synthetic_tsc(hotcpu);
+		spin_unlock(&synthetic_tsc_lock);
 		break;
 #ifdef CONFIG_HOTPLUG_CPU
 	case CPU_UP_CANCELED:
 	case CPU_UP_CANCELED_FROZEN:
 	case CPU_DEAD:
 	case CPU_DEAD_FROZEN:
+		spin_lock(&synthetic_tsc_lock);
 		if (synthetic_tsc_refcount)
 			disable_synthetic_tsc(hotcpu);
+		spin_unlock(&synthetic_tsc_lock);
 		break;
 #endif /* CONFIG_HOTPLUG_CPU */
 	}
@@ -257,7 +263,6 @@ void get_synthetic_tsc(void)
 {
 	int cpu;
 
-	get_online_cpus();
 	spin_lock(&synthetic_tsc_lock);
 	if (synthetic_tsc_refcount++)
 		goto end;
@@ -269,7 +274,6 @@ void get_synthetic_tsc(void)
 	}
 end:
 	spin_unlock(&synthetic_tsc_lock);
-	put_online_cpus();
 }
 EXPORT_SYMBOL_GPL(get_synthetic_tsc);
 
@@ -277,7 +281,6 @@ void put_synthetic_tsc(void)
 {
 	int cpu;
 
-	get_online_cpus();
 	spin_lock(&synthetic_tsc_lock);
 	WARN_ON(synthetic_tsc_refcount <= 0);
 	if (synthetic_tsc_refcount != 1 || !synthetic_tsc_enabled)
@@ -289,7 +292,6 @@ void put_synthetic_tsc(void)
 end:
 	synthetic_tsc_refcount--;
 	spin_unlock(&synthetic_tsc_lock);
-	put_online_cpus();
 }
 EXPORT_SYMBOL_GPL(put_synthetic_tsc);
 

> 
> Thanks,
> Ashwin
> 
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




More information about the lttng-dev mailing list