diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index fee7a7171f1a4a0993b63477ff6f10424b6ca467..51bf2efceb7f526ba055bc31fcc988350aafd8f6 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -2314,6 +2314,12 @@ reader__read_event(struct reader *rd, struct perf_session *session, return err; } +static inline bool +reader__eof(struct reader *rd) +{ + return (rd->file_pos >= rd->data_size + rd->data_offset); +} + static int reader__process_events(struct reader *rd, struct perf_session *session, struct ui_progress *prog) @@ -2341,7 +2347,7 @@ reader__process_events(struct reader *rd, struct perf_session *session, if (session_done()) goto out; - if (rd->file_pos < rd->data_size + rd->data_offset) + if (!reader__eof(rd)) goto more; out: