lkml.org 
[lkml]   [2019]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 13/14] perf session: Add path to reader object
Date
Adding path to reader object, so we can display file
the processing fails for (string in [] brackets).

$ perf report --stdio
0x5e0 [perf.data/data.3] [0xa200]: failed to process type: -1577027574

Link: http://lkml.kernel.org/n/tip-4bjnoy4sln7adqtd3505q29q@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/session.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 38d2854cebc1..aa7c4fd1cd2f 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1846,6 +1846,7 @@ struct reader {
u64 data_size;
u64 data_offset;
reader_cb_t process;
+ char *path;
};

static int
@@ -1915,8 +1916,8 @@ reader__process_events(struct reader *rd, struct perf_session *session,

if (size < sizeof(struct perf_event_header) ||
(skip = rd->process(session, event, file_pos)) < 0) {
- pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n",
- file_offset + head, event->header.size,
+ pr_err("%#" PRIx64 " [%s] [%#x]: failed to process type: %d\n",
+ file_offset + head, rd->path, event->header.size,
event->header.type);
err = -EINVAL;
goto out;
@@ -1954,6 +1955,7 @@ static int __perf_session__process_events(struct perf_session *session)
.data_size = session->header.data_size,
.data_offset = session->header.data_offset,
.process = process_simple,
+ .path = session->data->file.path,
};
struct ordered_events *oe = &session->ordered_events;
struct perf_tool *tool = session->tool;
@@ -2028,6 +2030,7 @@ static int __perf_session__process_dir_events(struct perf_session *session)
.data_size = session->header.data_size,
.data_offset = session->header.data_offset,
.process = process_simple,
+ .path = session->data->file.path,
};
int i, ret = 0;
struct ui_progress prog;
@@ -2052,6 +2055,7 @@ static int __perf_session__process_dir_events(struct perf_session *session)
.data_size = file->size,
.data_offset = 0,
.process = process_index,
+ .path = file->path,
};

ret = reader__process_events(&rd, session, &prog);
--
2.17.2
\
 
 \ /
  Last update: 2019-02-03 16:31    [W:0.178 / U:8.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site