aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorAlexey Bayduraev <alexey.v.bayduraev@linux.intel.com>2021-10-13 12:06:42 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-10-25 13:47:41 -0300
commit25900ea85ceef35e19234682e7c9dfc8ca2addbe (patch)
tree1ee9eed728a0ad0b9aff0753bbc66d2194e174e1 /tools/perf/util
parentperf session: Introduce reader return codes (diff)
downloadlinux-dev-25900ea85ceef35e19234682e7c9dfc8ca2addbe.tar.xz
linux-dev-25900ea85ceef35e19234682e7c9dfc8ca2addbe.zip
perf session: Introduce reader EOF function
Introduce function to check end-of-file status. Reviewed-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Antonov <alexander.antonov@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexei Budankov <abudankov@huawei.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Riccardo Mancini <rickyman7@gmail.com> Link: https://lore.kernel.org/r/b3b0e0904da01f9ec84d4ae9368df99ecd231598.1634113027.git.alexey.v.bayduraev@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-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: