Commit 69fd4f0e authored by Jason Baron's avatar Jason Baron Committed by Frederic Weisbecker

tracing: Add ftrace_event_call void * 'data' field

add an optional void * pointer to 'ftrace_event_call' that is
passed in for regfunc and unregfunc.

This prepares for syscall tracepoints creation by passing the name of
the syscall we want to trace and then retrieve its number through our
arch syscall table.
Signed-off-by: default avatarJason 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: default avatarFrederic Weisbecker <fweisbec@gmail.com>
parent f744bd57
...@@ -112,8 +112,8 @@ struct ftrace_event_call { ...@@ -112,8 +112,8 @@ struct ftrace_event_call {
struct dentry *dir; struct dentry *dir;
struct trace_event *event; struct trace_event *event;
int enabled; int enabled;
int (*regfunc)(void); int (*regfunc)(void *);
void (*unregfunc)(void); void (*unregfunc)(void *);
int id; int id;
int (*raw_init)(void); int (*raw_init)(void);
int (*show_format)(struct trace_seq *s); int (*show_format)(struct trace_seq *s);
...@@ -122,6 +122,7 @@ struct ftrace_event_call { ...@@ -122,6 +122,7 @@ struct ftrace_event_call {
int filter_active; int filter_active;
struct event_filter *filter; struct event_filter *filter;
void *mod; void *mod;
void *data;
atomic_t profile_count; atomic_t profile_count;
int (*profile_enable)(struct ftrace_event_call *); int (*profile_enable)(struct ftrace_event_call *);
......
...@@ -568,7 +568,7 @@ static void ftrace_raw_event_##call(proto) \ ...@@ -568,7 +568,7 @@ static void ftrace_raw_event_##call(proto) \
trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
} \ } \
\ \
static int ftrace_raw_reg_event_##call(void) \ static int ftrace_raw_reg_event_##call(void *ptr) \
{ \ { \
int ret; \ int ret; \
\ \
...@@ -579,7 +579,7 @@ static int ftrace_raw_reg_event_##call(void) \ ...@@ -579,7 +579,7 @@ static int ftrace_raw_reg_event_##call(void) \
return ret; \ return ret; \
} \ } \
\ \
static void ftrace_raw_unreg_event_##call(void) \ static void ftrace_raw_unreg_event_##call(void *ptr) \
{ \ { \
unregister_trace_##call(ftrace_raw_event_##call); \ unregister_trace_##call(ftrace_raw_event_##call); \
} \ } \
......
...@@ -86,14 +86,14 @@ static void ftrace_event_enable_disable(struct ftrace_event_call *call, ...@@ -86,14 +86,14 @@ static void ftrace_event_enable_disable(struct ftrace_event_call *call,
if (call->enabled) { if (call->enabled) {
call->enabled = 0; call->enabled = 0;
tracing_stop_cmdline_record(); tracing_stop_cmdline_record();
call->unregfunc(); call->unregfunc(call->data);
} }
break; break;
case 1: case 1:
if (!call->enabled) { if (!call->enabled) {
call->enabled = 1; call->enabled = 1;
tracing_start_cmdline_record(); tracing_start_cmdline_record();
call->regfunc(); call->regfunc(call->data);
} }
break; break;
} }
......
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