From: Liu Bo <bo.li.liu@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: rostedt@goodmis.org
Subject: [PATCH] Tracing: fix regression of trace_pipe
Date: Mon, 14 Jan 2013 10:54:11 +0800 [thread overview]
Message-ID: <1358132051-5410-1-git-send-email-bo.li.liu@oracle.com> (raw)
commit 0fb9656d changes the behaviour of trace_pipe, ie. it makes trace_pipe
return if we've read something and tracing is enabled, and this means that
we have to 'cat trace_pipe' again and again while running tests.
IMO the right way is if tracing is enabled, we always block and wait for
ring buffer, or we may lose what we want since ring buffer's size is limited.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
kernel/trace/trace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index e512567..fc76beb 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3452,7 +3452,7 @@ static int tracing_wait_pipe(struct file *filp)
return -EINTR;
/*
- * We block until we read something and tracing is enabled.
+ * We block until we read something and tracing is disabled.
* We still block if tracing is disabled, but we have never
* read anything. This allows a user to cat this file, and
* then enable tracing. But after we have read something,
@@ -3460,7 +3460,7 @@ static int tracing_wait_pipe(struct file *filp)
*
* iter->pos will be 0 if we haven't read anything.
*/
- if (tracing_is_enabled() && iter->pos)
+ if (!tracing_is_enabled() && iter->pos)
break;
}
--
1.7.7.6
next reply other threads:[~2013-01-14 2:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 2:54 Liu Bo [this message]
2013-01-14 15:53 ` [PATCH] Tracing: fix regression of trace_pipe Steven Rostedt
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=1358132051-5410-1-git-send-email-bo.li.liu@oracle.com \
--to=bo.li.liu@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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;
as well as URLs for NNTP newsgroup(s).