Skip to content

Commit

Permalink
ftrace: Remove unused unregister_ftrace_function_probe_all() function
Browse files Browse the repository at this point in the history
There are no users of unregister_ftrace_function_probe_all(). The only probe
function that is used is unregister_ftrace_function_probe_func(). Rename the
internal static function __unregister_ftrace_function_probe() to
unregister_ftrace_function_probe_func() and make it global.

Also remove the PROBE_TEST_FUNC as it would be always set.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
rostedt committed Apr 21, 2017
1 parent 0fe7e7e commit 78f78e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
22 changes: 3 additions & 19 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -4059,13 +4059,8 @@ register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
return count;
}

enum {
PROBE_TEST_FUNC = 1,
};

static void
__unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
int flags)
void
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
{
struct ftrace_ops_hash old_hash_ops;
struct ftrace_func_entry *rec_entry;
Expand Down Expand Up @@ -4115,7 +4110,7 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
hlist_for_each_entry_safe(entry, tmp, hhd, node) {

/* break up if statements for readability */
if ((flags & PROBE_TEST_FUNC) && entry->ops != ops)
if (entry->ops != ops)
continue;

/* do this last, since it is the most expensive */
Expand Down Expand Up @@ -4162,17 +4157,6 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
free_ftrace_hash(hash);
}

void
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops)
{
__unregister_ftrace_function_probe(glob, ops, PROBE_TEST_FUNC);
}

void unregister_ftrace_function_probe_all(char *glob)
{
__unregister_ftrace_function_probe(glob, NULL, 0);
}

static LIST_HEAD(ftrace_commands);
static DEFINE_MUTEX(ftrace_cmd_mutex);

Expand Down
1 change: 0 additions & 1 deletion kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
void *data);
extern void
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
extern void unregister_ftrace_function_probe_all(char *glob);

int register_ftrace_command(struct ftrace_func_command *cmd);
int unregister_ftrace_command(struct ftrace_func_command *cmd);
Expand Down

0 comments on commit 78f78e0

Please sign in to comment.