Skip to contentSkip to conversation

Perform panic traces only once

PATCH Applied Jan Kiszka 1 participant 1 message May 13, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/2 Perform panic traces only once

Make sure that only the first panic trace gets frozen and that it is only dumped once until being reset by turning ipipe_trace_enable on again. This avoids troubles when multiple ipipe_trace_panic_freeze are called until the related ipipe_trace_panic_dump has been invoked. Required for the succeeding patch, but also of generic usefulness IMO.

Jan

---
 kernel/ipipe/tracer.c |    8 ++++++++
 1 file changed, 8 insertions(+)
kernel/ipipe/tracer.c +8 -0
Index: linux-2.6.20/kernel/ipipe/tracer.c
===================================================================
@@ -566,6 +566,9 @@ void ipipe_trace_panic_freeze(void)
 	unsigned long flags;
 	int cpu_id;
 
+	if (!ipipe_trace_enable)
+		return;
+
 	ipipe_trace_enable = 0;
 	local_irq_save_hw_notrace(flags);
 
@@ -615,6 +618,9 @@ void ipipe_trace_panic_dump(void)
 	int start, pos;
 	char task_info[12];
 
+	if (!panic_path)
+		return;
+
 	printk("I-pipe tracer log (%d points):\n", cnt);
 
 	start = pos = WRAP_POINT_NO(panic_path->trace_pos-1);
@@ -668,6 +674,8 @@ void ipipe_trace_panic_dump(void)
 		}
 		pos = WRAP_POINT_NO(pos - 1);
 	}
+
+	panic_path = NULL;
 }
 EXPORT_SYMBOL(ipipe_trace_panic_dump);