Messages in this thread Patch in this message | | | From | Alexey Bayduraev <> | Subject | [PATCH v4 8/8] perf session: Introduce reader EOF function | Date | Wed, 13 Oct 2021 12:06:42 +0300 |
| |
Introducing a function to check end-of-file status.
Signed-off-by: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com> --- tools/perf/util/session.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 9714881839e3..bca92ba7218a 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -2309,6 +2309,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) @@ -2336,7 +2342,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: -- 2.19.0
| |