diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-08-13 16:34:53 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-08-26 18:46:40 -0400 |
commit | bd1a5c849bdcc5c89e4a6a18216cd2b9a7a8a78f (patch) | |
tree | 1a807fef00b8a700d90683d4f1d480d95eec9669 /kernel/trace/trace_export.c | |
parent | b1cf540f0e5278ecfe8532557e547d833ed269d7 (diff) |
tracing: Ftrace dynamic ftrace_event_call support
Add dynamic ftrace_event_call support to ftrace. Trace engines can add
new ftrace_event_call to ftrace on the fly. Each operator function of
the call takes an ftrace_event_call data structure as an argument,
because these functions may be shared among several ftrace_event_calls.
Changes from v13:
- Define remove_subsystem_dir() always (revirt a2ca5e03), because
trace_remove_event_call() uses it.
- Modify syscall tracer because of ftrace_event_call change.
[fweisbec@gmail.com: Fixed conflict against latest tracing/core]
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frank Ch. Eigler <fche@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
Cc: Roland McGrath <roland@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
LKML-Reference: <20090813203453.31965.71901.stgit@localhost.localdomain>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/trace/trace_export.c')
-rw-r--r-- | kernel/trace/trace_export.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 029a91f42287..9cbe7f1930ea 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -117,10 +117,16 @@ ftrace_format_##call(struct ftrace_event_call *unused, \ | |||
117 | #define TRACE_FIELD_SPECIAL(type_item, item, len, cmd) \ | 117 | #define TRACE_FIELD_SPECIAL(type_item, item, len, cmd) \ |
118 | cmd; | 118 | cmd; |
119 | 119 | ||
120 | static int ftrace_raw_init_event(struct ftrace_event_call *event_call) | ||
121 | { | ||
122 | INIT_LIST_HEAD(&event_call->fields); | ||
123 | init_preds(event_call); | ||
124 | return 0; | ||
125 | } | ||
126 | |||
120 | #undef TRACE_EVENT_FORMAT | 127 | #undef TRACE_EVENT_FORMAT |
121 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ | 128 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ |
122 | int ftrace_define_fields_##call(struct ftrace_event_call *event_call); \ | 129 | int ftrace_define_fields_##call(struct ftrace_event_call *event_call); \ |
123 | static int ftrace_raw_init_event_##call(void); \ | ||
124 | \ | 130 | \ |
125 | struct ftrace_event_call __used \ | 131 | struct ftrace_event_call __used \ |
126 | __attribute__((__aligned__(4))) \ | 132 | __attribute__((__aligned__(4))) \ |
@@ -128,16 +134,10 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
128 | .name = #call, \ | 134 | .name = #call, \ |
129 | .id = proto, \ | 135 | .id = proto, \ |
130 | .system = __stringify(TRACE_SYSTEM), \ | 136 | .system = __stringify(TRACE_SYSTEM), \ |
131 | .raw_init = ftrace_raw_init_event_##call, \ | 137 | .raw_init = ftrace_raw_init_event, \ |
132 | .show_format = ftrace_format_##call, \ | 138 | .show_format = ftrace_format_##call, \ |
133 | .define_fields = ftrace_define_fields_##call, \ | 139 | .define_fields = ftrace_define_fields_##call, \ |
134 | }; \ | 140 | }; |
135 | static int ftrace_raw_init_event_##call(void) \ | ||
136 | { \ | ||
137 | INIT_LIST_HEAD(&event_##call.fields); \ | ||
138 | init_preds(&event_##call); \ | ||
139 | return 0; \ | ||
140 | } \ | ||
141 | 141 | ||
142 | #undef TRACE_EVENT_FORMAT_NOFILTER | 142 | #undef TRACE_EVENT_FORMAT_NOFILTER |
143 | #define TRACE_EVENT_FORMAT_NOFILTER(call, proto, args, fmt, tstruct, \ | 143 | #define TRACE_EVENT_FORMAT_NOFILTER(call, proto, args, fmt, tstruct, \ |