Skip to content

Commit c763ba0

Browse files
Ian Munsierostedt
authored andcommitted
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 <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 3773b38 commit c763ba0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Documentation/trace/ftrace-design.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ You need very few things to get the syscalls tracing in an arch.
247247
- Support the TIF_SYSCALL_TRACEPOINT thread flags.
248248
- Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
249249
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.
250253
- Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
251254

252255

kernel/trace/trace_syscalls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ int init_syscall_trace(struct ftrace_event_call *call)
446446
return id;
447447
}
448448

449-
unsigned long __init arch_syscall_addr(int nr)
449+
unsigned long __init __weak arch_syscall_addr(int nr)
450450
{
451451
return (unsigned long)sys_call_table[nr];
452452
}

0 commit comments

Comments
 (0)