aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJason Baron <jbaron@redhat.com>2009-08-10 16:52:31 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-08-11 14:35:26 -0400
commita871bd33a6c0bc86fb47cd02ea2650dd43d3d95f (patch)
treeb5720cdb3168ba0894b4bd2c1acc004cb19a692c /arch
parent63fbdab3157b72467013fe4dcf88c85e45280ef7 (diff)
tracing: Add syscall tracepoints
add two tracepoints in syscall exit and entry path, conditioned on TIF_SYSCALL_FTRACE. Supports the syscall trace event code. Signed-off-by: Jason Baron <jbaron@redhat.com> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Jiaying Zhang <jiayingz@google.com> Cc: Martin Bligh <mbligh@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/ptrace.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 09ecbde91c13..34dd6f15185d 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -37,6 +37,9 @@
37 37
38#include <trace/syscall.h> 38#include <trace/syscall.h>
39 39
40DEFINE_TRACE(syscall_enter);
41DEFINE_TRACE(syscall_exit);
42
40#include "tls.h" 43#include "tls.h"
41 44
42enum x86_regset { 45enum x86_regset {
@@ -1498,7 +1501,7 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs)
1498 ret = -1L; 1501 ret = -1L;
1499 1502
1500 if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE))) 1503 if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE)))
1501 ftrace_syscall_enter(regs); 1504 trace_syscall_enter(regs, regs->orig_ax);
1502 1505
1503 if (unlikely(current->audit_context)) { 1506 if (unlikely(current->audit_context)) {
1504 if (IS_IA32) 1507 if (IS_IA32)
@@ -1524,7 +1527,7 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs)
1524 audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); 1527 audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax);
1525 1528
1526 if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE))) 1529 if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE)))
1527 ftrace_syscall_exit(regs); 1530 trace_syscall_exit(regs, regs->ax);
1528 1531
1529 if (test_thread_flag(TIF_SYSCALL_TRACE)) 1532 if (test_thread_flag(TIF_SYSCALL_TRACE))
1530 tracehook_report_syscall_exit(regs, 0); 1533 tracehook_report_syscall_exit(regs, 0);