diff options
author | Josh Stone <jistone@redhat.com> | 2009-08-24 17:43:14 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-08-25 18:41:48 -0400 |
commit | 1c569f0264ea629c10bbab471dd0626ce4d3f19f (patch) | |
tree | 00fcbf85a7318c568f468518c3aa665a200c871e /arch | |
parent | 97419875865859fd2403e66266c02ce028e2f5ab (diff) |
tracing: Create generic syscall TRACE_EVENTs
This converts the syscall_enter/exit tracepoints into TRACE_EVENTs, so
you can have generic ftrace events that capture all system calls with
arguments and return values. These generic events are also renamed to
sys_enter/exit, so they're more closely aligned to the specific
sys_enter_foo events.
Signed-off-by: Josh Stone <jistone@redhat.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Li Zefan <lizf@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: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
LKML-Reference: <1251150194-1713-5-git-send-email-jistone@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/ptrace.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace.c | 12 |
2 files changed, 9 insertions, 11 deletions
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index c05b44b80c23..f3ddd7ac06c5 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -51,8 +51,8 @@ | |||
51 | #include "compat_ptrace.h" | 51 | #include "compat_ptrace.h" |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | DEFINE_TRACE_FN(syscall_enter, syscall_regfunc, syscall_unregfunc); | 54 | #define CREATE_TRACE_POINTS |
55 | DEFINE_TRACE_FN(syscall_exit, syscall_regfunc, syscall_unregfunc); | 55 | #include <trace/events/syscalls.h> |
56 | 56 | ||
57 | enum s390_regset { | 57 | enum s390_regset { |
58 | REGSET_GENERAL, | 58 | REGSET_GENERAL, |
@@ -665,7 +665,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | |||
665 | } | 665 | } |
666 | 666 | ||
667 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 667 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
668 | trace_syscall_enter(regs, regs->gprs[2]); | 668 | trace_sys_enter(regs, regs->gprs[2]); |
669 | 669 | ||
670 | if (unlikely(current->audit_context)) | 670 | if (unlikely(current->audit_context)) |
671 | audit_syscall_entry(is_compat_task() ? | 671 | audit_syscall_entry(is_compat_task() ? |
@@ -683,7 +683,7 @@ asmlinkage void do_syscall_trace_exit(struct pt_regs *regs) | |||
683 | regs->gprs[2]); | 683 | regs->gprs[2]); |
684 | 684 | ||
685 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 685 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
686 | trace_syscall_exit(regs, regs->gprs[2]); | 686 | trace_sys_exit(regs, regs->gprs[2]); |
687 | 687 | ||
688 | if (test_thread_flag(TIF_SYSCALL_TRACE)) | 688 | if (test_thread_flag(TIF_SYSCALL_TRACE)) |
689 | tracehook_report_syscall_exit(regs, 0); | 689 | tracehook_report_syscall_exit(regs, 0); |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 31e9b97ec4d6..8d7d5c9c1be3 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -35,13 +35,11 @@ | |||
35 | #include <asm/proto.h> | 35 | #include <asm/proto.h> |
36 | #include <asm/ds.h> | 36 | #include <asm/ds.h> |
37 | 37 | ||
38 | #include <trace/syscall.h> | ||
39 | |||
40 | DEFINE_TRACE_FN(syscall_enter, syscall_regfunc, syscall_unregfunc); | ||
41 | DEFINE_TRACE_FN(syscall_exit, syscall_regfunc, syscall_unregfunc); | ||
42 | |||
43 | #include "tls.h" | 38 | #include "tls.h" |
44 | 39 | ||
40 | #define CREATE_TRACE_POINTS | ||
41 | #include <trace/events/syscalls.h> | ||
42 | |||
45 | enum x86_regset { | 43 | enum x86_regset { |
46 | REGSET_GENERAL, | 44 | REGSET_GENERAL, |
47 | REGSET_FP, | 45 | REGSET_FP, |
@@ -1501,7 +1499,7 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs) | |||
1501 | ret = -1L; | 1499 | ret = -1L; |
1502 | 1500 | ||
1503 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 1501 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
1504 | trace_syscall_enter(regs, regs->orig_ax); | 1502 | trace_sys_enter(regs, regs->orig_ax); |
1505 | 1503 | ||
1506 | if (unlikely(current->audit_context)) { | 1504 | if (unlikely(current->audit_context)) { |
1507 | if (IS_IA32) | 1505 | if (IS_IA32) |
@@ -1527,7 +1525,7 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs) | |||
1527 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); | 1525 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); |
1528 | 1526 | ||
1529 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 1527 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
1530 | trace_syscall_exit(regs, regs->ax); | 1528 | trace_sys_exit(regs, regs->ax); |
1531 | 1529 | ||
1532 | if (test_thread_flag(TIF_SYSCALL_TRACE)) | 1530 | if (test_thread_flag(TIF_SYSCALL_TRACE)) |
1533 | tracehook_report_syscall_exit(regs, 0); | 1531 | tracehook_report_syscall_exit(regs, 0); |