From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [patch 2/3] RCU move trace defines to rcupdate_types.h
Date: Thu, 16 Apr 2009 23:23:33 -0700 [thread overview]
Message-ID: <49E82065.6010902@goop.org> (raw)
In-Reply-To: <20090417014733.GB24956@Krystal>
Mathieu Desnoyers wrote:
> Hrm, well, the actual question is :
>
> given rcupdate_types.h only defines macros, and given we won't want to
> include all the headers that implement all the content of these macros,
> does it make sense to typically require people to either include
> rcupdate.h directly if they want to have the full includes required to
> expand the macros ?
>
Well, any user of tracepoint who wants to directly or indirectly use
DECLARE_TRACE() or DEFINE_TRACE() will need to include it, so it ends up
getting included everywhere.
> If we do that, then including preempt.h in rcupdate_types.h is not
> necessary. However, tracepoint.h should now include preempt.h, because
> it would be cumbersome to require from every tracepoint.h users to
> include preempt.h.
>
> One way or another, we will have to include preempt.h under
> tracepoint.h, but I don't see it as a roadblock, given that preempt.h is
> quite slim.
>
Our headers are a tangled mass, and including anything non-trivial tends
to bring in everything. Despite the fact that preempt.h doesn't include
much explicitly, it does include non-trivial headers, and so will pull
in a broad swath of headers.
For example, here's the list of 64 headers included by cpp from a .c
file containing a single line: #include <linux/preempt.h>
"/home/jeremy/git/linux/arch/x86/include/asm/alternative.h"
"/home/jeremy/git/linux/arch/x86/include/asm/atomic_64.h"
"/home/jeremy/git/linux/arch/x86/include/asm/bitops.h"
"/home/jeremy/git/linux/arch/x86/include/asm/bug.h"
"/home/jeremy/git/linux/arch/x86/include/asm/cmpxchg_64.h"
"/home/jeremy/git/linux/arch/x86/include/asm/cpufeature.h"
"/home/jeremy/git/linux/arch/x86/include/asm/desc_defs.h"
"/home/jeremy/git/linux/arch/x86/include/asm/ds.h"
"/home/jeremy/git/linux/arch/x86/include/asm/ftrace.h"
"/home/jeremy/git/linux/arch/x86/include/asm/irqflags.h"
"/home/jeremy/git/linux/arch/x86/include/asm/kmap_types.h"
"/home/jeremy/git/linux/arch/x86/include/asm/math_emu.h"
"/home/jeremy/git/linux/arch/x86/include/asm/msr.h"
"/home/jeremy/git/linux/arch/x86/include/asm/page.h"
"/home/jeremy/git/linux/arch/x86/include/asm/page_64_types.h"
"/home/jeremy/git/linux/arch/x86/include/asm/page_types.h"
"/home/jeremy/git/linux/arch/x86/include/asm/paravirt.h"
"/home/jeremy/git/linux/arch/x86/include/asm/paravirt_types.h"
"/home/jeremy/git/linux/arch/x86/include/asm/percpu.h"
"/home/jeremy/git/linux/arch/x86/include/asm/pgtable_64_types.h"
"/home/jeremy/git/linux/arch/x86/include/asm/pgtable_types.h"
"/home/jeremy/git/linux/arch/x86/include/asm/posix_types_64.h"
"/home/jeremy/git/linux/arch/x86/include/asm/processor.h"
"/home/jeremy/git/linux/arch/x86/include/asm/ptrace-abi.h"
"/home/jeremy/git/linux/arch/x86/include/asm/ptrace.h"
"/home/jeremy/git/linux/arch/x86/include/asm/segment.h"
"/home/jeremy/git/linux/arch/x86/include/asm/sigcontext.h"
"/home/jeremy/git/linux/arch/x86/include/asm/string_64.h"
"/home/jeremy/git/linux/arch/x86/include/asm/swab.h"
"/home/jeremy/git/linux/arch/x86/include/asm/system.h"
"/home/jeremy/git/linux/arch/x86/include/asm/thread_info.h"
"/home/jeremy/git/linux/arch/x86/include/asm/types.h"
"/home/jeremy/git/linux/arch/x86/include/asm/vm86.h"
"/home/jeremy/git/linux/include/asm-generic/atomic.h"
"/home/jeremy/git/linux/include/asm-generic/bitops/fls64.h"
"/home/jeremy/git/linux/include/asm-generic/bitops/sched.h"
"/home/jeremy/git/linux/include/asm-generic/bug.h"
"/home/jeremy/git/linux/include/asm-generic/int-ll64.h"
"/home/jeremy/git/linux/include/asm-generic/page.h"
"/home/jeremy/git/linux/include/asm-generic/percpu.h"
"/home/jeremy/git/linux/include/linux/bitmap.h"
"/home/jeremy/git/linux/include/linux/bitops.h"
"/home/jeremy/git/linux/include/linux/byteorder/generic.h"
"/home/jeremy/git/linux/include/linux/byteorder/little_endian.h"
"/home/jeremy/git/linux/include/linux/compiler-gcc.h"
"/home/jeremy/git/linux/include/linux/compiler.h"
"/home/jeremy/git/linux/include/linux/cpumask.h"
"/home/jeremy/git/linux/include/linux/dynamic_debug.h"
"/home/jeremy/git/linux/include/linux/err.h"
"/home/jeremy/git/linux/include/linux/init.h"
"/home/jeremy/git/linux/include/linux/irqflags.h"
"/home/jeremy/git/linux/include/linux/kernel.h"
"/home/jeremy/git/linux/include/linux/list.h"
"/home/jeremy/git/linux/include/linux/log2.h"
"/home/jeremy/git/linux/include/linux/personality.h"
"/home/jeremy/git/linux/include/linux/posix_types.h"
"/home/jeremy/git/linux/include/linux/preempt.h"
"/home/jeremy/git/linux/include/linux/prefetch.h"
"/home/jeremy/git/linux/include/linux/stddef.h"
"/home/jeremy/git/linux/include/linux/string.h"
"/home/jeremy/git/linux/include/linux/swab.h"
"/home/jeremy/git/linux/include/linux/thread_info.h"
"/home/jeremy/git/linux/include/linux/tracepoint.h"
"/home/jeremy/git/linux/include/linux/types.h"
"/home/jeremy/git/linux/include/trace/events/pvops.h"
Using your patch to split out rcupdate_types.h, if I leave my pvops.h
header as-is, I get:
CC arch/x86/kernel/asm-offsets.s
In file included from /home/jeremy/git/linux/arch/x86/include/asm/paravirt.h:18,
from /home/jeremy/git/linux/arch/x86/include/asm/irqflags.h:55,
from /home/jeremy/git/linux/include/linux/irqflags.h:57,
from /home/jeremy/git/linux/arch/x86/include/asm/system.h:11,
from /home/jeremy/git/linux/arch/x86/include/asm/processor.h:17,
from /home/jeremy/git/linux/include/linux/prefetch.h:14,
from /home/jeremy/git/linux/include/linux/list.h:6,
from /home/jeremy/git/linux/include/linux/module.h:9,
from /home/jeremy/git/linux/include/linux/crypto.h:21,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:7,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/include/trace/events/pvops.h: In function 'trace_load_sp0':
/home/jeremy/git/linux/include/trace/events/pvops.h:31: error: implicit declaration of function 'preempt_disable_notrace'
/home/jeremy/git/linux/include/trace/events/pvops.h:31: error: implicit declaration of function 'smp_read_barrier_depends'
/home/jeremy/git/linux/include/trace/events/pvops.h:31: error: implicit declaration of function 'preempt_enable_notrace'
make[3]: *** [arch/x86/kernel/asm-offsets.s] Error 1
If I try to fix that by adding <linux/preempt.h> just before
<linux/tracepoint.h> in pvops.h, I get:
CC arch/x86/kernel/asm-offsets.s
In file included from /home/jeremy/git/linux/include/linux/thread_info.h:55,
from /home/jeremy/git/linux/include/linux/preempt.h:9,
from /home/jeremy/git/linux/include/trace/events/pvops.h:4,
from /home/jeremy/git/linux/arch/x86/include/asm/paravirt.h:18,
from /home/jeremy/git/linux/arch/x86/include/asm/irqflags.h:55,
from /home/jeremy/git/linux/include/linux/irqflags.h:57,
from /home/jeremy/git/linux/arch/x86/include/asm/system.h:11,
from /home/jeremy/git/linux/arch/x86/include/asm/processor.h:17,
from /home/jeremy/git/linux/include/linux/prefetch.h:14,
from /home/jeremy/git/linux/include/linux/list.h:6,
from /home/jeremy/git/linux/include/linux/module.h:9,
from /home/jeremy/git/linux/include/linux/crypto.h:21,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:7,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/arch/x86/include/asm/thread_info.h:34: error: expected specifier-qualifier-list before 'mm_segment_t'
In file included from /home/jeremy/git/linux/include/trace/events/pvops.h:4,
from /home/jeremy/git/linux/arch/x86/include/asm/paravirt.h:18,
from /home/jeremy/git/linux/arch/x86/include/asm/irqflags.h:55,
from /home/jeremy/git/linux/include/linux/irqflags.h:57,
from /home/jeremy/git/linux/arch/x86/include/asm/system.h:11,
from /home/jeremy/git/linux/arch/x86/include/asm/processor.h:17,
from /home/jeremy/git/linux/include/linux/prefetch.h:14,
from /home/jeremy/git/linux/include/linux/list.h:6,
from /home/jeremy/git/linux/include/linux/module.h:9,
from /home/jeremy/git/linux/include/linux/crypto.h:21,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:7,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/include/linux/preempt.h:123: error: field 'link' has incomplete type
/home/jeremy/git/linux/include/linux/preempt.h: In function 'preempt_notifier_init':
/home/jeremy/git/linux/include/linux/preempt.h:133: error: implicit declaration of function 'INIT_HLIST_NODE'
In file included from /home/jeremy/git/linux/arch/x86/include/asm/paravirt.h:18,
from /home/jeremy/git/linux/arch/x86/include/asm/irqflags.h:55,
from /home/jeremy/git/linux/include/linux/irqflags.h:57,
from /home/jeremy/git/linux/arch/x86/include/asm/system.h:11,
from /home/jeremy/git/linux/arch/x86/include/asm/processor.h:17,
from /home/jeremy/git/linux/include/linux/prefetch.h:14,
from /home/jeremy/git/linux/include/linux/list.h:6,
from /home/jeremy/git/linux/include/linux/module.h:9,
from /home/jeremy/git/linux/include/linux/crypto.h:21,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:7,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/include/trace/events/pvops.h: In function 'trace_load_sp0':
/home/jeremy/git/linux/include/trace/events/pvops.h:31: error: implicit declaration of function 'smp_read_barrier_depends'
In file included from /home/jeremy/git/linux/include/linux/module.h:9,
from /home/jeremy/git/linux/include/linux/crypto.h:21,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:7,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/include/linux/list.h: At top level:
/home/jeremy/git/linux/include/linux/list.h:551: warning: conflicting types for 'INIT_HLIST_NODE'
/home/jeremy/git/linux/include/linux/list.h:551: error: static declaration of 'INIT_HLIST_NODE' follows non-static declaration
/home/jeremy/git/linux/include/linux/preempt.h:133: error: previous implicit declaration of 'INIT_HLIST_NODE' was here
In file included from /home/jeremy/git/linux/arch/x86/include/asm/i387.h:15,
from /home/jeremy/git/linux/arch/x86/include/asm/suspend_64.h:10,
from /home/jeremy/git/linux/arch/x86/include/asm/suspend.h:4,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:19,
from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/include/linux/regset.h: In function 'copy_regset_to_user':
/home/jeremy/git/linux/include/linux/regset.h:338: error: 'struct thread_info' has no member named 'addr_limit'
/home/jeremy/git/linux/include/linux/regset.h: In function 'copy_regset_from_user':
/home/jeremy/git/linux/include/linux/regset.h:361: error: 'struct thread_info' has no member named 'addr_limit'
In file included from /home/jeremy/git/linux/arch/x86/kernel/asm-offsets.c:4:
/home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c: In function 'main':
/home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:43: error: 'struct thread_info' has no member named 'addr_limit'
/home/jeremy/git/linux/arch/x86/kernel/asm-offsets_64.c:47: error: 'struct thread_info' has no member named 'sysenter_return'
make[3]: *** [arch/x86/kernel/asm-offsets.s] Error 1
J
next prev parent reply other threads:[~2009-04-17 6:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 0:37 [patch 0/3] Tracepoints kill rcupdate header dependency (v2) mathieu.desnoyers
2009-04-17 0:37 ` [patch 1/3] rcupdate header remove whitespace mathieu.desnoyers
2009-04-17 0:37 ` [patch 2/3] RCU move trace defines to rcupdate_types.h mathieu.desnoyers
2009-04-17 1:10 ` Jeremy Fitzhardinge
2009-04-17 1:22 ` Steven Rostedt
2009-04-17 1:42 ` Mathieu Desnoyers
2009-04-17 1:47 ` Mathieu Desnoyers
2009-04-17 6:23 ` Jeremy Fitzhardinge [this message]
2009-04-17 5:57 ` Jeremy Fitzhardinge
2009-04-17 15:16 ` Mathieu Desnoyers
2009-04-17 15:26 ` Jeremy Fitzhardinge
2009-04-17 15:42 ` Mathieu Desnoyers
2009-04-17 16:14 ` Jeremy Fitzhardinge
2009-04-17 16:38 ` Steven Rostedt
2009-04-17 17:09 ` Jeremy Fitzhardinge
2009-04-17 2:38 ` [patch 2/3] RCU move trace defines to rcupdate_types.h (update) Mathieu Desnoyers
2009-04-17 0:37 ` [patch 3/3] tracepoints : remove rcupdate.h dependency mathieu.desnoyers
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=49E82065.6010902@goop.org \
--to=jeremy@goop.org \
--cc=akpm@linux-foundation.org \
--cc=compudj@krystal.dyndns.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox