[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-4f5a473d79c755d2e325c9a8dab01804d5416923@git.kernel.org>
Date: Tue, 22 Jan 2019 02:11:15 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, alexander.shishkin@...ux.intel.com,
peterz@...radead.org, jolsa@...nel.org,
linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
tglx@...utronix.de, namhyung@...nel.org
Subject: [tip:perf/core] perf session: Get rid of file_size variable
Commit-ID: 4f5a473d79c755d2e325c9a8dab01804d5416923
Gitweb: https://git.kernel.org/tip/4f5a473d79c755d2e325c9a8dab01804d5416923
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Thu, 10 Jan 2019 11:12:57 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 21 Jan 2019 15:15:57 -0300
perf session: Get rid of file_size variable
It's not needed and removing it makes the code a little simpler for the
upcoming changes.
It's safe to replace file_size with data_size, because the
perf_data__size() value is never smaller than data_offset + data_size.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Acked-by: Namhyung Kim <namhyung@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20190110101301.6196-3-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ad14192db811..c8c2069fb01e 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1825,7 +1825,6 @@ static int __perf_session__process_events(struct perf_session *session)
struct ordered_events *oe = &session->ordered_events;
struct perf_tool *tool = session->tool;
int fd = perf_data__fd(session->data);
- u64 file_size = perf_data__size(session->data);
u64 data_offset = session->header.data_offset;
u64 data_size = session->header.data_size;
u64 head, page_offset, file_offset, file_pos, size;
@@ -1845,14 +1844,13 @@ static int __perf_session__process_events(struct perf_session *session)
if (data_size == 0)
goto out;
- if (data_offset + data_size < file_size)
- file_size = data_offset + data_size;
+ ui_progress__init_size(&prog, data_size, "Processing events...");
- ui_progress__init_size(&prog, file_size, "Processing events...");
+ data_size += data_offset;
mmap_size = MMAP_SIZE;
- if (mmap_size > file_size) {
- mmap_size = file_size;
+ if (mmap_size > data_size) {
+ mmap_size = data_size;
session->one_mmap = true;
}
@@ -1917,7 +1915,7 @@ more:
if (session_done())
goto out;
- if (file_pos < file_size)
+ if (file_pos < data_size)
goto more;
out:
Powered by blists - more mailing lists