Skip to content

Commit

Permalink
ftrace: Fix the output of enabled_functions debug file
Browse files Browse the repository at this point in the history
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 <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed May 10, 2013
1 parent 5ae0bf5 commit 23ea9c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 23ea9c4

Please sign in to comment.