[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180913125450.21342-35-jolsa@kernel.org>
Date: Thu, 13 Sep 2018 14:54:36 +0200
From: Jiri Olsa <jolsa@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andi Kleen <andi@...stfloor.org>,
Alexey Budankov <alexey.budankov@...ux.intel.com>
Subject: [PATCH 34/48] perf ui progress: Fix index progress display
Display overall index files progress size instead of having
multiple (per index) progress bars.
Link: http://lkml.kernel.org/n/tip-b1alb4i6urd623bcbdqni8xp@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/perf/util/session.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index f21c209aeef1..e00a5d7e521e 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1797,6 +1797,8 @@ fetch_mmaped_event(struct perf_session *session,
}
struct process_args {
+ struct ui_progress prog;
+
u64 data_offset;
u64 data_size;
u64 file_size;
@@ -1826,7 +1828,6 @@ static int __perf_session__process_events(struct perf_session *session,
size_t mmap_size;
char *buf, *mmaps[NUM_MMAPS];
union perf_event *event;
- struct ui_progress prog;
s64 skip;
perf_tool__fill_defaults(tool);
@@ -1841,8 +1842,6 @@ static int __perf_session__process_events(struct perf_session *session,
if (args->data_offset + args->data_size < file_size)
file_size = args->data_offset + args->data_size;
- ui_progress__init_size(&prog, file_size, "Processing events...");
-
mmap_size = MMAP_SIZE;
if (mmap_size > file_size) {
mmap_size = file_size;
@@ -1907,7 +1906,7 @@ static int __perf_session__process_events(struct perf_session *session,
head += size;
file_pos += size;
- ui_progress__update(&prog, size);
+ ui_progress__update(&args->prog, size);
if (session_done())
goto out;
@@ -1936,12 +1935,29 @@ static int __perf_session__process_events(struct perf_session *session,
return err;
}
+static u64 get_index_size(struct perf_session *session)
+{
+ u64 size = 0;
+ int i;
+
+ for (i = 0; i < (int)session->header.nr_index; i++) {
+ struct perf_file_section *idx = &session->header.index[i];
+
+ size += idx->size;
+ }
+
+ return size;
+}
+
static int __perf_session__process_indexed_events(struct perf_session *session)
{
struct process_args args;
struct perf_tool *tool = session->tool;
int err = 0, i;
+ ui_progress__init_size(&args.prog, get_index_size(session),
+ "Processing events");
+
for (i = 0; i < (int)session->header.nr_index; i++) {
struct perf_file_section *idx = &session->header.index[i];
@@ -1982,6 +1998,9 @@ int perf_session__process_events(struct perf_session *session)
args.data_size = session->header.data_size;
args.file_size = perf_data__size(data);
+ ui_progress__init_size(&args.prog, args.file_size,
+ "Processing events");
+
err = __perf_session__process_events(session, &args);
if (!tool->no_warn)
--
2.17.1
Powered by blists - more mailing lists