tracing: Add ftrace_event_call void * 'data' field
authorJason Baron <jbaron@redhat.com>
Mon, 10 Aug 2009 20:52:44 +0000 (16:52 -0400)
committerFrederic Weisbecker <fweisbec@gmail.com>
Tue, 11 Aug 2009 18:35:27 +0000 (20:35 +0200)
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: 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>
include/linux/ftrace_event.h
include/trace/ftrace.h
kernel/trace/trace_events.c

index ac8c6f8cf242e39bd6e489221f91014dbfe10d55..8544f121d9f119b51d972647f685fa25a41612ab 100644 (file)
@@ -112,8 +112,8 @@ struct ftrace_event_call {
        struct dentry           *dir;
        struct trace_event      *event;
        int                     enabled;
-       int                     (*regfunc)(void);
-       void                    (*unregfunc)(void);
+       int                     (*regfunc)(void *);
+       void                    (*unregfunc)(void *);
        int                     id;
        int                     (*raw_init)(void);
        int                     (*show_format)(struct trace_seq *s);
@@ -122,6 +122,7 @@ struct ftrace_event_call {
        int                     filter_active;
        struct event_filter     *filter;
        void                    *mod;
+       void                    *data;
 
        atomic_t                profile_count;
        int                     (*profile_enable)(struct ftrace_event_call *);
index 25d3b02a06f8a52f3a624d8f9a99c89ef883984e..46d81b5e86102fa50e64c41ccb71ef73e4d3fe03 100644 (file)
@@ -568,7 +568,7 @@ static void ftrace_raw_event_##call(proto)                          \
                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;                                                        \
                                                                        \
@@ -579,7 +579,7 @@ static int ftrace_raw_reg_event_##call(void)                                \
        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);               \
 }                                                                      \
index f95f8470dd3811dbead4bdc1367d91a30914afa6..1d289e2d66930f2fb926310c69059625dcd7f33c 100644 (file)
@@ -86,14 +86,14 @@ static void ftrace_event_enable_disable(struct ftrace_event_call *call,
                if (call->enabled) {
                        call->enabled = 0;
                        tracing_stop_cmdline_record();
-                       call->unregfunc();
+                       call->unregfunc(call->data);
                }
                break;
        case 1:
                if (!call->enabled) {
                        call->enabled = 1;
                        tracing_start_cmdline_record();
-                       call->regfunc();
+                       call->regfunc(call->data);
                }
                break;
        }