[PATCH 1/3] ftrace: do not show freed records in available_filter_functions

From: Steven Rostedt
Date: Thu Aug 14 2008 - 23:01:24 EST


Seems that freed records can appear in the available_filter_functions list.
This patch fixes that.

CC: Abhishek Sagar <sagar.abhishek@xxxxxxxxx>
Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
---
kernel/trace/ftrace.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

Index: linux-tip.git/kernel/trace/ftrace.c
===================================================================
--- linux-tip.git.orig/kernel/trace/ftrace.c 2008-08-14 22:43:01.000000000 -0400
+++ linux-tip.git/kernel/trace/ftrace.c 2008-08-14 22:43:03.000000000 -0400
@@ -879,15 +879,13 @@ t_next(struct seq_file *m, void *v, loff
}
} else {
rec = &iter->pg->records[iter->idx++];
- if ((!(iter->flags & FTRACE_ITER_FAILURES) &&
+ if ((rec->flags & FTRACE_FL_FREE) ||
+
+ (!(iter->flags & FTRACE_ITER_FAILURES) &&
(rec->flags & FTRACE_FL_FAILED)) ||

((iter->flags & FTRACE_ITER_FAILURES) &&
- (!(rec->flags & FTRACE_FL_FAILED) ||
- (rec->flags & FTRACE_FL_FREE))) ||
-
- ((iter->flags & FTRACE_ITER_FILTER) &&
- !(rec->flags & FTRACE_FL_FILTER)) ||
+ !(rec->flags & FTRACE_FL_FAILED)) ||

((iter->flags & FTRACE_ITER_NOTRACE) &&
!(rec->flags & FTRACE_FL_NOTRACE))) {

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/