From: David Ahern <dsahern@gmail.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Andrew Jones <drjones@redhat.com>,
linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
paulus@samba.org, mingo@redhat.com, tzanussi@gmail.com
Subject: Re: perf script: rwtop: SIGALRM and pipe read race
Date: Mon, 17 Sep 2012 10:32:36 -0600 [thread overview]
Message-ID: <505750A4.9080207@gmail.com> (raw)
In-Reply-To: <20120917160211.GC31375@ghostprotocols.net>
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
>>> negative (e.g., -EAGAIN) leading to astronomical read values
>>
>> I think perl is treating $ret as an unsigned integer.
>>
>> Again, I know little about perl, but this change to
>> ./scripts/perl/rwtop.pl makes it behave properly:
>>
>> my $n = sprintf("%d", $ret);
>>
>> if ($n > 0) {
>> ...
>
> I think what you figured out makes sense, its the best we have and you
> found it to get it back working, could you please send the two patches
> properly signed-off, etc?
I'll do that for the readn.
The above change seems like a workaround - not a proper fix. Why is perl
treating it like an unsigned int? The trace format for the read syscall
shows long. How is the binding done for perl? I can't make heads or
tails of it scanning the files under perl. If we are forced to do a hack
like the above is there a better way? I tried (int) $ret and perl did
not like that. Any other (better) options?
David
next prev parent reply other threads:[~2012-09-17 16:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-14 15:39 perf script: rwtop: SIGALRM and pipe read race Andrew Jones
2012-09-14 16:05 ` David Ahern
2012-09-14 18:10 ` Andrew Jones
2012-09-17 14:55 ` David Ahern
2012-09-17 15:16 ` David Ahern
2012-09-17 16:02 ` Arnaldo Carvalho de Melo
2012-09-17 16:32 ` David Ahern [this message]
2012-09-17 17:12 ` Arnaldo Carvalho de Melo
2012-09-17 20:10 ` David Ahern
2012-09-18 9:05 ` Andrew Jones
2012-09-18 9:30 ` Andrew Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=505750A4.9080207@gmail.com \
--to=dsahern@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=drjones@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=tzanussi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox