]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Replace syscall_meta_data struct array with pointer array
authorSteven Rostedt <srostedt@redhat.com>
Wed, 2 Feb 2011 22:06:09 +0000 (17:06 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 3 Feb 2011 14:29:06 +0000 (09:29 -0500)
commitd4ad394c2d86f26f6e13348fcf0bb6623e7c68a5
tree80145576e1b9e701b7a2270c6a09798ed6b783c3
parentdd6765d401d9e4321a2b011f4e09d78b73ca02c0
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>
include/asm-generic/vmlinux.lds.h
include/linux/syscalls.h
kernel/trace/trace_syscalls.c