diff options
author | Ian Munsie <imunsie@au1.ibm.com> | 2011-02-02 22:27:22 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-02-07 21:26:22 -0500 |
commit | c763ba06bd9b5db2c46c36276c89103d92d2c604 (patch) | |
tree | 776ce215fc5900e747fb79dc91a160da35f4325c | |
parent | 3773b389b6927595512558594d040c1edba46f36 (diff) |
tracing/syscalls: Make arch_syscall_addr weak
Some architectures use non-trivial system call tables and will not work
with the generic arch_syscall_addr code. For example, PowerPC64 uses a
table of twin long longs.
This patch makes the generic arch_syscall_addr weak to allow
architectures with non-trivial system call tables to override it.
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
LKML-Reference: <1296703645-18718-4-git-send-email-imunsie@au1.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | Documentation/trace/ftrace-design.txt | 3 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt index dc52bd442c92..6fca17beee2f 100644 --- a/Documentation/trace/ftrace-design.txt +++ b/Documentation/trace/ftrace-design.txt | |||
@@ -247,6 +247,9 @@ You need very few things to get the syscalls tracing in an arch. | |||
247 | - Support the TIF_SYSCALL_TRACEPOINT thread flags. | 247 | - Support the TIF_SYSCALL_TRACEPOINT thread flags. |
248 | - Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace | 248 | - Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace |
249 | in the ptrace syscalls tracing path. | 249 | in the ptrace syscalls tracing path. |
250 | - If the system call table on this arch is more complicated than a simple array | ||
251 | of addresses of the system calls, implement an arch_syscall_addr to return | ||
252 | the address of a given system call. | ||
250 | - Tag this arch as HAVE_SYSCALL_TRACEPOINTS. | 253 | - Tag this arch as HAVE_SYSCALL_TRACEPOINTS. |
251 | 254 | ||
252 | 255 | ||
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 423094288fb5..af831545f656 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -446,7 +446,7 @@ int init_syscall_trace(struct ftrace_event_call *call) | |||
446 | return id; | 446 | return id; |
447 | } | 447 | } |
448 | 448 | ||
449 | unsigned long __init arch_syscall_addr(int nr) | 449 | unsigned long __init __weak arch_syscall_addr(int nr) |
450 | { | 450 | { |
451 | return (unsigned long)sys_call_table[nr]; | 451 | return (unsigned long)sys_call_table[nr]; |
452 | } | 452 | } |