All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: adeos-main <adeos-main@gna.org>
Subject: [Adeos-main] [PATCH 2/3] 2.6.30-noarch: Introduce CONFIG_IPIPE_DEBUG_INTERNAL
Date: Mon, 13 Jul 2009 14:15:13 +0200	[thread overview]
Message-ID: <4A5B2551.1030905@domain.hid> (raw)

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.

Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---

 include/asm-generic/percpu.h |    2 +-
 kernel/ipipe/Kconfig.debug   |    9 +++++++++
 kernel/ipipe/core.c          |   10 +++++-----
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 98ccc17..5d5b6ba 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -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				\
 	({							\
diff --git a/kernel/ipipe/Kconfig.debug b/kernel/ipipe/Kconfig.debug
index 6717b51..c9b8abc 100644
--- a/kernel/ipipe/Kconfig.debug
+++ b/kernel/ipipe/Kconfig.debug
@@ -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
diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
index eeaee66..ffaceaa 100644
--- a/kernel/ipipe/core.c
+++ b/kernel/ipipe/core.c
@@ -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


                 reply	other threads:[~2009-07-13 12:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5B2551.1030905@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=rpm@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.