Skip to contentSkip to conversation

2.6.30-noarch: Introduce CONFIG_IPIPE_DEBUG_INTERNAL

PATCH New Jan Kiszka 1 participant 1 message Jul 13, 2009 Generic include/asm header files

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 2/3 2.6.30-noarch: Introduce CONFIG_IPIPE_DEBUG_INTERNAL

Add a switch to control if internal I-pipe debug checks like per-cpu access validation should be enabled. There is no need to force this on if the user, e.g., just wants to enable tracing or context check validation.

---

 include/asm-generic/percpu.h |    2 +-
 kernel/ipipe/Kconfig.debug   |    9 +++++++++
 kernel/ipipe/core.c          |   10 +++++-----
 3 files changed, 15 insertions(+), 6 deletions(-)
include/asm-generic/percpu.h +1 -1
index 98ccc17..5d5b6ba 100644
@@ -57,7 +57,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
 	(*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset))
 
 #ifdef CONFIG_IPIPE
-#if defined(CONFIG_IPIPE_DEBUG) && defined(CONFIG_SMP)
+#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 extern int __ipipe_check_percpu_access(void);
 #define __ipipe_local_cpu_offset				\
 	({							\
kernel/ipipe/Kconfig.debug +9 -0
index 6717b51..c9b8abc 100644
@@ -12,6 +12,15 @@ config IPIPE_DEBUG_CONTEXT
 	  Linux services a warning is issued if the caller is not
 	  running over the root domain.
 
+config IPIPE_DEBUG_INTERNAL
+	bool "Enable internal debug checks"
+	depends on IPIPE_DEBUG
+	default y
+	---help---
+	  When this feature is enabled, I-pipe will perform internal
+	  consistency checks of its subsystems, e.g. on per-cpu variable
+	  access.
+
 config IPIPE_TRACE
 	bool "Latency tracing"
 	depends on IPIPE_DEBUG
kernel/ipipe/core.c +5 -5
index eeaee66..ffaceaa 100644
@@ -310,7 +310,7 @@ void __ipipe_unstall_root(void)
 
         local_irq_disable_hw();
 
-#ifdef CONFIG_IPIPE_DEBUG
+#ifdef CONFIG_IPIPE_DEBUG_INTERNAL
 	/* This helps catching bad usage from assembly call sites. */
 	BUG_ON(!__ipipe_root_domain_p);
 #endif
@@ -327,7 +327,7 @@ void __ipipe_unstall_root(void)
 
 void __ipipe_restore_root(unsigned long x)
 {
-#ifdef CONFIG_IPIPE_DEBUG
+#ifdef CONFIG_IPIPE_DEBUG_INTERNAL
 	BUG_ON(!ipipe_root_domain_p);
 #endif
 
@@ -1697,7 +1697,7 @@ EXPORT_SYMBOL(ipipe_check_context);
 
 #endif /* CONFIG_IPIPE_DEBUG_CONTEXT */
 
-#if defined(CONFIG_IPIPE_DEBUG) && defined(CONFIG_SMP)
+#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 
 int notrace __ipipe_check_percpu_access(void)
 {
@@ -1743,7 +1743,7 @@ out:
 	return ret;
 }
 
-#endif /* CONFIG_IPIPE_DEBUG && CONFIG_SMP */
+#endif /* CONFIG_IPIPE_DEBUG_INTERNAL && CONFIG_SMP */
 
 EXPORT_SYMBOL(ipipe_virtualize_irq);
 EXPORT_SYMBOL(ipipe_control_irq);
@@ -1780,7 +1780,7 @@ EXPORT_SYMBOL(ipipe_set_irq_affinity);
 EXPORT_SYMBOL(ipipe_send_ipi);
 EXPORT_SYMBOL(__ipipe_pend_irq);
 EXPORT_SYMBOL(__ipipe_set_irq_pending);
-#if defined(CONFIG_IPIPE_DEBUG) && defined(CONFIG_SMP)
+#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 EXPORT_SYMBOL(__ipipe_check_percpu_access);
 #endif
 #ifdef CONFIG_GENERIC_CLOCKEVENTS