[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-71002bd214822a15bee0f7bc033a0dbf95cf780b@git.kernel.org>
Date: Tue, 22 Jan 2019 02:13:10 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, mingo@...nel.org,
alexander.shishkin@...ux.intel.com, peterz@...radead.org,
namhyung@...nel.org, acme@...hat.com, tglx@...utronix.de,
linux-kernel@...r.kernel.org, jolsa@...nel.org
Subject: [tip:perf/core] perf session: Add 'data_offset' member to reader
object
Commit-ID: 71002bd214822a15bee0f7bc033a0dbf95cf780b
Gitweb: https://git.kernel.org/tip/71002bd214822a15bee0f7bc033a0dbf95cf780b
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Thu, 10 Jan 2019 11:13:00 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 21 Jan 2019 15:15:57 -0300
perf session: Add 'data_offset' member to reader object
Add 'data_offset' member to reader object.
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-6-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 9f29ed743425..173cf445475c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1823,6 +1823,7 @@ fetch_mmaped_event(struct perf_session *session,
struct reader {
int fd;
u64 data_size;
+ u64 data_offset;
};
static int __perf_session__process_events(struct perf_session *session)
@@ -1830,10 +1831,10 @@ static int __perf_session__process_events(struct perf_session *session)
struct reader rd = {
.fd = perf_data__fd(session->data),
.data_size = session->header.data_size,
+ .data_offset = session->header.data_offset,
};
struct ordered_events *oe = &session->ordered_events;
struct perf_tool *tool = session->tool;
- u64 data_offset = session->header.data_offset;
u64 data_size = rd.data_size;
u64 head, page_offset, file_offset, file_pos, size;
int err, mmap_prot, mmap_flags, map_idx = 0;
@@ -1845,16 +1846,16 @@ static int __perf_session__process_events(struct perf_session *session)
perf_tool__fill_defaults(tool);
- page_offset = page_size * (data_offset / page_size);
+ page_offset = page_size * (rd.data_offset / page_size);
file_offset = page_offset;
- head = data_offset - page_offset;
+ head = rd.data_offset - page_offset;
if (data_size == 0)
goto out;
ui_progress__init_size(&prog, data_size, "Processing events...");
- data_size += data_offset;
+ data_size += rd.data_offset;
mmap_size = MMAP_SIZE;
if (mmap_size > data_size) {
Powered by blists - more mailing lists