aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Bayduraev <[email protected]>2021-10-13 12:06:42 +0300
committerArnaldo Carvalho de Melo <[email protected]>2021-10-25 13:47:41 -0300
commit25900ea85ceef35e19234682e7c9dfc8ca2addbe (patch)
tree1ee9eed728a0ad0b9aff0753bbc66d2194e174e1
parent4c0028864cd937ae604f0d62282899108061a6f1 (diff)
perf session: Introduce reader EOF function
Introduce function to check end-of-file status. Reviewed-by: Jiri Olsa <[email protected]> Signed-off-by: Alexey Bayduraev <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Antonov <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexei Budankov <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Riccardo Mancini <[email protected]> Link: https://lore.kernel.org/r/b3b0e0904da01f9ec84d4ae9368df99ecd231598.1634113027.git.alexey.v.bayduraev@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/session.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index fee7a7171f1a..51bf2efceb7f 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: