Skip to content

Commit

Permalink
ftrace: Get rid of ftrace_graph_filter_enabled
Browse files Browse the repository at this point in the history
The ftrace_graph_filter_enabled means that user sets function filter
and it always has same meaning of ftrace_graph_count > 0.

Link: http://lkml.kernel.org/r/1381739066-7531-2-git-send-email-namhyung@kernel.org

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Namhyung Kim authored and Steven Rostedt committed Oct 19, 2013
1 parent 057db84 commit 9aa72b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 1 addition & 5 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3776,7 +3776,6 @@ static const struct file_operations ftrace_notrace_fops = {
static DEFINE_MUTEX(graph_lock);

int ftrace_graph_count;
int ftrace_graph_filter_enabled;
unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly;

static void *
Expand All @@ -3799,7 +3798,7 @@ static void *g_start(struct seq_file *m, loff_t *pos)
mutex_lock(&graph_lock);

/* Nothing, tell g_show to print all functions are enabled */
if (!ftrace_graph_filter_enabled && !*pos)
if (!ftrace_graph_count && !*pos)
return (void *)1;

return __g_next(m, pos);
Expand Down Expand Up @@ -3845,7 +3844,6 @@ ftrace_graph_open(struct inode *inode, struct file *file)
mutex_lock(&graph_lock);
if ((file->f_mode & FMODE_WRITE) &&
(file->f_flags & O_TRUNC)) {
ftrace_graph_filter_enabled = 0;
ftrace_graph_count = 0;
memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs));
}
Expand Down Expand Up @@ -3925,8 +3923,6 @@ ftrace_set_func(unsigned long *array, int *idx, char *buffer)
if (fail)
return -EINVAL;

ftrace_graph_filter_enabled = !!(*idx);

return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,15 +730,14 @@ extern void __trace_graph_return(struct trace_array *tr,
#ifdef CONFIG_DYNAMIC_FTRACE
/* TODO: make this variable */
#define FTRACE_GRAPH_MAX_FUNCS 32
extern int ftrace_graph_filter_enabled;
extern int ftrace_graph_count;
extern unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS];

static inline int ftrace_graph_addr(unsigned long addr)
{
int i;

if (!ftrace_graph_filter_enabled)
if (!ftrace_graph_count)
return 1;

for (i = 0; i < ftrace_graph_count; i++) {
Expand Down

0 comments on commit 9aa72b4

Please sign in to comment.