Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-04 Thread David Ahern
On 10/4/13 9:25 AM, Arnaldo Carvalho de Melo wrote: Got to process this now, changing it a bit to replace "perf.data" with "%s" + session->filename, ack? Otherwise the user may have a 'perf.data' file and despite having informed -i with a different file name still get confused... ;-) ack. agr

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-04 Thread Arnaldo Carvalho de Melo
Em Tue, Oct 01, 2013 at 10:59:06AM -0600, David Ahern escreveu: > On 10/1/13 10:54 AM, Arnaldo Carvalho de Melo wrote: > >Em Tue, Oct 01, 2013 at 05:33:09PM +0200, Ingo Molnar escreveu: > >>* David Ahern wrote: > >>>On 10/1/13 8:21 AM, Ingo Molnar wrote: > >I liked this last one: > > > >> WARNIN

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread Ingo Molnar
* Arnaldo Carvalho de Melo wrote: > Em Tue, Oct 01, 2013 at 05:33:09PM +0200, Ingo Molnar escreveu: > > > > * David Ahern wrote: > > > > > On 10/1/13 8:21 AM, Ingo Molnar wrote: > > > >But if I understood it correctly this particular message could trigger > > > >for > > > >regular users of p

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread David Ahern
On 10/1/13 10:54 AM, Arnaldo Carvalho de Melo wrote: Em Tue, Oct 01, 2013 at 05:33:09PM +0200, Ingo Molnar escreveu: * David Ahern wrote: On 10/1/13 8:21 AM, Ingo Molnar wrote: But if I understood it correctly this particular message could trigger for regular users of perf as well, of the p

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread Arnaldo Carvalho de Melo
Em Tue, Oct 01, 2013 at 05:33:09PM +0200, Ingo Molnar escreveu: > > * David Ahern wrote: > > > On 10/1/13 8:21 AM, Ingo Molnar wrote: > > >But if I understood it correctly this particular message could trigger for > > >regular users of perf as well, of the perf record is terminated in some > > >

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread Ingo Molnar
* David Ahern wrote: > On 10/1/13 8:21 AM, Ingo Molnar wrote: > >But if I understood it correctly this particular message could trigger for > >regular users of perf as well, of the perf record is terminated in some > >unusual fashion. Regular users might not have the perf code handy (and > >migh

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread David Ahern
On 10/1/13 8:21 AM, Ingo Molnar wrote: But if I understood it correctly this particular message could trigger for regular users of perf as well, of the perf record is terminated in some unusual fashion. Regular users might not have the perf code handy (and might not know about git grep either).

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread Ingo Molnar
* David Ahern wrote: > On 10/1/13 1:16 AM, Ingo Molnar wrote: > >Just a detail: it would be nice to make all the user facing messages in > >tools/perf/util/header.c more specific and more structured. For example > >prefixing it with 'perf header:' would be fine: > > > > WARNING: perf/header:

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread David Ahern
On 10/1/13 1:16 AM, Ingo Molnar wrote: Just a detail: it would be nice to make all the user facing messages in tools/perf/util/header.c more specific and more structured. For example prefixing it with 'perf header:' would be fine: WARNING: perf/header: Data size is 0. Was the 'perf recor

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-10-01 Thread Ingo Molnar
* Namhyung Kim wrote: > --- a/tools/perf/util/header.c > +++ b/tools/perf/util/header.c > @@ -2753,6 +2753,15 @@ int perf_session__read_header(struct perf_session > *session) > if (perf_file_header__read(&f_header, header, fd) < 0) > return -EINVAL; > > + /* > + *

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-09-30 Thread Sonny Rao
On Mon, Sep 30, 2013 at 6:49 AM, David Ahern wrote: > On 9/30/13 2:19 AM, Namhyung Kim wrote: >> >> From: Namhyung Kim >> >> perf-record updates the header in the perf.data file at termination. >> Without this update perf-report (and other processing built-ins) it >> caused an infinite loop when

Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-09-30 Thread David Ahern
On 9/30/13 2:19 AM, Namhyung Kim wrote: From: Namhyung Kim perf-record updates the header in the perf.data file at termination. Without this update perf-report (and other processing built-ins) it caused an infinite loop when perf report (or something like) called. This is because the algorithm

[PATCH] perf session: Fix infinite loop on invalid perf.data file

2013-09-30 Thread Namhyung Kim
From: Namhyung Kim perf-record updates the header in the perf.data file at termination. Without this update perf-report (and other processing built-ins) it caused an infinite loop when perf report (or something like) called. This is because the algorithm in __perf_session__process_events() depen