aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index afb0849fe530..cb2959a3fb43 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -877,9 +877,12 @@ int perf_session__read_header(struct perf_session *session, int fd)
877 struct perf_evsel *evsel; 877 struct perf_evsel *evsel;
878 off_t tmp; 878 off_t tmp;
879 879
880 if (perf_header__getbuffer64(header, fd, &f_attr, sizeof(f_attr))) 880 if (readn(fd, &f_attr, sizeof(f_attr)) <= 0)
881 goto out_errno; 881 goto out_errno;
882 882
883 if (header->needs_swap)
884 perf_event__attr_swap(&f_attr.attr);
885
883 tmp = lseek(fd, 0, SEEK_CUR); 886 tmp = lseek(fd, 0, SEEK_CUR);
884 evsel = perf_evsel__new(&f_attr.attr, i); 887 evsel = perf_evsel__new(&f_attr.attr, i);
885 888