public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Andrew Jones <drjones@redhat.com>, acme@ghostprotocols.net
Cc: 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 09:16:19 -0600	[thread overview]
Message-ID: <50573EC3.6020209@gmail.com> (raw)
In-Reply-To: <505739EF.5010000@gmail.com>

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) {
     ...

David

  reply	other threads:[~2012-09-17 15:16 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 [this message]
2012-09-17 16:02         ` Arnaldo Carvalho de Melo
2012-09-17 16:32           ` David Ahern
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=50573EC3.6020209@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