[Orca-dev] Help adding 2.6 kernel patches?
Guilherme Chehab
guilherme_chehab at yahoo.com
Tue Jun 28 06:08:45 PDT 2005
Connie-Lynne,
I have updated procallator to support kernel 2.6 a few
weeks ago, the new version (0.3) is available in the
subversion repository. It fortunately was not needed
to call external iostat to achieve collection of disk
statistics (which implies a higher collection
overhead).
Anyway, your hack for disk stats did not work because
the iostat command does not have the string that
proccallator looks for to identify each metric. The
best way is to look for the data in /proc/diskstats,
but the layout of this file is rather different from
their counterparts in 2.4 kernel. It was necessary a
major rewrite of the disk stats collection.
As for page-in and page-out it turned out that the
older kernels used this to represent in this metric
the total pages moved from disks to memory, regardless
if they were due to memory paging or normal I/O
operations. That means that this information is no
usefull for identifying memory shortages as it was
meant to. That way, I stripped out of the code the old
way to collect this data and rewrote it as a new
feature for 2.6 only kernels (which have actually this
information available).
I would recommend everybody to upgrade after checking
the changes document, even users of older versions of
linux kernel as there are some new features for 2.4
kernel as well as some bug and wrongdoings over
collected data).
regards,
Guilherme
--- "C. L. Villani" <clynne at ofb.net> escreveu:
> 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
> _______________________________________________
> Orca-dev mailing list
> Orca-dev at orcaware.com
> http://www.orcaware.com/mailman/listinfo/orca-dev
>
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis.
Instale o discador agora! http://br.acesso.yahoo.com/
More information about the Orca-dev
mailing list