Skip to contentSkip to conversation

Add missing include of linux/ftrace.h

PATCH New Jamie Iles 3 participants 6 messages Sep 29, 2011 – Oct 4, 2011

Subsystems (3)
lore
Share & tools
lore

Jamie Iles

author
#0 lore raw

PATCH 1/1 Add missing include of linux/ftrace.h

__exception_irq_entry uses __irq_entry which is defined in linux/ftrace.h.

---
 arch/arm/include/asm/system.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/include/asm/system.h +1 -0
index 832888d..129e5e5 100644
@@ -59,6 +59,7 @@
 
 #include <linux/linkage.h>
 #include <linux/irqflags.h>
+#include <linux/ftrace.h>
 
 #include <asm/outercache.h>
 
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 Add missing include of linux/ftrace.h

Quoted 6 lines · Jamie Iles

__exception_irq_entry uses __irq_entry which is defined in linux/ftrace.h.

This introduces a circular dependency:

linux/ftrace.h -> linux/kallsyms.h -> linux/kernel.h -> linux/bitops.h
-> asm/bitops.h -> asm/system.h -> linux/ftrace.h

This is not good as it means that we end up with indeterminant effects happening depending on where in that cycle the first include happens.

author
#2 lore raw

PATCH 1/1 Add missing include of linux/ftrace.h

Quoted 8 lines · Russell King - ARM Linux
Quoted 6 lines · Jamie Iles

__exception_irq_entry uses __irq_entry which is defined in linux/ftrace.h.

Quoted 7 lines

This introduces a circular dependency:

linux/ftrace.h -> linux/kallsyms.h -> linux/kernel.h -> linux/bitops.h
-> asm/bitops.h -> asm/system.h -> linux/ftrace.h

This is not good as it means that we end up with indeterminant effects happening depending on where in that cycle the first include happens.

Crap. I don't think having users of __exception_irq_entry include linux/ftrace.h is great, so how about this instead?

Jamie

8<----

From: Jamie Iles <[email protected]>
Subject: [PATCH] move __exception and friends to asm/exception.h

The definition of __exception_irq_entry for CONFIG_FUNCTION_GRAPH_TRACER=y needs linux/ftrace.h, but this creates a circular dependency with it's current home in asm/system.h. Create asm/exception.h and update all current users.

---
 arch/arm/include/asm/exception.h |   13 +++++++++++++
 arch/arm/include/asm/system.h    |    7 -------
 arch/arm/kernel/irq.c            |    1 +
 arch/arm/kernel/smp.c            |    1 +
 arch/arm/kernel/traps.c          |    1 +
 arch/arm/mach-pxa/irq.c          |    2 ++
 arch/arm/mm/fault.c              |    1 +
 7 files changed, 19 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/include/asm/exception.h
arch/arm/include/asm/exception.h new file +13 -0
new file mode 100644
index 0000000..7d6fd97
@@ -0,0 +1,13 @@
+#ifndef __ASM_ARM_EXCEPTION_H
+#define __ASM_ARM_EXCEPTION_H
+
+#include <linux/ftrace.h>
+
+#define __exception	__attribute__((section(".exception.text")))
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+#define __exception_irq_entry	__irq_entry
+#else
+#define __exception_irq_entry	__exception
+#endif
+
+#endif /* __ASM_ARM_EXCEPTION_H */
arch/arm/include/asm/system.h +0 -7
index 832888d..ed6b049 100644
@@ -62,13 +62,6 @@
 
 #include <asm/outercache.h>
 
-#define __exception	__attribute__((section(".exception.text")))
-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
-#define __exception_irq_entry	__irq_entry
-#else
-#define __exception_irq_entry	__exception
-#endif
-
 struct thread_info;
 struct task_struct;
 
arch/arm/kernel/irq.c +1 -0
index de3dcab..61c1468 100644
@@ -37,6 +37,7 @@
 #include <linux/proc_fs.h>
 #include <linux/ftrace.h>
 
+#include <asm/exception.h>
 #include <asm/system.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
arch/arm/kernel/smp.c +1 -0
index d88ff02..1122faf 100644
@@ -31,6 +31,7 @@
 #include <asm/cacheflush.h>
 #include <asm/cpu.h>
 #include <asm/cputype.h>
+#include <asm/exception.h>
 #include <asm/mmu_context.h>
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
arch/arm/kernel/traps.c +1 -0
index bc9f9da..2103825 100644
@@ -27,6 +27,7 @@
 
 #include <linux/atomic.h>
 #include <asm/cacheflush.h>
+#include <asm/exception.h>
 #include <asm/system.h>
 #include <asm/unistd.h>
 #include <asm/traps.h>
arch/arm/mach-pxa/irq.c +2 -0
index b09e848..ca60757 100644
@@ -19,6 +19,8 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 
+#include <asm/exception.h>
+
 #include <mach/hardware.h>
 #include <mach/irqs.h>
 #include <mach/gpio.h>
arch/arm/mm/fault.c +1 -0
index 3b5ea68..aa33949 100644
@@ -20,6 +20,7 @@
 #include <linux/highmem.h>
 #include <linux/perf_event.h>
 
+#include <asm/exception.h>
 #include <asm/system.h>
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 1/1 Add missing include of linux/ftrace.h

Quoted 11 lines · Jamie Iles
Quoted 10 lines · Russell King - ARM Linux
Quoted 6 lines · Jamie Iles

__exception_irq_entry uses __irq_entry which is defined in linux/ftrace.h.

This introduces a circular dependency:

Quoted 8 lines
Quoted 5 lines

linux/ftrace.h -> linux/kallsyms.h -> linux/kernel.h -> linux/bitops.h
-> asm/bitops.h -> asm/system.h -> linux/ftrace.h

This is not good as it means that we end up with indeterminant effects happening depending on where in that cycle the first include happens.

Crap. I don't think having users of __exception_irq_entry include linux/ftrace.h is great, so how about this instead?

This looks much better - and won't involve any circular dependencies. It might be worth adding a comment in the new header file that this should only be used on functions called from the low level entry code and not from intervening C code.

Finally, could you stick it in the patch system please?

Thanks.

#4 lore raw

PATCH 1/1 Add missing include of linux/ftrace.h

In reply to Jamie Iles
Quoted 7 lines · Jamie Iles
arch/arm/kernel/irq.c +0 -0
index de3dcab..61c1468 100644
@@ -37,6 +37,7 @@

?#include <linux/proc_fs.h>
?#include <linux/ftrace.h>

You can probably git rid of this inclusion of ftrace.h from here and from smp.c, because they were added only for __exception_irq_entry.

Quoted 5 lines

+#include <asm/exception.h>
?#include <asm/system.h>
?#include <asm/mach/arch.h>
?#include <asm/mach/irq.h>

author
#5 lore raw

PATCH 1/1 Add missing include of linux/ftrace.h

Quoted 12 lines · Rabin Vincent
Quoted 7 lines · Jamie Iles
arch/arm/kernel/irq.c +0 -0
index de3dcab..61c1468 100644
@@ -37,6 +37,7 @@

?#include <linux/proc_fs.h>
?#include <linux/ftrace.h>

You can probably git rid of this inclusion of ftrace.h from here and from smp.c, because they were added only for __exception_irq_entry.

OK, I've updated the patch in Russell's tracker removing these includes.

Jamie