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 /kernel/trace/trace_syscalls.c | |
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 'kernel/trace/trace_syscalls.c')
-rw-r--r-- | kernel/trace/trace_syscalls.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 46c1b977a2cb..2698fe401ebd 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <trace/syscall.h> | 1 | #include <trace/syscall.h> |
2 | #include <trace/events/syscalls.h> | ||
2 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
3 | #include <linux/ftrace.h> | 4 | #include <linux/ftrace.h> |
4 | #include <linux/perf_counter.h> | 5 | #include <linux/perf_counter.h> |
@@ -286,7 +287,7 @@ int reg_event_syscall_enter(void *ptr) | |||
286 | return -ENOSYS; | 287 | return -ENOSYS; |
287 | mutex_lock(&syscall_trace_lock); | 288 | mutex_lock(&syscall_trace_lock); |
288 | if (!sys_refcount_enter) | 289 | if (!sys_refcount_enter) |
289 | ret = register_trace_syscall_enter(ftrace_syscall_enter); | 290 | ret = register_trace_sys_enter(ftrace_syscall_enter); |
290 | if (ret) { | 291 | if (ret) { |
291 | pr_info("event trace: Could not activate" | 292 | pr_info("event trace: Could not activate" |
292 | "syscall entry trace point"); | 293 | "syscall entry trace point"); |
@@ -311,7 +312,7 @@ void unreg_event_syscall_enter(void *ptr) | |||
311 | sys_refcount_enter--; | 312 | sys_refcount_enter--; |
312 | clear_bit(num, enabled_enter_syscalls); | 313 | clear_bit(num, enabled_enter_syscalls); |
313 | if (!sys_refcount_enter) | 314 | if (!sys_refcount_enter) |
314 | unregister_trace_syscall_enter(ftrace_syscall_enter); | 315 | unregister_trace_sys_enter(ftrace_syscall_enter); |
315 | mutex_unlock(&syscall_trace_lock); | 316 | mutex_unlock(&syscall_trace_lock); |
316 | } | 317 | } |
317 | 318 | ||
@@ -327,7 +328,7 @@ int reg_event_syscall_exit(void *ptr) | |||
327 | return -ENOSYS; | 328 | return -ENOSYS; |
328 | mutex_lock(&syscall_trace_lock); | 329 | mutex_lock(&syscall_trace_lock); |
329 | if (!sys_refcount_exit) | 330 | if (!sys_refcount_exit) |
330 | ret = register_trace_syscall_exit(ftrace_syscall_exit); | 331 | ret = register_trace_sys_exit(ftrace_syscall_exit); |
331 | if (ret) { | 332 | if (ret) { |
332 | pr_info("event trace: Could not activate" | 333 | pr_info("event trace: Could not activate" |
333 | "syscall exit trace point"); | 334 | "syscall exit trace point"); |
@@ -352,7 +353,7 @@ void unreg_event_syscall_exit(void *ptr) | |||
352 | sys_refcount_exit--; | 353 | sys_refcount_exit--; |
353 | clear_bit(num, enabled_exit_syscalls); | 354 | clear_bit(num, enabled_exit_syscalls); |
354 | if (!sys_refcount_exit) | 355 | if (!sys_refcount_exit) |
355 | unregister_trace_syscall_exit(ftrace_syscall_exit); | 356 | unregister_trace_sys_exit(ftrace_syscall_exit); |
356 | mutex_unlock(&syscall_trace_lock); | 357 | mutex_unlock(&syscall_trace_lock); |
357 | } | 358 | } |
358 | 359 | ||
@@ -418,7 +419,7 @@ int reg_prof_syscall_enter(char *name) | |||
418 | 419 | ||
419 | mutex_lock(&syscall_trace_lock); | 420 | mutex_lock(&syscall_trace_lock); |
420 | if (!sys_prof_refcount_enter) | 421 | if (!sys_prof_refcount_enter) |
421 | ret = register_trace_syscall_enter(prof_syscall_enter); | 422 | ret = register_trace_sys_enter(prof_syscall_enter); |
422 | if (ret) { | 423 | if (ret) { |
423 | pr_info("event trace: Could not activate" | 424 | pr_info("event trace: Could not activate" |
424 | "syscall entry trace point"); | 425 | "syscall entry trace point"); |
@@ -442,7 +443,7 @@ void unreg_prof_syscall_enter(char *name) | |||
442 | sys_prof_refcount_enter--; | 443 | sys_prof_refcount_enter--; |
443 | clear_bit(num, enabled_prof_enter_syscalls); | 444 | clear_bit(num, enabled_prof_enter_syscalls); |
444 | if (!sys_prof_refcount_enter) | 445 | if (!sys_prof_refcount_enter) |
445 | unregister_trace_syscall_enter(prof_syscall_enter); | 446 | unregister_trace_sys_enter(prof_syscall_enter); |
446 | mutex_unlock(&syscall_trace_lock); | 447 | mutex_unlock(&syscall_trace_lock); |
447 | } | 448 | } |
448 | 449 | ||
@@ -479,7 +480,7 @@ int reg_prof_syscall_exit(char *name) | |||
479 | 480 | ||
480 | mutex_lock(&syscall_trace_lock); | 481 | mutex_lock(&syscall_trace_lock); |
481 | if (!sys_prof_refcount_exit) | 482 | if (!sys_prof_refcount_exit) |
482 | ret = register_trace_syscall_exit(prof_syscall_exit); | 483 | ret = register_trace_sys_exit(prof_syscall_exit); |
483 | if (ret) { | 484 | if (ret) { |
484 | pr_info("event trace: Could not activate" | 485 | pr_info("event trace: Could not activate" |
485 | "syscall entry trace point"); | 486 | "syscall entry trace point"); |
@@ -503,7 +504,7 @@ void unreg_prof_syscall_exit(char *name) | |||
503 | sys_prof_refcount_exit--; | 504 | sys_prof_refcount_exit--; |
504 | clear_bit(num, enabled_prof_exit_syscalls); | 505 | clear_bit(num, enabled_prof_exit_syscalls); |
505 | if (!sys_prof_refcount_exit) | 506 | if (!sys_prof_refcount_exit) |
506 | unregister_trace_syscall_exit(prof_syscall_exit); | 507 | unregister_trace_sys_exit(prof_syscall_exit); |
507 | mutex_unlock(&syscall_trace_lock); | 508 | mutex_unlock(&syscall_trace_lock); |
508 | } | 509 | } |
509 | 510 | ||