diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-09-14 11:21:11 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-09-14 15:14:20 -0400 |
commit | 57c072c7113f54f9512624d6c665db6184448782 (patch) | |
tree | c005a9325d308763bd1763853395c7b13010b5e3 /kernel/trace | |
parent | 98c4fd046f07156ca6055677e8f03d4280be16c1 (diff) |
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: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 2d51166b93fe..1884cf5bc110 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1477,10 +1477,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos) | |||
1477 | 1477 | ||
1478 | (*pos)++; | 1478 | (*pos)++; |
1479 | iter->pos = *pos; | 1479 | iter->pos = *pos; |
1480 | iter->func_pos = *pos; | ||
1481 | 1480 | ||
1482 | if (iter->flags & FTRACE_ITER_PRINTALL) | 1481 | if (iter->flags & FTRACE_ITER_PRINTALL) |
1483 | return NULL; | 1482 | return t_hash_start(m, pos); |
1484 | 1483 | ||
1485 | retry: | 1484 | retry: |
1486 | if (iter->idx >= iter->pg->index) { | 1485 | if (iter->idx >= iter->pg->index) { |
@@ -1510,8 +1509,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos) | |||
1510 | } | 1509 | } |
1511 | 1510 | ||
1512 | if (!rec) | 1511 | if (!rec) |
1513 | return NULL; | 1512 | return t_hash_start(m, pos); |
1514 | 1513 | ||
1514 | iter->func_pos = *pos; | ||
1515 | iter->func = rec; | 1515 | iter->func = rec; |
1516 | 1516 | ||
1517 | return iter; | 1517 | return iter; |