Skip to contentSkip to conversation

fix build failure when compiling without TRACE_IRQFLAGS_SUPPORT

PATCH In review Giuseppe CAVALLARO 2 participants 3 messages Sep 5, 2008 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix build failure when compiling without TRACE_IRQFLAGS_SUPPORT

Hi All,
playing with the kernel configuration we noticed that the kernel doesn't build if TRACE_IRQFLAGS_SUPPORT is forced off. So this patch just fixes it.

Anyway, we are wondering why it's not possible to disable this option from Kconfig.
Reading the Documentation/irqflags-tracing.txt, this option is "needed for CONFIG_PROVE_SPIN_LOCKING and CONFIG_PROVE_RW_LOCKING to be offered by the generic lock debugging code."
But we cannot find any references to PROVE_RW_LOCKING etc. May be removed?

Best Regards,
Peppe & Carmelo

This fixes the Kernel build failure when compiling without TRACE_IRQFLAGS_SUPPORT.

include/linux/irqflags.h +6 -8
index 412e025..7ccd276 100644
@@ -41,10 +41,10 @@
 # define INIT_TRACE_IRQFLAGS
 #endif
 
-#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
-
 #include <asm/irqflags.h>
 
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+
 #define local_irq_enable() \
 	do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0)
 #define local_irq_disable() \
@@ -67,13 +67,12 @@
  * The local_irq_*() APIs are equal to the raw_local_irq*()
  * if !TRACE_IRQFLAGS.
  */
-# define raw_local_irq_disable()	local_irq_disable()
-# define raw_local_irq_enable()		local_irq_enable()
-# define raw_local_irq_save(flags)	local_irq_save(flags)
-# define raw_local_irq_restore(flags)	local_irq_restore(flags)
+# define local_irq_disable() raw_local_irq_disable()
+# define local_irq_enable() raw_local_irq_enable()
+# define local_irq_save(flags) raw_local_irq_save(flags)
+# define local_irq_restore(flags) raw_local_irq_restore(flags)
 #endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */
 
-#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
 #define safe_halt()						\
 	do {							\
 		trace_hardirqs_on();				\
@@ -91,6 +90,5 @@
 })
 
 #define irqs_disabled_flags(flags)	raw_irqs_disabled_flags(flags)
-#endif		/* CONFIG_X86 */
 
 #endif
#1 lore raw
Quoted 5 lines · Giuseppe CAVALLARO

Hi All,
playing with the kernel configuration we noticed that the kernel doesn't build if TRACE_IRQFLAGS_SUPPORT is forced off. So this patch just fixes it.

Quoted 9 lines

Anyway, we are wondering why it's not possible to disable this option from Kconfig.
Reading the Documentation/irqflags-tracing.txt, this option is "needed for CONFIG_PROVE_SPIN_LOCKING and CONFIG_PROVE_RW_LOCKING to be offered by the generic lock debugging code."
But we cannot find any references to PROVE_RW_LOCKING etc. May be removed?

Have you noticed this problem on non-sh platforms also? If so, you should resend this patch to linux-kernel with the linux-sh list CCed.

The config dependencies are a bit of a mess, but it's all quite functional. CONFIG_PROVE_RW_LOCKING is bogus though, it's actually CONFIG_PROVE_LOCKING. Anyways, take a look at lib/Kconfig.debug and it should all be pretty obvious.

TRACE_IRQFLAGS_SUPPORT is used by quite a lot of things, lockdep, lock stat, preempt debug, etc. You really do _not_ want to disable this option, especially as it is a _support_ option, not a functional one.

CONFIG_TRACE_IRQFLAGS itself is what introduces extra overhead, and while this depends on TRACE_IRQFLAGS_SUPPORT, it also has a dependency on DEBUG_KERNEL. Thus, you will never see any of this stuff with kernel debugging disabled. Most of this stuff is hidden away from the user in Kconfig for a good reason :-)

#2 lore raw
In reply to Giuseppe CAVALLARO
Quoted 17 lines · Paul Mundt
Quoted 5 lines · Giuseppe CAVALLARO

Hi All,
playing with the kernel configuration we noticed that the kernel doesn't build if TRACE_IRQFLAGS_SUPPORT is forced off. So this patch just fixes it.

Quoted 10 lines

Anyway, we are wondering why it's not possible to disable this option from Kconfig.
Reading the Documentation/irqflags-tracing.txt, this option is "needed for CONFIG_PROVE_SPIN_LOCKING and CONFIG_PROVE_RW_LOCKING to be offered by the generic lock debugging code."
But we cannot find any references to PROVE_RW_LOCKING etc. May be removed?

Quoted 3 lines

Have you noticed this problem on non-sh platforms also? If so, you should resend this patch to linux-kernel with the linux-sh list CCed.

we'll send the patch soon.

Quoted 9 lines

The config dependencies are a bit of a mess, but it's all quite functional. CONFIG_PROVE_RW_LOCKING is bogus though, it's actually CONFIG_PROVE_LOCKING. Anyways, take a look at lib/Kconfig.debug and it should all be pretty obvious.

TRACE_IRQFLAGS_SUPPORT is used by quite a lot of things, lockdep, lock stat, preempt debug, etc. You really do _not_ want to disable this option, especially as it is a _support_ option, not a functional one.

Quoted 5 lines

CONFIG_TRACE_IRQFLAGS itself is what introduces extra overhead, and while this depends on TRACE_IRQFLAGS_SUPPORT, it also has a dependency on DEBUG_KERNEL. Thus, you will never see any of this stuff with kernel debugging disabled. Most of this stuff is hidden away from the user in Kconfig for a good reason :-)

Sure, all sounds clear now.
Thanks!