Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f66e06f authored by Wade Farnsworth's avatar Wade Farnsworth Committed by Russell King
Browse files

ARM: 7524/1: support syscall tracing



As specified by ftrace-design.txt, TIF_SYSCALL_TRACEPOINT was
added, as well as NR_syscalls in asm/unistd.h.  Additionally,
__sys_trace was modified to call trace_sys_enter and
trace_sys_exit when appropriate.

Tests #2 - #4 of "perf test" now complete successfully.

Signed-off-by: default avatarSteven Walter <stevenrwalter@gmail.com>
Signed-off-by: default avatarWade Farnsworth <wade_farnsworth@mentor.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 5698bd75
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ config ARM
	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
	select HAVE_ARCH_KGDB
	select HAVE_ARCH_TRACEHOOK
	select HAVE_SYSCALL_TRACEPOINTS
	select HAVE_KPROBES if !XIP_KERNEL
	select HAVE_KRETPROBES if (HAVE_KPROBES)
	select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@

#include <linux/err.h>

#include <asm/unistd.h>

#define NR_syscalls (__NR_syscalls)

extern const unsigned long sys_call_table[];

static inline int syscall_get_nr(struct task_struct *task,
+3 −1
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define TIF_NOTIFY_RESUME	2	/* callback before returning to user */
#define TIF_SYSCALL_TRACE	8
#define TIF_SYSCALL_AUDIT	9
#define TIF_SYSCALL_TRACEPOINT	10
#define TIF_POLLING_NRFLAG	16
#define TIF_USING_IWMMXT	17
#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
@@ -160,12 +161,13 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
#define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT)
#define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
#define _TIF_USING_IWMMXT	(1 << TIF_USING_IWMMXT)
#define _TIF_SECCOMP		(1 << TIF_SECCOMP)

/* Checks for any syscall work in entry-common.S */
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT)

/*
 * Change these and you break ASM code in entry-common.S
+8 −0
Original line number Diff line number Diff line
@@ -405,6 +405,14 @@
#define __NR_process_vm_readv		(__NR_SYSCALL_BASE+376)
#define __NR_process_vm_writev		(__NR_SYSCALL_BASE+377)

/*
 * This may need to be greater than __NR_last_syscall+1 in order to
 * account for the padding in the syscall table
 */
#ifdef __KERNEL__
#define __NR_syscalls  (380)
#endif /* __KERNEL__ */

/*
 * The following SWIs are ARM private.
 */
+9 −0
Original line number Diff line number Diff line
@@ -94,6 +94,15 @@ ENDPROC(ret_from_fork)
	.equ NR_syscalls,0
#define CALL(x) .equ NR_syscalls,NR_syscalls+1
#include "calls.S"

/*
 * Ensure that the system call table is equal to __NR_syscalls,
 * which is the value the rest of the system sees
 */
.ifne NR_syscalls - __NR_syscalls
.error "__NR_syscalls is not equal to the size of the syscall table"
.endif

#undef CALL
#define CALL(x) .long x

Loading