linux-next: build failure after merge of the ftrace tree
Subsystems (2)
Hi Steven,
After merging the ftrace tree, today's linux-next build (powerpc allnoconfig) failed like this:
In file included from include/asm-generic/percpu.h:6:0,
from arch/powerpc/include/asm/percpu.h:19,
from include/linux/percpu.h:11,
from include/linux/sched.h:41,
from arch/powerpc/kernel/asm-offsets.c:17:include/linux/percpu.h:138:17: error: 'printk_func_t' undeclared here (not in a function)
DECLARE_PER_CPU(printk_func_t, printk_func);
^
include/linux/percpu-defs.h:101:38: note: in definition of macro 'DECLARE_PER_CPU_SECTION'
extern __PCPU_ATTRS(sec) __typeof__(type) name
^include/linux/percpu.h:138:1: note: in expansion of macro 'DECLARE_PER_CPU'
DECLARE_PER_CPU(printk_func_t, printk_func);
^
Caused by commit afdc34a3d3b8 ("printk: Add per_cpu printk func to allow printk to be diverted"). See Rule 1 in Documentation/SubmitChecklist.
I reverted that commit (and the following one (a9edc8809328 "x86/nmi:
Perform a safe NMI stack trace on all CPUs" in case it depended in it) for today.
Signature · 2 lines
Cheers, Stephen Rothwell [email protected]
Quoted 11 lines · Stephen Rothwell
Hi Steven,
After merging the ftrace tree, today's linux-next build (powerpc allnoconfig) failed like this:
In file included from
include/asm-generic/percpu.h:6:0,
fromarch/powerpc/include/asm/percpu.h:19,
frominclude/linux/percpu.h:11,
frominclude/linux/sched.h:41,
fromarch/powerpc/kernel/asm-offsets.c:17:include/linux/percpu.h:138:17: error: 'printk_func_t' undeclared here (not in a function)
Quoted 8 lines
DECLARE_PER_CPU(printk_func_t, printk_func); ^ include/linux/percpu-defs.h:101:38: note: in definition of macro 'DECLARE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name ^
include/linux/percpu.h:138:1: note: in expansion of macro 'DECLARE_PER_CPU'
DECLARE_PER_CPU(printk_func_t, printk_func);
^
From: Jiri Kosina <[email protected]>
Subject: [PATCH] printk: make sure printk_func_t is known in percpu.h
Commit afdc34a3d3b8 ("printk: Add per_cpu printk func to allow printk to be diverted") caused percpu variable printk_func to be declared in percpu.h. Make sure that the corresponding type is known at the time of declaration.
Fixes build failure on certain arch/config combinations.
--- include/linux/percpu.h | 1 + 1 file changed, 1 insertion(+)
include/linux/percpu.h +1 -0
@@ -7,6 +7,7 @@#include <linux/cpumask.h> #include <linux/pfn.h> #include <linux/init.h> +#include <linux/printk.h> #include <asm/percpu.h>
Signature · 2 lines
Jiri Kosina SUSE Labs
Quoted 23 lines
From: Jiri Kosina <[email protected]>
Subject: [PATCH] printk: make sureprintk_func_tis known inpercpu.hCommit
afdc34a3d3b8("printk: Addper_cpuprintk func to allow printk to be diverted") caused percpu variableprintk_functo be declared inpercpu.h. Make sure that the corresponding type is known at the time of declaration.Fixes build failure on certain
arch/configcombinations.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Jiri Kosina <[email protected]>--- include/linux/percpu.h | 1 + 1 file changed, 1 insertion(+)include/linux/percpu.h +0
-0
include/linux/percpu.h line 12
Quoted 6 lines
include/linux/percpu.h +1
-0@@ -7,6 +7,7 @@#include <linux/cpumask.h> #include <linux/pfn.h> #include <linux/init.h> +#include <linux/printk.h> #include <asm/percpu.h>
Unfortunately, this wasn't the fix. This was an allnoconfig, which means printk wasn't defined.
-- Steve
From: "Steven Rostedt (Red Hat)" <[email protected]>
Date: Fri, 21 Nov 2014 09:16:58 -0500
Subject: [PATCH] printk/percpu: Do not define printk_func when printk is not
defined
To avoid include hell, the per_cpu variable printk_func was declared in percpu.h. But it is only defined if printk is defined.
--- include/linux/percpu.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/percpu.h +2 -0
@@ -134,7 +134,9 @@ extern phys_addr_t per_cpu_ptr_to_phys(void *addr); (typeof(type) __percpu *)__alloc_percpu(sizeof(type), \ __alignof__(type)) +#ifdef CONFIG_PRINTK /* To avoid include hell, as printk can not declare this, we declare it here */ DECLARE_PER_CPU (printk_func_t, printk_func); +#endif #endif /* __LINUX_PERCPU_H */
Signature · 1 line
2.1.1
Quoted 26 lines · Steven Rostedt
Quoted 26 lines
From: Jiri Kosina <[email protected]>
Subject: [PATCH] printk: make sureprintk_func_tis known inpercpu.hCommit
afdc34a3d3b8("printk: Addper_cpuprintk func to allow printk to be diverted") caused percpu variableprintk_functo be declared inpercpu.h. Make sure that the corresponding type is known at the time of declaration.Fixes build failure on certain
arch/configcombinations.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Jiri Kosina <[email protected]>--- include/linux/percpu.h | 1 + 1 file changed, 1 insertion(+)include/linux/percpu.h +1
-0@@ -7,6 +7,7 @@#include <linux/cpumask.h> #include <linux/pfn.h> #include <linux/init.h> +#include <linux/printk.h>
Quoted 4 lines
include/linux/percpu.h line 12
Quoted 1 line
include/linux/percpu.h +0
-0#include <asm/percpu.h> Unfortunately, this wasn't the fix. This was an allnoconfig, which means printk wasn't defined.
Ah, thanks, that indeed needs to be done as well.
I still think that the patch I sent should be applied, as there might be configurations where printk.h doesn't implicitly transitively make it into percpu.h.
Signature · 2 lines
Jiri Kosina SUSE Labs
Quoted 10 lines · On Fri, 21 Nov 2014 09:20:36 -0500 Steven Rostedt <[email protected]> wrote:
Quoted 10 lines
include/linux/percpu.h +1
-0@@ -7,6 +7,7 @@#include <linux/cpumask.h> #include <linux/pfn.h> #include <linux/init.h> +#include <linux/printk.h>
Quoted 5 lines
include/linux/percpu.h line 12
Quoted 1 line
include/linux/percpu.h +0
-0#include <asm/percpu.h> Unfortunately, this wasn't the fix. This was an allnoconfig, which means printk wasn't defined.
Just to be safe, I put the printk.h back in. Although it doesn't seem to be needed.
-- Steve
Quoted 1 line
From
da1e044a557571fd3718bd161b7ce7f36d3f999eMon Sep 17 00:00:00 2001
From: "Steven Rostedt (Red Hat)" <[email protected]>
Date: Fri, 21 Nov 2014 09:16:58 -0500
Subject: [PATCH] printk/percpu: Do not define printk_func when printk is not
defined
To avoid include hell, the per_cpu variable printk_func was declared in percpu.h. But it is only defined if printk is defined.
Also add a printk.h include in percpu.h just to be safe.
--- include/linux/percpu.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/percpu.h +3 -0
@@ -5,6 +5,7 @@#include <linux/preempt.h> #include <linux/smp.h> #include <linux/cpumask.h> +#include <linux/printk.h> #include <linux/pfn.h> #include <linux/init.h>
@@ -134,7 +135,9 @@ extern phys_addr_t per_cpu_ptr_to_phys(void *addr); (typeof(type) __percpu *)__alloc_percpu(sizeof(type), \ __alignof__(type)) +#ifdef CONFIG_PRINTK /* To avoid include hell, as printk can not declare this, we declare it here */ DECLARE_PER_CPU (printk_func_t, printk_func); +#endif #endif /* __LINUX_PERCPU_H */
Signature · 1 line
1.8.1.4
Quoted 16 lines · On Fri, 21 Nov 2014 18:32:15 +1100 Stephen Rothwell <[email protected]>…
Hi Steven,
After merging the ftrace tree, today's linux-next build (powerpc allnoconfig) failed like this:
In file included from
include/asm-generic/percpu.h:6:0,
fromarch/powerpc/include/asm/percpu.h:19,
frominclude/linux/percpu.h:11,
frominclude/linux/sched.h:41,
fromarch/powerpc/kernel/asm-offsets.c:17:include/linux/percpu.h:138:17: error: 'printk_func_t' undeclared here (not in a function)DECLARE_PER_CPU(printk_func_t, printk_func); ^ include/linux/percpu-defs.h:101:38: note: in definition of macro 'DECLARE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name ^
Quoted 8 lines
include/linux/percpu.h:138:1: note: in expansion of macro 'DECLARE_PER_CPU'
DECLARE_PER_CPU(printk_func_t, printk_func);
^Caused by commit
afdc34a3d3b8("printk: Addper_cpuprintk func to allow printk to be diverted"). See Rule 1 inDocumentation/SubmitChecklist.
I had to fight header include hell with that change. That's why rule 1 wasn't followed so well.
Thanks Jiri for fixing it. I'll start running your patch through my tests.
-- Steve