perf header: Stop using die() calls when processing tracing data

The callers of this function (perf_event__process_tracing_data) already
handles a negative value return as error, so just use pr_err() to log
the problem and return -1 instead of panic'ing.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-eeeljnecpi0zi5s7ux1mzdv9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 8d9233f2
...@@ -2921,16 +2921,22 @@ int perf_event__process_tracing_data(union perf_event *event, ...@@ -2921,16 +2921,22 @@ int perf_event__process_tracing_data(union perf_event *event,
session->repipe); session->repipe);
padding = PERF_ALIGN(size_read, sizeof(u64)) - size_read; padding = PERF_ALIGN(size_read, sizeof(u64)) - size_read;
if (readn(session->fd, buf, padding) < 0) if (readn(session->fd, buf, padding) < 0) {
die("reading input file"); pr_err("%s: reading input file", __func__);
return -1;
}
if (session->repipe) { if (session->repipe) {
int retw = write(STDOUT_FILENO, buf, padding); int retw = write(STDOUT_FILENO, buf, padding);
if (retw <= 0 || retw != padding) if (retw <= 0 || retw != padding) {
die("repiping tracing data padding"); pr_err("%s: repiping tracing data padding", __func__);
return -1;
}
} }
if (size_read + padding != size) if (size_read + padding != size) {
die("tracing data size mismatch"); pr_err("%s: tracing data size mismatch", __func__);
return -1;
}
perf_evlist__prepare_tracepoint_events(session->evlist, perf_evlist__prepare_tracepoint_events(session->evlist,
session->pevent); session->pevent);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册