summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRomeo Cane <romeo.cane.ext@coriant.com>2014-10-02 14:41:39 (GMT)
committerHonghua Yin <Hong-Hua.Yin@freescale.com>2015-03-30 02:53:28 (GMT)
commitdaf1c45f9e7215cc64af68f3b8eeadb2a2262031 (patch)
tree882bbe3acaa24519ea7602eebab28af5a2710657 /arch
parent8817884869da735d45a765a68f5f602557978c00 (diff)
downloadlinux-fsl-qoriq-daf1c45f9e7215cc64af68f3b8eeadb2a2262031.tar.xz
powerpc: Fix sys_call_table declaration to enable syscall tracing
Declaring sys_call_table as a pointer causes the compiler to generate the wrong lookup code in arch_syscall_addr(). <arch_syscall_addr>: lis r9,-16384 rlwinm r3,r3,2,0,29 - lwz r11,30640(r9) - lwzx r3,r11,r3 + addi r9,r9,30640 + lwzx r3,r9,r3 blr The actual sys_call_table symbol, declared in assembler, is an array. If we lie about that to the compiler we get the wrong code generated, as above. This definition seems only to be used by the syscall tracing code in kernel/trace/trace_syscalls.c. With this patch I can successfully use the syscall tracepoints: bash-3815 [002] .... 333.239082: sys_write -> 0x2 bash-3815 [002] .... 333.239087: sys_dup2(oldfd: a, newfd: 1) bash-3815 [002] .... 333.239088: sys_dup2 -> 0x1 bash-3815 [002] .... 333.239092: sys_fcntl(fd: a, cmd: 1, arg: 0) bash-3815 [002] .... 333.239093: sys_fcntl -> 0x1 bash-3815 [002] .... 333.239094: sys_close(fd: a) bash-3815 [002] .... 333.239094: sys_close -> 0x0 Signed-off-by: Romeo Cane <romeo.cane.ext@coriant.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> (cherry picked from commit 1028ccf560b97adbf272381a61a67e17d44d1054) Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Change-Id: I1754c0e1ca6c77cc56566bf50019c153ea405cbf Reviewed-on: http://git.am.freescale.net:8181/33026 Reviewed-by: Scott Wood <scottwood@freescale.com> Tested-by: Honghua Yin <Hong-Hua.Yin@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/syscall.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
index b54b2ad..528ba9d 100644
--- a/arch/powerpc/include/asm/syscall.h
+++ b/arch/powerpc/include/asm/syscall.h
@@ -17,7 +17,7 @@
/* ftrace syscalls requires exporting the sys_call_table */
#ifdef CONFIG_FTRACE_SYSCALLS
-extern const unsigned long *sys_call_table;
+extern const unsigned long sys_call_table[];
#endif /* CONFIG_FTRACE_SYSCALLS */
static inline long syscall_get_nr(struct task_struct *task,