tracing: Add individual syscalls tracepoint id support
The current state of syscalls tracepoints generates only one event id for every syscall events. This patch associates an id with each syscall trace event, so that we can identify each syscall trace event using the 'perf' tool. 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>
This commit is contained in:
committed by
Frederic Weisbecker
parent
fb34a08c34
commit
64c12e0444
@ -116,13 +116,20 @@ struct perf_counter_attr;
|
||||
|
||||
#define SYSCALL_TRACE_ENTER_EVENT(sname) \
|
||||
static struct ftrace_event_call event_enter_##sname; \
|
||||
struct trace_event enter_syscall_print_##sname = { \
|
||||
.trace = print_syscall_enter, \
|
||||
}; \
|
||||
static int init_enter_##sname(void) \
|
||||
{ \
|
||||
int num; \
|
||||
int num, id; \
|
||||
num = syscall_name_to_nr("sys"#sname); \
|
||||
if (num < 0) \
|
||||
return -ENOSYS; \
|
||||
register_ftrace_event(&event_syscall_enter); \
|
||||
id = register_ftrace_event(&enter_syscall_print_##sname);\
|
||||
if (!id) \
|
||||
return -ENODEV; \
|
||||
event_enter_##sname.id = id; \
|
||||
set_syscall_enter_id(num, id); \
|
||||
INIT_LIST_HEAD(&event_enter_##sname.fields); \
|
||||
init_preds(&event_enter_##sname); \
|
||||
return 0; \
|
||||
@ -142,13 +149,20 @@ struct perf_counter_attr;
|
||||
|
||||
#define SYSCALL_TRACE_EXIT_EVENT(sname) \
|
||||
static struct ftrace_event_call event_exit_##sname; \
|
||||
struct trace_event exit_syscall_print_##sname = { \
|
||||
.trace = print_syscall_exit, \
|
||||
}; \
|
||||
static int init_exit_##sname(void) \
|
||||
{ \
|
||||
int num; \
|
||||
int num, id; \
|
||||
num = syscall_name_to_nr("sys"#sname); \
|
||||
if (num < 0) \
|
||||
return -ENOSYS; \
|
||||
register_ftrace_event(&event_syscall_exit); \
|
||||
id = register_ftrace_event(&exit_syscall_print_##sname);\
|
||||
if (!id) \
|
||||
return -ENODEV; \
|
||||
event_exit_##sname.id = id; \
|
||||
set_syscall_exit_id(num, id); \
|
||||
INIT_LIST_HEAD(&event_exit_##sname.fields); \
|
||||
init_preds(&event_exit_##sname); \
|
||||
return 0; \
|
||||
|
Reference in New Issue
Block a user