]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
tracing: Add ftrace event call parameter to its field descriptor handler
authorFrederic Weisbecker <fweisbec@gmail.com>
Tue, 11 Aug 2009 15:42:52 +0000 (17:42 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Tue, 11 Aug 2009 18:35:29 +0000 (20:35 +0200)
Add the struct ftrace_event_call as a parameter of its show_format()
callback. This way we can use it from the syscall trace events to
retrieve the syscall name from the ftrace event call parameter and
describe its fields using the syscalls metadata.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.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>
Cc: Jason Baron <jbaron@redhat.com>
include/linux/ftrace_event.h
include/trace/ftrace.h
kernel/trace/trace_events.c
kernel/trace/trace_export.c

index 8544f121d9f119b51d972647f685fa25a41612ab..189806b6e69e3cce5819266786d59dbaba88150b 100644 (file)
@@ -116,7 +116,8 @@ struct ftrace_event_call {
        void                    (*unregfunc)(void *);
        int                     id;
        int                     (*raw_init)(void);
-       int                     (*show_format)(struct trace_seq *s);
+       int                     (*show_format)(struct ftrace_event_call *call,
+                                              struct trace_seq *s);
        int                     (*define_fields)(void);
        struct list_head        fields;
        int                     filter_active;
index 46d81b5e86102fa50e64c41ccb71ef73e4d3fe03..b250b06165715c7559aaac7c7d536000749c3e0f 100644 (file)
 #undef TRACE_EVENT
 #define TRACE_EVENT(call, proto, args, tstruct, func, print)           \
 static int                                                             \
-ftrace_format_##call(struct trace_seq *s)                              \
+ftrace_format_##call(struct ftrace_event_call *unused,                 \
+                     struct trace_seq *s)                              \
 {                                                                      \
        struct ftrace_raw_##call field __attribute__((unused));         \
        int ret = 0;                                                    \
index 1d289e2d66930f2fb926310c69059625dcd7f33c..b568ade8f453c3a7fbe019f3258f0f6ba5e2a2aa 100644 (file)
@@ -576,7 +576,7 @@ event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
        trace_seq_printf(s, "format:\n");
        trace_write_header(s);
 
-       r = call->show_format(s);
+       r = call->show_format(call, s);
        if (!r) {
                /*
                 * ug!  The format output is bigger than a PAGE!!
index d06cf898dc86aeb012a5f2e5bb1abed214aa8102..956d4bc675e5f99dbd281fcdadae14a0114a206f 100644 (file)
@@ -60,7 +60,8 @@ extern void __bad_type_size(void);
 #undef TRACE_EVENT_FORMAT
 #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt)     \
 static int                                                             \
-ftrace_format_##call(struct trace_seq *s)                              \
+ftrace_format_##call(struct ftrace_event_call *unused,                 \
+                     struct trace_seq *s)                              \
 {                                                                      \
        struct args field;                                              \
        int ret;                                                        \
@@ -76,7 +77,8 @@ ftrace_format_##call(struct trace_seq *s)                             \
 #define TRACE_EVENT_FORMAT_NOFILTER(call, proto, args, fmt, tstruct,   \
                                    tpfmt)                              \
 static int                                                             \
-ftrace_format_##call(struct trace_seq *s)                              \
+ftrace_format_##call(struct ftrace_event_call *unused,                 \
+                     struct trace_seq *s)                              \
 {                                                                      \
        struct args field;                                              \
        int ret;                                                        \