diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2013-03-12 20:07:59 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-03-15 05:36:02 +0100 |
commit | e67efb93f0e9130174293ffaa5975f87b301b531 (patch) | |
tree | 344cadb55d5d50e0ae0473a8404a6893d8a3183b /kernel | |
parent | tracing: Fix comments for ftrace_event_file/call flags (diff) | |
download | linux-e67efb93f0e9130174293ffaa5975f87b301b531.tar.xz linux-e67efb93f0e9130174293ffaa5975f87b301b531.zip |
ftrace: Clean up function probe methods
When a function probe is created, each function that the probe is
attached to, a "callback" method is called. On release of the probe,
each function entry calls the "free" method.
First, "callback" is a confusing name and does not really match what
it does. Callback sounds like it will be called when the probe
triggers. But that's not the case. This is really an "init" function,
so lets rename it as such.
Secondly, both "init" and "free" do not pass enough information back
to the handlers. Pass back the ops, ip and data for each time the
method is called. We have the information, might as well use it.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ftrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index dab031fec85b..ff0ef41c6d93 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2984,7 +2984,7 @@ static void ftrace_free_entry_rcu(struct rcu_head *rhp) container_of(rhp, struct ftrace_func_probe, rcu); if (entry->ops->free) - entry->ops->free(&entry->data); + entry->ops->free(entry->ops, entry->ip, &entry->data); kfree(entry); } @@ -3045,8 +3045,8 @@ register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, * for each function we find. We call the callback * to give the caller an opportunity to do so. */ - if (ops->callback) { - if (ops->callback(rec->ip, &entry->data) < 0) { + if (ops->init) { + if (ops->init(ops, rec->ip, &entry->data) < 0) { /* caller does not like this func */ kfree(entry); continue; |