Commit-ID: 1e7972cc5c16e06f258b0278d8c9adfb5aa75c68
Gitweb: http://git.kernel.org/tip/1e7972cc5c16e06f258b0278d8c9adfb5aa75c68
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 3 Jan 2011 16:50:55 -0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 3 Jan 2011 16:50:55 -0200
perf util: Move do_read from session to util
Not really something to be exported from session.c. Rename it to
'readn' as others did in the past.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/header.c | 6 +++---
tools/perf/util/session.c | 22 ++--------------------
tools/perf/util/session.h | 1 -
tools/perf/util/util.c | 17 +++++++++++++++++
tools/perf/util/util.h | 1 +
5 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index ecb5a84..05dec98 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -604,7 +604,7 @@ int perf_header__write(struct perf_header *self, int fd, bool at_exit)
static int perf_header__getbuffer64(struct perf_header *self,
int fd, void *buf, size_t size)
{
- if (do_read(fd, buf, size) <= 0)
+ if (readn(fd, buf, size) <= 0)
return -1;
if (self->needs_swap)
@@ -660,7 +660,7 @@ int perf_file_header__read(struct perf_file_header *self,
{
lseek(fd, 0, SEEK_SET);
- if (do_read(fd, self, sizeof(*self)) <= 0 ||
+ if (readn(fd, self, sizeof(*self)) <= 0 ||
memcmp(&self->magic, __perf_magic, sizeof(self->magic)))
return -1;
@@ -821,7 +821,7 @@ static int perf_file_header__read_pipe(struct perf_pipe_file_header *self,
struct perf_header *ph, ...