Currently when processing events in __perf_session__process_events
function we we update progress based on the file_size. During the
same processing we update progress bar from within flush_sample_queue
which is based on number of samples count.
Having 2 different based updates is causing the progress bar to
jump heavily back and forth giving not much useful info.
Fixing this by keeping only __perf_session__process_events
based progress bar update. And turning on flush_sample_queue
progress bar update only for final flushing.
This reduces the number of times the progress bar update
function is called and it significantly reduces the loading
time for TUI, where the progress bar update takes quite a lot
of time.
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
---
tools/perf/util/session.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 1fc0c62..4df449c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -495,7 +495,7 @@ static int perf_session_deliver_event(struct perf_session *session,
u64 file_offset);
static int flush_sample_queue(struct perf_session *s,
- struct perf_tool *tool)
+ struct perf_tool *tool, bool final)