Commit 71002bd2 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf session: Add 'data_offset' member to reader object

Add 'data_offset' member to reader object.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190110101301.6196-6-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f66f0950
...@@ -1823,6 +1823,7 @@ fetch_mmaped_event(struct perf_session *session, ...@@ -1823,6 +1823,7 @@ fetch_mmaped_event(struct perf_session *session,
struct reader { struct reader {
int fd; int fd;
u64 data_size; u64 data_size;
u64 data_offset;
}; };
static int __perf_session__process_events(struct perf_session *session) static int __perf_session__process_events(struct perf_session *session)
...@@ -1830,10 +1831,10 @@ 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 = { struct reader rd = {
.fd = perf_data__fd(session->data), .fd = perf_data__fd(session->data),
.data_size = session->header.data_size, .data_size = session->header.data_size,
.data_offset = session->header.data_offset,
}; };
struct ordered_events *oe = &session->ordered_events; struct ordered_events *oe = &session->ordered_events;
struct perf_tool *tool = session->tool; struct perf_tool *tool = session->tool;
u64 data_offset = session->header.data_offset;
u64 data_size = rd.data_size; u64 data_size = rd.data_size;
u64 head, page_offset, file_offset, file_pos, size; u64 head, page_offset, file_offset, file_pos, size;
int err, mmap_prot, mmap_flags, map_idx = 0; int err, mmap_prot, mmap_flags, map_idx = 0;
...@@ -1845,16 +1846,16 @@ static int __perf_session__process_events(struct perf_session *session) ...@@ -1845,16 +1846,16 @@ static int __perf_session__process_events(struct perf_session *session)
perf_tool__fill_defaults(tool); 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; file_offset = page_offset;
head = data_offset - page_offset; head = rd.data_offset - page_offset;
if (data_size == 0) if (data_size == 0)
goto out; goto out;
ui_progress__init_size(&prog, data_size, "Processing events..."); ui_progress__init_size(&prog, data_size, "Processing events...");
data_size += data_offset; data_size += rd.data_offset;
mmap_size = MMAP_SIZE; mmap_size = MMAP_SIZE;
if (mmap_size > data_size) { if (mmap_size > data_size) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment