lkml.org 
[lkml]   [2012]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: perf script: rwtop: SIGALRM and pipe read race
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


\
 
 \ /
  Last update: 2012-09-17 17:41    [W:0.097 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site