aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-02-02 17:06:09 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-02-03 09:29:06 -0500
commit3d56e331b6537671c66f1b510bed0f1e0331dfc8 (patch)
tree80145576e1b9e701b7a2270c6a09798ed6b783c3 /include/asm-generic
parent654986462939cd7ec18f276c6379a334dac106a7 (diff)
tracing: Replace syscall_meta_data struct array with pointer array
Currently the syscall_meta structures for the syscall tracepoints are placed in the __syscall_metadata section, and at link time, the linker makes one large array of all these syscall metadata structures. On boot up, this array is read (much like the initcall sections) and the syscall data is processed. The problem is that there is no guarantee that gcc will place complex structures nicely together in an array format. Two structures in the same file may be placed awkwardly, because gcc has no clue that they are suppose to be in an array. A hack was used previous to force the alignment to 4, to pack the structures together. But this caused alignment issues with other architectures (sparc). Instead of packing the structures into an array, the structures' addresses are now put into the __syscall_metadata section. As pointers are always the natural alignment, gcc should always pack them tightly together (otherwise initcall, extable, etc would also fail). By having the pointers to the structures in the section, we can still iterate the trace_events without causing unnecessary alignment problems with other architectures, or depending on the current behaviour of gcc that will likely change in the future just to tick us kernel developers off a little more. The __syscall_metadata section is also moved into the .init.data section as it is now only needed at boot up. Suggested-by: David Miller <davem@davemloft.net> Acked-by: David S. Miller <davem@davemloft.net> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/vmlinux.lds.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 57b1b6811b61..fe77e3395b40 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -141,7 +141,8 @@
141#endif 141#endif
142 142
143#ifdef CONFIG_FTRACE_SYSCALLS 143#ifdef CONFIG_FTRACE_SYSCALLS
144#define TRACE_SYSCALLS() VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ 144#define TRACE_SYSCALLS() . = ALIGN(8); \
145 VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \
145 *(__syscalls_metadata) \ 146 *(__syscalls_metadata) \
146 VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; 147 VMLINUX_SYMBOL(__stop_syscalls_metadata) = .;
147#else 148#else
@@ -175,10 +176,7 @@
175 VMLINUX_SYMBOL(__stop___verbose) = .; \ 176 VMLINUX_SYMBOL(__stop___verbose) = .; \
176 LIKELY_PROFILE() \ 177 LIKELY_PROFILE() \
177 BRANCH_PROFILE() \ 178 BRANCH_PROFILE() \
178 TRACE_PRINTKS() \ 179 TRACE_PRINTKS()
179 \
180 STRUCT_ALIGN(); \
181 TRACE_SYSCALLS()
182 180
183/* 181/*
184 * Data section helpers 182 * Data section helpers
@@ -483,6 +481,7 @@
483 *(.init.rodata) \ 481 *(.init.rodata) \
484 MCOUNT_REC() \ 482 MCOUNT_REC() \
485 FTRACE_EVENTS() \ 483 FTRACE_EVENTS() \
484 TRACE_SYSCALLS() \
486 DEV_DISCARD(init.rodata) \ 485 DEV_DISCARD(init.rodata) \
487 CPU_DISCARD(init.rodata) \ 486 CPU_DISCARD(init.rodata) \
488 MEM_DISCARD(init.rodata) \ 487 MEM_DISCARD(init.rodata) \