[PATCH 5/9] perf util: Handle failure case in trace_report()

2013-03-21 Thread Namhyung Kim
From: Namhyung Kim If pevent allocation in read_trace_init() fails, trace_report() will return -1 and *ppevent is set to NULL. Its callers should check this case and handle it properly. This is also a preparation for the removal of *die() calls. Cc: Steven Rostedt Cc: Frederic Weisbecker Sig

Re: [PATCH 5/9] perf util: Handle failure case in trace_report()

2013-03-19 Thread Steven Rostedt
On Wed, 2013-03-20 at 10:12 +0900, Namhyung Kim wrote: > >> +++ b/tools/perf/util/trace-event-read.c > >> @@ -293,7 +293,10 @@ ssize_t trace_report(int fd, struct pevent **ppevent, > >> bool __repipe) > >>int show_version = 0; > >>int show_funcs = 0; > >>int show_printk = 0; > >> - s

Re: [PATCH 5/9] perf util: Handle failure case in trace_report()

2013-03-19 Thread Namhyung Kim
On Tue, 19 Mar 2013 10:47:53 -0400, Steven Rostedt wrote: > On Tue, 2013-03-19 at 17:53 +0900, Namhyung Kim wrote: > >> @@ -3100,7 +3105,7 @@ int perf_event__process_tracing_data(union perf_event >> *event, >> } >> } >> >> -if (size_read + padding != size) { >> +if (siz

Re: [PATCH 5/9] perf util: Handle failure case in trace_report()

2013-03-19 Thread Steven Rostedt
On Tue, 2013-03-19 at 17:53 +0900, Namhyung Kim wrote: > @@ -3100,7 +3105,7 @@ int perf_event__process_tracing_data(union perf_event > *event, > } > } > > - if (size_read + padding != size) { > + if (size_read + padding != size || session->pevent == NULL) { >

[PATCH 5/9] perf util: Handle failure case in trace_report()

2013-03-19 Thread Namhyung Kim
From: Namhyung Kim If pevent allocation in read_trace_init() fails, trace_report() will return -1 and *ppevent is set to NULL. Its callers should check this case and handle it properly. This is also a preparation for the removal of *die() calls. Cc: Steven Rostedt Cc: Frederic Weisbecker Sig