[Orca-dev] Help adding 2.6 kernel patches?

C. L. Villani clynne at ofb.net
Mon Jun 27 14:44:35 PDT 2005


Hi!  My name is Connie-Lynne; I'm a sysadmin working with Cynthia
Kiser in Caltech's PR office.  We've been using Orca to collect stats
on some of our machines and we're really happy with it.  However,
we're switching to RHEL4, which uses the 2.6 kernel, so we've been
making some changes to the code in order to continue to collect the
information we need.

I'm not super-familiar with perl, so mostly I just sort of cut 
and pasted the existing code, crossed my fingers and hoped for 
the best.  This worked great for pagein/out and swapin/out, but
I hit a snag with the disk IO stuff and I was wondering if anyone
had any advice.  (I'm happy to share the page and swap code I did,
I just figured I'd not paste it here in order to keep this message
as short as possible).

I've included the diff with some interspersed comments here..

In short, it seems to *pull in* the data just fine:
>      if ( $version=~/^2\.6/ )
>        {
>          $command_to_pass= "iostat";
>      $line = `$command_to_pass`;
>          @lines = split(/\n/, $line);
>        }
> 
>      $n_dsk=0;
> 
>      #begin maybe this initializes the array in such a way that F_OUT can read it?
>      if ( $line=~/disk_io/ ) {
>          @dsk=0;
>          $i=0;
>      ($dsk_stat_t[$r],$dsk_rio_t[$r],$dsk_rblk_t[$r],$dsk_wio_t[$r],$dsk_wblk_t[$r])=(0,0,0,0);
> 
>      foreach $line ( @lines )
>        {
>           if ( $line=~/sd/ || $line=~/fd/) {
>              ($dsk_name[$r][$i], $dsk_stat_t[$r][$i], $dsk_rio_t[$r][$i], $dsk_wio_t[$r][$i], $dsk_rblk_t[$r][$i], $dsk_wblk_t[$r][$i])= split / +/,$line;
>              $n_dsk++;
>           }
>        }
>      }
>      #end maybe this initializes the array in such a way that F_OUT can read it?


Some "print" debug statements I put in indicate that the 
data *is* being collected and stored in that array.


<    put_output ( "disk_op/s",rate(@dsk_stat_t),
<               "disk_rd/s",rate(@dsk_rio_t),
---
>    # CLV don't do the 2.2 disk stuff in later versions.
>    if ( !($version=~/^2\.4/ || $version=~/^2\.6/) ) {
>        put_output ( "disk_op/s",rate(@dsk_stat_t),
>               "disk_rd/s",rate(@dsk_rio_t),
234c274,275
<    );
---
>        );
>       }

It's when I try to "put" the data in there that I get problems;
while I don't get errors, I don't get any numbers pushed out, 
just blank spaces.

246a288,312
>
>    # CLV begin attempt at putting disk stats
>    if ( $version=~/^2\.6/ ) {
>       for ($i=0; $i<$n_dsk; $i++) {
>      $dumb="$dsk_name[$i]";
>      put_output("disk_op_$dumb",$dsk_stat[$r][$i],
>                 "disk_rd_$dumb",$dsk_rio[$r][$i],
>                 "disk_wr_$dumb",$dsk_wio[$r][$i],
>                 "disk_rB_$dumb",$dsk_rblk[$r][$i],
>                 "disk_wB_$dumb",$dsk_wblk[$r][$i]
>          );
>     print "disk_op_$dumb $dsk_stat[$i]\n";
>     print "disk_rd_$dumb $dsk_rio[$i]\n";
>          print "disk_wr_$dumb $dsk_wio[$i]\n";
>     print "disk_rB_$dumb $dsk_rblk[$i]\n";
>     print "disk_wB_$dumb $dsk_wblk[$i]\n";
> 
>       }
>    }
> 
>    # CLV end attempt at putting disk stats

I tried not using the $r$i array at all, and just shoving everything
into my own array, but couldn't figure out how to get flush_output() 
to then push that information out into the datafile.  

Any suggestions would be appreciated!

Thanks!

Connie-Lynne
-- 
People like me, because I force them to, WITH VIOLENCE!
                                        -- The Spore, ATHF



More information about the Orca-dev mailing list