diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-12-01 03:23:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-01 11:33:29 -0500 |
commit | c252f65793874b56d50395ab604db465ce688665 (patch) | |
tree | 30bc32361d2b368679910270ec4e99e841fa099b /include | |
parent | fcc19438dda38dacc8c144e2db3ebc6b9fd4f8b8 (diff) |
trace_syscalls: Add syscall_nr field to struct syscall_metadata
Add syscall_nr field to struct syscall_metadata,
it helps us to get syscall number easier.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4B14D293.6090800@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/syscalls.h | 4 | ||||
-rw-r--r-- | include/trace/syscall.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b9af87560adb..3c280d7ecb76 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -161,7 +161,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \ | |||
161 | static int init_enter_##sname(struct ftrace_event_call *call) \ | 161 | static int init_enter_##sname(struct ftrace_event_call *call) \ |
162 | { \ | 162 | { \ |
163 | int num, id; \ | 163 | int num, id; \ |
164 | num = syscall_name_to_nr("sys"#sname); \ | 164 | num = __syscall_meta_##sname.syscall_nr; \ |
165 | if (num < 0) \ | 165 | if (num < 0) \ |
166 | return -ENOSYS; \ | 166 | return -ENOSYS; \ |
167 | id = register_ftrace_event(&enter_syscall_print_##sname);\ | 167 | id = register_ftrace_event(&enter_syscall_print_##sname);\ |
@@ -197,7 +197,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \ | |||
197 | static int init_exit_##sname(struct ftrace_event_call *call) \ | 197 | static int init_exit_##sname(struct ftrace_event_call *call) \ |
198 | { \ | 198 | { \ |
199 | int num, id; \ | 199 | int num, id; \ |
200 | num = syscall_name_to_nr("sys"#sname); \ | 200 | num = __syscall_meta_##sname.syscall_nr; \ |
201 | if (num < 0) \ | 201 | if (num < 0) \ |
202 | return -ENOSYS; \ | 202 | return -ENOSYS; \ |
203 | id = register_ftrace_event(&exit_syscall_print_##sname);\ | 203 | id = register_ftrace_event(&exit_syscall_print_##sname);\ |
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index ca09561cd578..1531eef3071f 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
@@ -12,6 +12,7 @@ | |||
12 | * A syscall entry in the ftrace syscalls array. | 12 | * A syscall entry in the ftrace syscalls array. |
13 | * | 13 | * |
14 | * @name: name of the syscall | 14 | * @name: name of the syscall |
15 | * @syscall_nr: number of the syscall | ||
15 | * @nb_args: number of parameters it takes | 16 | * @nb_args: number of parameters it takes |
16 | * @types: list of types as strings | 17 | * @types: list of types as strings |
17 | * @args: list of args as strings (args[i] matches types[i]) | 18 | * @args: list of args as strings (args[i] matches types[i]) |
@@ -20,6 +21,7 @@ | |||
20 | */ | 21 | */ |
21 | struct syscall_metadata { | 22 | struct syscall_metadata { |
22 | const char *name; | 23 | const char *name; |
24 | int syscall_nr; | ||
23 | int nb_args; | 25 | int nb_args; |
24 | const char **types; | 26 | const char **types; |
25 | const char **args; | 27 | const char **args; |
@@ -30,7 +32,6 @@ struct syscall_metadata { | |||
30 | 32 | ||
31 | #ifdef CONFIG_FTRACE_SYSCALLS | 33 | #ifdef CONFIG_FTRACE_SYSCALLS |
32 | extern unsigned long arch_syscall_addr(int nr); | 34 | extern unsigned long arch_syscall_addr(int nr); |
33 | extern int syscall_name_to_nr(const char *name); | ||
34 | 35 | ||
35 | extern int syscall_enter_format(struct ftrace_event_call *call, | 36 | extern int syscall_enter_format(struct ftrace_event_call *call, |
36 | struct trace_seq *s); | 37 | struct trace_seq *s); |