Commit 57c072c7 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

tracing: Fix reading of set_ftrace_filter across lists

If we do:

 # cd /sys/kernel/debug
 # echo 'do_IRQ:traceon schedule:traceon sys_write:traceon' > \
    set_ftrace_filter
 # cat set_ftrace_filter

We get the following output:

 #### all functions enabled ####
 sys_write:traceon:unlimited
 schedule:traceon:unlimited
 do_IRQ:traceon:unlimited

This outputs two lists. One is the fact that all functions are
currently enabled for function tracing, the other has three probed
functions, which happen to have 'traceon' as their commands.

Currently, when reading the first list (functions enabled) the
seq_file code will receive a "NULL" from the t_next() function
causing it to exit early. This makes "read()" from userspace stop
reading the code at this boarder. Although read is allowed to do this,
some (broken) applications might consider this an end of file and
stop early.

This patch adds the start of the second list to t_next() when it
finishes the first list. It is a simple change and gives the
set_ftrace_filter file nicer reading ability.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 98c4fd04
...@@ -1477,10 +1477,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos) ...@@ -1477,10 +1477,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
(*pos)++; (*pos)++;
iter->pos = *pos; iter->pos = *pos;
iter->func_pos = *pos;
if (iter->flags & FTRACE_ITER_PRINTALL) if (iter->flags & FTRACE_ITER_PRINTALL)
return NULL; return t_hash_start(m, pos);
retry: retry:
if (iter->idx >= iter->pg->index) { if (iter->idx >= iter->pg->index) {
...@@ -1510,8 +1509,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos) ...@@ -1510,8 +1509,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
} }
if (!rec) if (!rec)
return NULL; return t_hash_start(m, pos);
iter->func_pos = *pos;
iter->func = rec; iter->func = rec;
return iter; return iter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment