From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 4/4] tracing: Fix reading of set_ftrace_filter across lists
Date: Tue, 14 Sep 2010 16:27:18 -0400 [thread overview]
Message-ID: <20100914202843.128294711@goodmis.org> (raw)
In-Reply-To: <20100914202714.376849326@goodmis.org>
[-- Attachment #1: 0004-tracing-Fix-reading-of-set_ftrace_filter-across-list.patch --]
[-- Type: text/plain, Size: 1819 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
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>
---
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 2d51166..1884cf5 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)
(*pos)++;
iter->pos = *pos;
- iter->func_pos = *pos;
if (iter->flags & FTRACE_ITER_PRINTALL)
- return NULL;
+ return t_hash_start(m, pos);
retry:
if (iter->idx >= iter->pg->index) {
@@ -1510,8 +1509,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
}
if (!rec)
- return NULL;
+ return t_hash_start(m, pos);
+ iter->func_pos = *pos;
iter->func = rec;
return iter;
--
1.7.1
next prev parent reply other threads:[~2010-09-14 20:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-14 20:27 [PATCH 0/4] [GIT PULL] tracing: real fix for set_ftrace_filter Steven Rostedt
2010-09-14 20:27 ` [PATCH 1/4] tracing: Do not reset *pos in set_ftrace_filter Steven Rostedt
2010-09-14 20:27 ` [PATCH 2/4] tracing: Replace typecasted void pointer in set_ftrace_filter code Steven Rostedt
2010-09-14 20:27 ` [PATCH 3/4] tracing: Keep track of set_ftrace_filter position and allow lseek again Steven Rostedt
2010-09-14 20:27 ` Steven Rostedt [this message]
2010-09-15 8:28 ` [PATCH 0/4] [GIT PULL] tracing: real fix for set_ftrace_filter Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100914202843.128294711@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome