summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2009-12-01 16:23:30 +0800
committerIngo Molnar <mingo@elte.hu>2009-12-01 17:33:28 +0100
commit31c16b13349970b2684248c7d8608d2a96ae135d (patch)
tree0f0a2bee35f604090b30d6724e13bb2faec8a6a5 /kernel/trace
parentbf56a4ea9f1683c5b223fd3a5dbea23f1fa91c34 (diff)
downloadlinux-31c16b13349970b2684248c7d8608d2a96ae135d.tar.bz2
trace_syscalls: Set event_enter_##sname->data to its metadata
Set event_enter_##sname->data to its metadata, it makes codes simpler. 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: <4B14D282.7050709@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_syscalls.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 00d6e176f5b6..39649b1675dd 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -51,7 +51,7 @@ static struct syscall_metadata *syscall_nr_to_meta(int nr)
return syscalls_metadata[nr];
}
-int syscall_name_to_nr(char *name)
+int syscall_name_to_nr(const char *name)
{
int i;
@@ -172,18 +172,11 @@ extern char *__bad_type_size(void);
int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
{
int i;
- int nr;
int ret;
- struct syscall_metadata *entry;
+ struct syscall_metadata *entry = call->data;
struct syscall_trace_enter trace;
int offset = offsetof(struct syscall_trace_enter, args);
- nr = syscall_name_to_nr(call->data);
- entry = syscall_nr_to_meta(nr);
-
- if (!entry)
- return 0;
-
ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
"\tsigned:%u;\n",
SYSCALL_FIELD(int, nr));
@@ -245,18 +238,11 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
int syscall_enter_define_fields(struct ftrace_event_call *call)
{
struct syscall_trace_enter trace;
- struct syscall_metadata *meta;
+ struct syscall_metadata *meta = call->data;
int ret;
- int nr;
int i;
int offset = offsetof(typeof(trace), args);
- nr = syscall_name_to_nr(call->data);
- meta = syscall_nr_to_meta(nr);
-
- if (!meta)
- return 0;
-
ret = trace_define_common_fields(call);
if (ret)
return ret;
@@ -366,9 +352,9 @@ int reg_event_syscall_enter(struct ftrace_event_call *call)
{
int ret = 0;
int num;
- char *name;
+ const char *name;
- name = (char *)call->data;
+ name = ((struct syscall_metadata *)call->data)->name;
num = syscall_name_to_nr(name);
if (num < 0 || num >= NR_syscalls)
return -ENOSYS;
@@ -389,9 +375,9 @@ int reg_event_syscall_enter(struct ftrace_event_call *call)
void unreg_event_syscall_enter(struct ftrace_event_call *call)
{
int num;
- char *name;
+ const char *name;
- name = (char *)call->data;
+ name = ((struct syscall_metadata *)call->data)->name;
num = syscall_name_to_nr(name);
if (num < 0 || num >= NR_syscalls)
return;
@@ -407,9 +393,9 @@ int reg_event_syscall_exit(struct ftrace_event_call *call)
{
int ret = 0;
int num;
- char *name;
+ const char *name;
- name = call->data;
+ name = ((struct syscall_metadata *)call->data)->name;
num = syscall_name_to_nr(name);
if (num < 0 || num >= NR_syscalls)
return -ENOSYS;
@@ -430,9 +416,9 @@ int reg_event_syscall_exit(struct ftrace_event_call *call)
void unreg_event_syscall_exit(struct ftrace_event_call *call)
{
int num;
- char *name;
+ const char *name;
- name = call->data;
+ name = ((struct syscall_metadata *)call->data)->name;
num = syscall_name_to_nr(name);
if (num < 0 || num >= NR_syscalls)
return;