From: Alexey Bayduraev Date: Wed, 13 Oct 2021 09:06:42 +0000 (+0300) Subject: perf session: Introduce reader EOF function X-Git-Tag: v6.1-rc5~2702^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25900ea85ceef35e19234682e7c9dfc8ca2addbe;p=platform%2Fkernel%2Flinux-starfive.git perf session: Introduce reader EOF function Introduce function to check end-of-file status. Reviewed-by: Jiri Olsa Signed-off-by: Alexey Bayduraev Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Budankov Cc: Andi Kleen Cc: Ingo Molnar Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Link: https://lore.kernel.org/r/b3b0e0904da01f9ec84d4ae9368df99ecd231598.1634113027.git.alexey.v.bayduraev@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index fee7a71..51bf2ef 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -2314,6 +2314,12 @@ out: 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 @@ more: if (session_done()) goto out; - if (rd->file_pos < rd->data_size + rd->data_offset) + if (!reader__eof(rd)) goto more; out: