Commit fcc19438 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Ingo Molnar

trace_syscalls: Remove enter_id exit_id

use ->enter_event->id instead of ->enter_id
use ->exit_event->id instead of ->exit_id
Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: default avatarJason Baron <jbaron@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4B14D288.7030001@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 31c16b13
...@@ -168,7 +168,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \ ...@@ -168,7 +168,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \
if (!id) \ if (!id) \
return -ENODEV; \ return -ENODEV; \
event_enter_##sname.id = id; \ event_enter_##sname.id = id; \
set_syscall_enter_id(num, id); \
INIT_LIST_HEAD(&event_enter_##sname.fields); \ INIT_LIST_HEAD(&event_enter_##sname.fields); \
return 0; \ return 0; \
} \ } \
...@@ -205,7 +204,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \ ...@@ -205,7 +204,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused) \
if (!id) \ if (!id) \
return -ENODEV; \ return -ENODEV; \
event_exit_##sname.id = id; \ event_exit_##sname.id = id; \
set_syscall_exit_id(num, id); \
INIT_LIST_HEAD(&event_exit_##sname.fields); \ INIT_LIST_HEAD(&event_exit_##sname.fields); \
return 0; \ return 0; \
} \ } \
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
* @nb_args: number of parameters it takes * @nb_args: number of parameters it takes
* @types: list of types as strings * @types: list of types as strings
* @args: list of args as strings (args[i] matches types[i]) * @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 * @enter_event: associated syscall_enter trace event
* @exit_event: associated syscall_exit trace event * @exit_event: associated syscall_exit trace event
*/ */
...@@ -25,8 +23,6 @@ struct syscall_metadata { ...@@ -25,8 +23,6 @@ struct syscall_metadata {
int nb_args; int nb_args;
const char **types; const char **types;
const char **args; const char **args;
int enter_id;
int exit_id;
struct ftrace_event_call *enter_event; struct ftrace_event_call *enter_event;
struct ftrace_event_call *exit_event; struct ftrace_event_call *exit_event;
...@@ -35,8 +31,6 @@ struct syscall_metadata { ...@@ -35,8 +31,6 @@ struct syscall_metadata {
#ifdef CONFIG_FTRACE_SYSCALLS #ifdef CONFIG_FTRACE_SYSCALLS
extern unsigned long arch_syscall_addr(int nr); extern unsigned long arch_syscall_addr(int nr);
extern int syscall_name_to_nr(const char *name); extern int syscall_name_to_nr(const char *name);
void set_syscall_enter_id(int num, int id);
void set_syscall_exit_id(int num, int id);
extern int syscall_enter_format(struct ftrace_event_call *call, extern int syscall_enter_format(struct ftrace_event_call *call,
struct trace_seq *s); struct trace_seq *s);
......
...@@ -67,16 +67,6 @@ int syscall_name_to_nr(const char *name) ...@@ -67,16 +67,6 @@ int syscall_name_to_nr(const char *name)
return -1; return -1;
} }
void set_syscall_enter_id(int num, int id)
{
syscalls_metadata[num]->enter_id = id;
}
void set_syscall_exit_id(int num, int id)
{
syscalls_metadata[num]->exit_id = id;
}
enum print_line_t enum print_line_t
print_syscall_enter(struct trace_iterator *iter, int flags) print_syscall_enter(struct trace_iterator *iter, int flags)
{ {
...@@ -93,7 +83,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags) ...@@ -93,7 +83,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags)
if (!entry) if (!entry)
goto end; goto end;
if (entry->enter_id != ent->type) { if (entry->enter_event->id != ent->type) {
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
goto end; goto end;
} }
...@@ -148,7 +138,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags) ...@@ -148,7 +138,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags)
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
} }
if (entry->exit_id != ent->type) { if (entry->exit_event->id != ent->type) {
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
return TRACE_TYPE_UNHANDLED; return TRACE_TYPE_UNHANDLED;
} }
...@@ -302,8 +292,8 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id) ...@@ -302,8 +292,8 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id)
size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args; size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args;
event = trace_current_buffer_lock_reserve(&buffer, sys_data->enter_id, event = trace_current_buffer_lock_reserve(&buffer,
size, 0, 0); sys_data->enter_event->id, size, 0, 0);
if (!event) if (!event)
return; return;
...@@ -334,8 +324,8 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret) ...@@ -334,8 +324,8 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret)
if (!sys_data) if (!sys_data)
return; return;
event = trace_current_buffer_lock_reserve(&buffer, sys_data->exit_id, event = trace_current_buffer_lock_reserve(&buffer,
sizeof(*entry), 0, 0); sys_data->exit_event->id, sizeof(*entry), 0, 0);
if (!event) if (!event)
return; return;
...@@ -510,11 +500,11 @@ static void prof_syscall_enter(struct pt_regs *regs, long id) ...@@ -510,11 +500,11 @@ static void prof_syscall_enter(struct pt_regs *regs, long id)
rec = (struct syscall_trace_enter *) raw_data; rec = (struct syscall_trace_enter *) raw_data;
tracing_generic_entry_update(&rec->ent, 0, 0); tracing_generic_entry_update(&rec->ent, 0, 0);
rec->ent.type = sys_data->enter_id; rec->ent.type = sys_data->enter_event->id;
rec->nr = syscall_nr; rec->nr = syscall_nr;
syscall_get_arguments(current, regs, 0, sys_data->nb_args, syscall_get_arguments(current, regs, 0, sys_data->nb_args,
(unsigned long *)&rec->args); (unsigned long *)&rec->args);
perf_tp_event(sys_data->enter_id, 0, 1, rec, size); perf_tp_event(sys_data->enter_event->id, 0, 1, rec, size);
end: end:
perf_swevent_put_recursion_context(rctx); perf_swevent_put_recursion_context(rctx);
...@@ -615,11 +605,11 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret) ...@@ -615,11 +605,11 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret)
rec = (struct syscall_trace_exit *)raw_data; rec = (struct syscall_trace_exit *)raw_data;
tracing_generic_entry_update(&rec->ent, 0, 0); tracing_generic_entry_update(&rec->ent, 0, 0);
rec->ent.type = sys_data->exit_id; rec->ent.type = sys_data->exit_event->id;
rec->nr = syscall_nr; rec->nr = syscall_nr;
rec->ret = syscall_get_return_value(current, regs); rec->ret = syscall_get_return_value(current, regs);
perf_tp_event(sys_data->exit_id, 0, 1, rec, size); perf_tp_event(sys_data->exit_event->id, 0, 1, rec, size);
end: end:
perf_swevent_put_recursion_context(rctx); perf_swevent_put_recursion_context(rctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment