diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-03-13 10:42:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-13 11:57:42 -0400 |
commit | bed1ffca022cc876fb83161d26670e9b5d3cf36b (patch) | |
tree | a896c79e9ea1af11f992826f1de7e2ece52fbe33 /include/linux/ftrace.h | |
parent | f58ba100678f421bdcb000a3c71793f432dfab93 (diff) |
tracing/syscalls: core infrastructure for syscalls tracing, enhancements
Impact: new feature
This adds the generic support for syscalls tracing. This is
currently exploited through a devoted tracer but other tracing
engines can use it. (They just have to play with
{start,stop}_ftrace_syscalls() and use the display callbacks
unless they want to override them.)
The syscalls prototypes definitions are abused here to steal
some metadata informations:
- syscall name, param types, param names, number of params
The syscall addr is not directly saved during this definition
because we don't know if its prototype is available in the
namespace. But we don't really need it. The arch has just to
build a function able to resolve the syscall number to its
metadata struct.
The current tracer prints the syscall names, parameters names
and values (and their types optionally). Currently the value is
a raw hex but higher level values diplaying is on my TODO list.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1236955332-10133-2-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index c146c1021a29..6dc1c652447e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -506,13 +506,21 @@ static inline void trace_hw_branch_oops(void) {} | |||
506 | /* | 506 | /* |
507 | * A syscall entry in the ftrace syscalls array. | 507 | * A syscall entry in the ftrace syscalls array. |
508 | * | 508 | * |
509 | * @syscall_nr: syscall number | 509 | * @name: name of the syscall |
510 | * @nb_args: number of parameters it takes | ||
511 | * @types: list of types as strings | ||
512 | * @args: list of args as strings (args[i] matches types[i]) | ||
510 | */ | 513 | */ |
511 | struct syscall_trace_entry { | 514 | struct syscall_metadata { |
512 | int syscall_nr; | 515 | const char *name; |
516 | int nb_args; | ||
517 | const char **types; | ||
518 | const char **args; | ||
513 | }; | 519 | }; |
514 | 520 | ||
515 | #ifdef CONFIG_FTRACE_SYSCALLS | 521 | #ifdef CONFIG_FTRACE_SYSCALLS |
522 | extern void arch_init_ftrace_syscalls(void); | ||
523 | extern struct syscall_metadata *syscall_nr_to_meta(int nr); | ||
516 | extern void start_ftrace_syscalls(void); | 524 | extern void start_ftrace_syscalls(void); |
517 | extern void stop_ftrace_syscalls(void); | 525 | extern void stop_ftrace_syscalls(void); |
518 | extern void ftrace_syscall_enter(struct pt_regs *regs); | 526 | extern void ftrace_syscall_enter(struct pt_regs *regs); |