Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-18 Thread Andrew Jones
On Tue, Sep 18, 2012 at 11:05:42AM +0200, Andrew Jones wrote: > Please read the link I posted to the Perl documentation. The standard > Perl signal handling doesn't support SA_RESTART. The Perl developers > found it could lead to data corruption. The patch above attempts to > replace the standard s

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-18 Thread Andrew Jones
On Mon, Sep 17, 2012 at 08:55:43AM -0600, David Ahern wrote: > On 9/14/12 12:10 PM, Andrew Jones wrote: > >On Fri, Sep 14, 2012 at 10:05:03AM -0600, David Ahern wrote: > >>On 9/14/12 9:39 AM, Andrew Jones wrote: > >>> > >>>I recently tried 'perf script rwtop', and it immediately failed with > >>>'f

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-17 Thread David Ahern
On 9/17/12 11:12 AM, Arnaldo Carvalho de Melo wrote: Its possible that changes made to support non tracepoint events introduced this problem, so perhaps bisecting it, as this wasn't present some time ago, i.e. those big numbers :-\ git bisect failed miserably for me. But, pondering a bit on ch

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-17 Thread Arnaldo Carvalho de Melo
Em Mon, Sep 17, 2012 at 10:32:36AM -0600, David Ahern escreveu: > On 9/17/12 10:02 AM, Arnaldo Carvalho de Melo wrote: > >Em Mon, Sep 17, 2012 at 09:16:19AM -0600, David Ahern escreveu: > >>On 9/17/12 8:55 AM, David Ahern wrote: > >>>2. the rwtop.pl script is not handling negative return values ($r

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-17 Thread David Ahern
On 9/17/12 10:02 AM, Arnaldo Carvalho de Melo wrote: Em Mon, Sep 17, 2012 at 09:16:19AM -0600, David Ahern escreveu: On 9/17/12 8:55 AM, David Ahern wrote: 2. the rwtop.pl script is not handling negative return values ($ret < 0) properly -- the '$ret > 0' check is succeeding even though $ret is

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-17 Thread Arnaldo Carvalho de Melo
Em Mon, Sep 17, 2012 at 09:16:19AM -0600, David Ahern escreveu: > On 9/17/12 8:55 AM, David Ahern wrote: > >2. the rwtop.pl script is not handling negative return values ($ret < 0) > >properly -- the '$ret > 0' check is succeeding even though $ret is > >negative (e.g., -EAGAIN) leading to astronomi

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-17 Thread David Ahern
On 9/17/12 8:55 AM, David Ahern wrote: 2. the rwtop.pl script is not handling negative return values ($ret < 0) properly -- the '$ret > 0' check is succeeding even though $ret is negative (e.g., -EAGAIN) leading to astronomical read values I think perl is treating $ret as an unsigned integer.

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-17 Thread David Ahern
On 9/14/12 12:10 PM, Andrew Jones wrote: On Fri, Sep 14, 2012 at 10:05:03AM -0600, David Ahern wrote: On 9/14/12 9:39 AM, Andrew Jones wrote: I recently tried 'perf script rwtop', and it immediately failed with 'failed to read event header'. Running it through strace I found that the when rwto

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-14 Thread Andrew Jones
On Fri, Sep 14, 2012 at 10:05:03AM -0600, David Ahern wrote: > On 9/14/12 9:39 AM, Andrew Jones wrote: > > > >I recently tried 'perf script rwtop', and it immediately failed with > >'failed to read event header'. Running it through strace I found that the > >when rwtop.pl is reading from the pipe,

Re: perf script: rwtop: SIGALRM and pipe read race

2012-09-14 Thread David Ahern
On 9/14/12 9:39 AM, Andrew Jones wrote: I recently tried 'perf script rwtop', and it immediately failed with 'failed to read event header'. Running it through strace I found that the when rwtop.pl is reading from the pipe, and gets one of it's alarms, that the ERESTARTSYS seems to confuse it - c