Skip to contentSkip to conversation

Disable context checks

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

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 2/2 Disable context checks

Introduce ipipe_disable_check_context and use it when dumping panic traces. This avoids triggering the alarm while actually dumping a different fault.

Jan

---
 include/linux/ipipe_base.h |   11 +++++++++++
 kernel/ipipe/core.c        |    9 +++++----
 kernel/ipipe/tracer.c      |    2 ++
 3 files changed, 18 insertions(+), 4 deletions(-)
include/linux/ipipe_base.h +11 -0
Index: linux-2.6.20/include/linux/ipipe_base.h
===================================================================
@@ -76,9 +76,20 @@ void __ipipe_unstall_root(void);
 void __ipipe_restore_root(unsigned long x);
 
 #ifdef CONFIG_IPIPE_DEBUG_CONTEXT
+
 void ipipe_check_context(struct ipipe_domain *border_ipd);
+
+static inline void ipipe_disable_context_check(void)
+{
+	extern int __ipipe_context_check_enabled;
+	__ipipe_context_check_enabled = 0;
+}
+
 #else /* !CONFIG_IPIPE_DEBUG_CONTEXT */
+
 static inline void ipipe_check_context(struct ipipe_domain *border_ipd) { }
+static inline void ipipe_disable_context_check(void) { }
+
 #endif /* !CONFIG_IPIPE_DEBUG_CONTEXT */
 
 #else /* !CONFIG_IPIPE */
kernel/ipipe/core.c +5 -4
Index: linux-2.6.20/kernel/ipipe/core.c
===================================================================
@@ -1385,15 +1385,16 @@ void __init ipipe_init_proc(void)
 #endif	/* CONFIG_PROC_FS */
 
 #ifdef CONFIG_IPIPE_DEBUG_CONTEXT
+
+int __ipipe_context_check_enabled = 1;
+
 void ipipe_check_context(struct ipipe_domain *border_ipd)
 {
-	static int check_hit;
-
 	if (likely(ipipe_current_domain->priority <= border_ipd->priority) ||
-	    check_hit)
+	    !__ipipe_context_check_enabled)
 		return;
 
-	check_hit = 1;
+	__ipipe_context_check_enabled = 0;
 
 	ipipe_trace_panic_freeze();
 	ipipe_set_printk_sync(ipipe_current_domain);
kernel/ipipe/tracer.c +2 -0
Index: linux-2.6.20/kernel/ipipe/tracer.c
===================================================================
@@ -625,6 +625,8 @@ void ipipe_trace_panic_dump(void)
 	if (!panic_path)
 		return;
 
+	ipipe_disable_context_check();
+
 	printk("I-pipe tracer log (%d points):\n", cnt);
 
 	start = pos = WRAP_POINT_NO(panic_path->trace_pos-1);