From: Steven Rostedt (Red Hat) Date: Thu, 9 May 2013 23:31:48 +0000 (-0400) Subject: ftrace: Fix the output of enabled_functions debug file X-Git-Tag: firefly_0821_release~3680^2~483^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=23ea9c4dda129fe1711f9fbda03c7a9c91cf1322;p=firefly-linux-kernel-4.4.55.git ftrace: Fix the output of enabled_functions debug file The enabled_functions debugfs file was created to be able to see what functions have been modified from nops to calling a tracer. The current method uses the counter in the function record. As when a ftrace_ops is registered to a function, its count increases. But that doesn't mean that the function is actively being traced. /proc/sys/kernel/ftrace_enabled can be set to zero which would disable it, as well as something can go wrong and we can think its enabled when only the counter is set. The record's FTRACE_FL_ENABLED flag is set or cleared when its function is modified. That is a much more accurate way of knowing what function is enabled or not. Signed-off-by: Steven Rostedt --- diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index f104c45cbcc1..dcca9fa29bf4 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2459,7 +2459,7 @@ t_next(struct seq_file *m, void *v, loff_t *pos) !ftrace_lookup_ip(ops->notrace_hash, rec->ip)) || ((iter->flags & FTRACE_ITER_ENABLED) && - !(rec->flags & ~FTRACE_FL_MASK))) { + !(rec->flags & FTRACE_FL_ENABLED))) { rec = NULL; goto retry;