bd1a5c849b
Add dynamic ftrace_event_call support to ftrace. Trace engines can add
new ftrace_event_call to ftrace on the fly. Each operator function of
the call takes an ftrace_event_call data structure as an argument,
because these functions may be shared among several ftrace_event_calls.
Changes from v13:
- Define remove_subsystem_dir() always (revirt a2ca5e03
), because
trace_remove_event_call() uses it.
- Modify syscall tracer because of ftrace_event_call change.
[fweisbec@gmail.com: Fixed conflict against latest tracing/core]
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
Cc: Roland McGrath <roland@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
LKML-Reference: <20090813203453.31965.71901.stgit@localhost.localdomain>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
67 lines
2.2 KiB
C
67 lines
2.2 KiB
C
#ifndef _TRACE_SYSCALL_H
|
|
#define _TRACE_SYSCALL_H
|
|
|
|
#include <linux/tracepoint.h>
|
|
#include <linux/unistd.h>
|
|
#include <linux/ftrace_event.h>
|
|
|
|
#include <asm/ptrace.h>
|
|
|
|
|
|
/*
|
|
* A syscall entry in the ftrace syscalls array.
|
|
*
|
|
* @name: name of the syscall
|
|
* @nb_args: number of parameters it takes
|
|
* @types: list of types as strings
|
|
* @args: list of args as strings (args[i] matches types[i])
|
|
* @enter_id: associated ftrace enter event id
|
|
* @exit_id: associated ftrace exit event id
|
|
* @enter_event: associated syscall_enter trace event
|
|
* @exit_event: associated syscall_exit trace event
|
|
*/
|
|
struct syscall_metadata {
|
|
const char *name;
|
|
int nb_args;
|
|
const char **types;
|
|
const char **args;
|
|
int enter_id;
|
|
int exit_id;
|
|
|
|
struct ftrace_event_call *enter_event;
|
|
struct ftrace_event_call *exit_event;
|
|
};
|
|
|
|
#ifdef CONFIG_FTRACE_SYSCALLS
|
|
extern struct syscall_metadata *syscall_nr_to_meta(int nr);
|
|
extern int syscall_name_to_nr(char *name);
|
|
void set_syscall_enter_id(int num, int id);
|
|
void set_syscall_exit_id(int num, int id);
|
|
extern struct trace_event event_syscall_enter;
|
|
extern struct trace_event event_syscall_exit;
|
|
|
|
extern int syscall_enter_format(struct ftrace_event_call *call,
|
|
struct trace_seq *s);
|
|
extern int syscall_exit_format(struct ftrace_event_call *call,
|
|
struct trace_seq *s);
|
|
extern int syscall_enter_define_fields(struct ftrace_event_call *call);
|
|
extern int syscall_exit_define_fields(struct ftrace_event_call *call);
|
|
extern int reg_event_syscall_enter(struct ftrace_event_call *call);
|
|
extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
|
|
extern int reg_event_syscall_exit(struct ftrace_event_call *call);
|
|
extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
|
|
extern int
|
|
ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
|
|
enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags);
|
|
enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
|
|
#endif
|
|
#ifdef CONFIG_EVENT_PROFILE
|
|
int reg_prof_syscall_enter(char *name);
|
|
void unreg_prof_syscall_enter(char *name);
|
|
int reg_prof_syscall_exit(char *name);
|
|
void unreg_prof_syscall_exit(char *name);
|
|
|
|
#endif
|
|
|
|
#endif /* _TRACE_SYSCALL_H */
|