[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130819094627.26597.5222.stgit@yunodevel>
Date: Mon, 19 Aug 2013 18:46:27 +0900
From: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@...achi.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
linux-kernel@...r.kernel.org, yrl.pp-manager.tt@...achi.com
Subject: [RFC PATCH 03/11] [BUGFIX]trace-cmd: Quit from splice(read) if
there are no data
Quit from splice(read) for avoiding to do splice(write) if there are no data.
When splice(read) returns negative or 0, that means no data. So, the recorder
does not need to do splice(write).
Note:
This patch is related to https://lkml.org/lkml/2013/7/21/200. If the patch of
the link is not applied, splice(write) for virtio-serial induces kernel oops
when there are no data. This patch always avoids to do splice(write) in the
case, so this patch is needed.
Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>
---
trace-recorder.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/trace-recorder.c b/trace-recorder.c
index 7db5f3e..520d486 100644
--- a/trace-recorder.c
+++ b/trace-recorder.c
@@ -337,7 +337,10 @@ static long splice_data(struct tracecmd_recorder *recorder)
warning("recorder error in splice input");
return -1;
}
- }
+ if (errno == EINTR)
+ return 0;
+ } else if (ret == 0)
+ return 0;
ret = splice(recorder->brass[0], NULL, recorder->fd, NULL,
recorder->page_size, 3 /* and NON_BLOCK */);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists