diff options
author | Jason Baron <jbaron@redhat.com> | 2009-08-10 16:52:53 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-08-11 14:35:28 -0400 |
commit | 64c12e0444fcc6b75eb49144ba46d43dbdc6bc8f (patch) | |
tree | 8fe7b546fe787061fca8f97ed2051f40f9b16a57 /include/linux | |
parent | fb34a08c3469b2be9eae626ccb96476b4687b810 (diff) |
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>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/syscalls.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 5e5b4d33a31c..ce4b01c658eb 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -116,13 +116,20 @@ struct perf_counter_attr; | |||
116 | 116 | ||
117 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 117 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
118 | static struct ftrace_event_call event_enter_##sname; \ | 118 | static struct ftrace_event_call event_enter_##sname; \ |
119 | struct trace_event enter_syscall_print_##sname = { \ | ||
120 | .trace = print_syscall_enter, \ | ||
121 | }; \ | ||
119 | static int init_enter_##sname(void) \ | 122 | static int init_enter_##sname(void) \ |
120 | { \ | 123 | { \ |
121 | int num; \ | 124 | int num, id; \ |
122 | num = syscall_name_to_nr("sys"#sname); \ | 125 | num = syscall_name_to_nr("sys"#sname); \ |
123 | if (num < 0) \ | 126 | if (num < 0) \ |
124 | return -ENOSYS; \ | 127 | return -ENOSYS; \ |
125 | register_ftrace_event(&event_syscall_enter); \ | 128 | id = register_ftrace_event(&enter_syscall_print_##sname);\ |
129 | if (!id) \ | ||
130 | return -ENODEV; \ | ||
131 | event_enter_##sname.id = id; \ | ||
132 | set_syscall_enter_id(num, id); \ | ||
126 | INIT_LIST_HEAD(&event_enter_##sname.fields); \ | 133 | INIT_LIST_HEAD(&event_enter_##sname.fields); \ |
127 | init_preds(&event_enter_##sname); \ | 134 | init_preds(&event_enter_##sname); \ |
128 | return 0; \ | 135 | return 0; \ |
@@ -142,13 +149,20 @@ struct perf_counter_attr; | |||
142 | 149 | ||
143 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 150 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
144 | static struct ftrace_event_call event_exit_##sname; \ | 151 | static struct ftrace_event_call event_exit_##sname; \ |
152 | struct trace_event exit_syscall_print_##sname = { \ | ||
153 | .trace = print_syscall_exit, \ | ||
154 | }; \ | ||
145 | static int init_exit_##sname(void) \ | 155 | static int init_exit_##sname(void) \ |
146 | { \ | 156 | { \ |
147 | int num; \ | 157 | int num, id; \ |
148 | num = syscall_name_to_nr("sys"#sname); \ | 158 | num = syscall_name_to_nr("sys"#sname); \ |
149 | if (num < 0) \ | 159 | if (num < 0) \ |
150 | return -ENOSYS; \ | 160 | return -ENOSYS; \ |
151 | register_ftrace_event(&event_syscall_exit); \ | 161 | id = register_ftrace_event(&exit_syscall_print_##sname);\ |
162 | if (!id) \ | ||
163 | return -ENODEV; \ | ||
164 | event_exit_##sname.id = id; \ | ||
165 | set_syscall_exit_id(num, id); \ | ||
152 | INIT_LIST_HEAD(&event_exit_##sname.fields); \ | 166 | INIT_LIST_HEAD(&event_exit_##sname.fields); \ |
153 | init_preds(&event_exit_##sname); \ | 167 | init_preds(&event_exit_##sname); \ |
154 | return 0; \ | 168 | return 0; \ |