AFS-Monitor

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

Version 0.3.3 (released July 6, 2011)
  * changed ownership from Alf Wachsmann to Steven Jenkins
  * incorporated patches from Jeff Blaine

Version 0.3.2 (released May 14, 2007)
  * removed spurious lib subdirectory from tar file
    Thanks to David Cantrell <david at cantrell.org.uk>

Version 0.3.1 (released April 4, 2007)

 * changed permissions from 755 to 0755 in Makefile.PL
 * ExtUtils::MakeMaker's PERL_MM_USE_DEFAULT environment variable is now obeyed
 * fixed a problem to make it compile on 32 bit RHEL4
 All fixes were submitted by Wolfgang Friebel <Wolfgang.Friebel at desy.de> - Thanks!


Version 0.3.0 (released April 27, 2006)

 * made everything work with OpenAFS-1.4.1
 * cmdebug: PrintCacheEntries() now contains the strings and not the number of the file types
 * added new CallBack statistics from OpenAFS-1.4.1 file servers to xstat_fs_test()
 * added example for CallBack statistics to examples/xstat_fs_test
 * added new statistics "rx_nBusies", "fs_nBusies", "fs_GetCapabilities" to xstat_fs_test()
 * changed call by value to call by reference in a number of functions which reduces the
   memory usage
 * some general code cleanup


Version 0.2.2 (released January 17, 2005)

 * Added a README file as preparation for CPAN


Version 0.2.1 (released November 4, 2004)

 * Handling of shared AFS libraries.
   Thanks to Wolfgang Friebel <Wolfgang.Friebel at desy.de>


Version 0.2.0 (released October 14, 2004)

 * Extended user interface of some functions. They now not only
   take array refs but also single names as string as input.
   Thanks to Peter Scott <Peter.J.Scott at jpl.nasa.gov>


Version 0.1.2 (released September 1, 2004)

 * Added changes for Mac OS X
   Thanks to Sebastian Hagedorn <Hagedorn at uni-koeln.de>


Version 0.1 (released August 15, 2004, revision 1.9)

 * First public release

LICENSES/Artistic  view on Meta::CPAN





			 The "Artistic License"

				Preamble

The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.

Definitions:

	"Package" refers to the collection of files distributed by the
	Copyright Holder, and derivatives of that collection of files
	created through textual modification.

	"Standard Version" refers to such a Package if it has not been
	modified, or has been modified in accordance with the wishes
	of the Copyright Holder as specified below.

	"Copyright Holder" is whoever is named in the copyright or
	copyrights for the package.

	"You" is you, if you're thinking about copying or distributing
	this Package.

	"Reasonable copying fee" is whatever you can justify on the
	basis of media cost, duplication charges, time of people involved,
	and so on.  (You will not be required to justify it to the
	Copyright Holder, but only to the computing community at large
	as a market that must bear the fee.)

	"Freely Available" means that no fee is charged for the item
	itself, though there may be fees involved in handling the item.
	It also means that recipients of the item may redistribute it
	under the same conditions they received it.

1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder.  A Package
modified in such a way shall still be considered the Standard Version.

3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:

    a) place your modifications in the Public Domain or otherwise make them
    Freely Available, such as by posting said modifications to Usenet or
    an equivalent medium, or placing the modifications on a major archive
    site such as uunet.uu.net, or by allowing the Copyright Holder to include
    your modifications in the Standard Version of the Package.

    b) use the modified Package only within your corporation or organization.

    c) rename any non-standard executables so the names do not conflict
    with standard executables, which must also be provided, and provide
    a separate manual page for each non-standard executable that clearly
    documents how it differs from the Standard Version.

    d) make other distribution arrangements with the Copyright Holder.

4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:

    a) distribute a Standard Version of the executables and library files,
    together with instructions (in the manual page or equivalent) on where
    to get the Standard Version.

    b) accompany the distribution with the machine-readable source of
    the Package with your modifications.

    c) give non-standard executables non-standard names, and clearly
    document the differences in manual pages (or equivalent), together
    with instructions on where to get the Standard Version.

    d) make other distribution arrangements with the Copyright Holder.

5. You may charge a reasonable copying fee for any distribution of this
Package.  You may charge any fee you choose for support of this
Package.  You may not charge a fee for this Package itself.  However,
you may distribute this Package in aggregate with other (possibly
commercial) programs as part of a larger (possibly commercial) software
distribution provided that you do not advertise this Package as a
product of your own.  You may embed this Package's interpreter within
an executable of yours (by linking); this shall be construed as a mere
form of aggregation, provided that the complete Standard Version of the

LICENSES/Stanford-LICENSE  view on Meta::CPAN

   Copyright (c) 1994 Board of Trustees, Leland Stanford Jr. University
  
   Redistribution and use in source and binary forms are permitted
   provided that the above copyright notice and this paragraph are
   duplicated in all such forms and that any documentation,
   advertising materials, and other materials related to such
   distribution and use acknowledge that the software was developed
   by Stanford University.  The name of the University may not be used 
   to endorse or promote products derived from this software without 
   specific prior written permission.
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   

Makefile.PL  view on Meta::CPAN

system("cp ./pod/afsmonitor.pod    lib/AFS/Monitor/afsmonitor.pod");
system("cp ./pod/cmdebug.pod       lib/AFS/Monitor/cmdebug.pod");
system("cp ./pod/rxdebug.pod       lib/AFS/Monitor/rxdebug.pod");
system("cp ./pod/scout.pod         lib/AFS/Monitor/scout.pod");
system("cp ./pod/udebug.pod        lib/AFS/Monitor/udebug.pod");
system("cp ./pod/xstat_cm_test.pod lib/AFS/Monitor/xstat_cm_test.pod");
system("cp ./pod/xstat_fs_test.pod lib/AFS/Monitor/xstat_fs_test.pod");


WriteMakefile(
              'NAME'       => 'AFS::Monitor',
              'VERSION'    => $VERSION,
              ($] >= 5.005 ?
                   ('AUTHOR'   => 'Alf Wachsmann, Elizabeth Cassell, and Steven Jenkins',
                    'ABSTRACT' => 'Perl interface to AFS monitoring and debugging APIs'
                   ) : () ),
              'realclean'  => {FILES => 'Makefile.bak pod/*.html pod/pod2htm* lib/AFS/*.pod lib/AFS/Monitor/*.pod examples/debug_out/debug examples/debug_out/outputfile lib'},
             );


sub MY::postamble {
	'
html: Makefile
	cd pod && $(MAKE) html

pod: blib
	cp pod/Monitor.pod       lib/AFS/Monitor.pod
	cp pod/afsmon_stats.pod  lib/AFS/Monitor/afsmon_stats.pod
	cp pod/afsmonitor.pod    lib/AFS/Monitor/afsmonitor.pod
	cp pod/cmdebug.pod       lib/AFS/Monitor/cmdebug.pod
	cp pod/rxdebug.pod       lib/AFS/Monitor/rxdebug.pod
	cp pod/scout.pod         lib/AFS/Monitor/scout.pod
	cp pod/udebug.pod        lib/AFS/Monitor/udebug.pod
	cp pod/xstat_cm_test.pod lib/AFS/Monitor/xstat_cm_test.pod
	cp pod/xstat_fs_test.pod lib/AFS/Monitor/xstat_fs_test.pod
';
}

README  view on Meta::CPAN

This is the README file for the Perl extension module AFS::Monitor (Version 0.3.3)


DESCRIPTION
    The AFS::Monitor module is a dynamically loadable extension to
    Perl. It gives the AFS user and administrator access to most of the
    AFS monitoring and debugging functions, allowing you to make these calls
    directly from Perl, rather than processing the output of a command.


REQUIREMENTS
    Before you can build the AFS module you need to have the
    following installed on your system:

        * Perl 5.6.1 or newer (haven't tested on any older versions)
        * system libraries for OpenAFS 1.2.x and newer (it is unknown
	whether IBM AFS wil work)


COMPATIBILITY
    Please consult the 'pod/Monitor.pod' file for a complete list of AFS
    @sys variable, OS and compiler versions this Perl module is known to
    work with


AVAILABILITY
    The latest version of the AFS::Monitor module is currently available at

 http://github.com/stevenjenkins/AFS-Monitor as well as CPAN.


BUILDING & INSTALLING
    Assuming you have met all the prerequisites, building the module
    should be straightforward. The AFS::Monitor module is distributed as a
    single gzipped tar archive file:

            AFS-Monitor-0.3.3.tar.gz

    Unpack the archive to create an AFS-Monitor installation directory:

        tar zxvf AFS-Monitor-0.3.3.tar.gz

    'cd' into that directory, make, test and install the modules. You
    have to specify the location of the AFS system libraries. While
    running the 'perl Makefile.PL' step you will be prompted for the
    location of the AFS system libraries.  If you want to avoid that
    query, you should specify the environment variable 'AFSPATH'
    before you start[1].  If your AFS system type is not yet known by
    the make file, please follow the printed message.

    This is the sequence of commands to build the modules:

        cd AFS-Monitor-0.3.2

        [1] this step is optional
        setenv AFSPATH 'path_to_the_AFS_system_libraries' # tcsh-shell
        export AFSPATH='path_to_the_AFS_system_libraries' # sh-shell

        perl Makefile.PL
             ---->  Which AFS system libraries should be used? [/usr/afsws]
        make
        make test
        make install


DOCUMENTATION
    POD-format documentation can be found in the directory 'pod'.
    The POD documentation gets automatically installed to the system wide
    Perl documentation. It is readable with the 'perldoc' utility.

    To create a HTML version of the documentation, execute

 cd pod
 make html


EXAMPLES
    The 'examples' directory contains example how to use the
    AFS::Monitor module. The scripts contain almost all ways how to call
    the different functions. We have used these scripts as regression tests
    during development. They should ive you enough ideas how to use the
    different functions.


BUGS
    Please send all bug reports and suggestions for improvements to
    Steven Jenkins <steven.jenkins@gmail.com>. When reporting
    bugs/problems please include information about operating system
    version, perl version, AFS version, AFS::Monitor module version.
    Comments, suggestions and patches are always welcome.


CREDITS
    See the 'CHANGES' file for details.


COPYRIGHT AND DISCLAIMER
    Copyright 2004-2006 Alf Wachsmann <alfw@slac.stanford.edu> and
                        Elizabeth Cassell <e_a_c@mailsnare.net>.
    Copyright 2011 Steven Jenkins <steven.jenkins@gmail.com>
    All rights reserved.

    Most of the explanations in the documentation are taken from the original
    AFS documentation and the AFS Perl module.

    AFS-3 Programmer's Reference:
    Volume Server/Volume Location Server Interface
    Edward R. Zayas
    (c) 1991 Transarc Corporation.
    All rights reserved.

    IBM AFS Administration Reference
    (c) IBM Corporation 2000.
    All rights reserved.

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

examples/Meltdown.pl  view on Meta::CPAN

#	Meltdown.pl -s point -p 7000 -t 300
#
#	Check the server 'point' on port '7000' with 5 minutes between
#	rxdebug commands.
#

use blib;
use AFS::Monitor;

sub Usage {
	print STDERR "\n\n$progName: collect rxdebug stats on AFS process.\n";
	print STDERR "usage: $progName [options]\n";
	print STDERR "options:\n";
	print STDERR " -s <server>    (required parameter, no default).\n";
	print STDERR " -p <port>      (default: 7000).\n";
	print STDERR " -t <interval>  (default: 1200 seconds).\n";
	print STDERR " -C             \n";
	print STDERR " -h             (help: show this help message).\n\n";
	print STDERR "Example: $progName -s point -p 7000\n";
	print STDERR "Collect statistics on server point for port 7000\n";
	print STDERR "Refresh interval will default to 20 minutes (1200 seconds)\n\n";
	exit 0;
} # Usage

sub Check_data {
	#
	# If a value is going to overflow the field length,
	# then bump the field length to match the value.
	# It won't be pretty but we'll have valid data.
	#
	(length $wproc	> $Ln[0]) ? ($Ln[0] = length $wproc)	: "";
	(length $nobuf	> $Ln[1]) ? ($Ln[1] = length $nobuf)	: "";
	(length $wpack	> $Ln[2]) ? ($Ln[2] = length $wpack)	: "";
	(length $fpack	> $Ln[3]) ? ($Ln[3] = length $fpack)	: "";
	(length $calls	> $Ln[4]) ? ($Ln[4] = length $calls)	: "";
	(length $delta	> $Ln[5]) ? ($Ln[5] = length $delta)	: "";
	(length $data	> $Ln[6]) ? ($Ln[6] = length $data)	: "";
	(length $resend	> $Ln[7]) ? ($Ln[7] = length $resend)	: "";
	(length $idle	> $Ln[8]) ? ($Ln[8] = length $idle)	: "";
} # Check_data

sub Header {
    if ($csvmode != 1) {
    	print "\nhh:mm:ss wproc nobufs   wpack  fpack    calls     delta  data      resends  idle\n";
    } else { # assume CSV mode...
    	print "\nhh:mm:ss,wproc,nobufs,wpack,fpack,calls,delta,data,resends,idle\n";
    }
} # Header

#
# don't buffer the output
#
$| = 1;

#
# snag program name (drop the full pathname) :
#
$progName = $0;
$tmpName= "";
GETPROG: while ($letr = chop($progName)) {
	$_ = $letr;
	/\// && last GETPROG;
	$tmpName .= $letr;
}
$progName = reverse($tmpName);

#
# set the defaults for server, port, and delay interval
#
$server	= "";
$port	= 7000;
$delay	= 1200;
$csvmove = 0;

#
# any parms?
#
while ($_ = shift(@ARGV)) {
	GETPARMS: {
		/^-[pP]/ && do {
			$port = shift(@ARGV);
			last GETPARMS;
		};
		/^-[sS]/ && do {
			$server = shift(@ARGV);
			last GETPARMS;
		};
		/^-[tT]/ && do {
			$delay = shift(@ARGV);
			last GETPARMS;
		};
		/^-C/ && do {
			$csvmode = 1;
			last GETPARMS;
		};
		/^-[hH\?]/ && do {
			&Usage();
		};
		/^-/ && do {
			&Usage();
		}
	}
}

#
# if they didn't give us a server name, we can't run
#
if ($server eq "") {
	&Usage();
}
else {
	print "\nServer: $server, Port: $port, Interval $delay seconds\n";
	system date;
}

#
# clear the counters for the first run
#
$wproc	= 0;
$wpack	= 0;
$fpack	= 0;
$calls	= 0;
$data	= 0;

examples/cmdebug  view on Meta::CPAN

my $all = 0;

my $showdump = 1;   # print entire contents of hash for each test
my $formatted = 1;  # print output formatted like the c cmdebug program

print "# Starting now... #\n";
my $locks;
my $cache_entries;

if ($all || $tests[1]) {
  print "\n******** TEST 1: ********\n";

  print "\ncmdebug -server $server -port $port -long\n\n";

  ($locks, $cache_entries) = cmdebug(server => $server,
                                     port   => $port,
                                     long   => 1
                                    );
  parse_result($locks, $cache_entries);
}

if ($all || $tests[2]) {
  print "\n******** TEST 2: ********\n";

  print "\ncmdebug -server $server\n\n";

  ($locks, $cache_entries) = cmdebug(server => $server);
  parse_result($locks, $cache_entries);
}

if ($all || $tests[3]) {
  print "\n******** TEST 3: ********\n";

  print "\ncmdebug -server nonexistant\n\n";

  ($locks, $cache_entries) = cmdebug(server => "nonexistant");
  parse_result($locks, $cache_entries);
}

if ($all || $tests[4]) {
  print "\n******** TEST 4: ********\n";

  print "\ncmdebug -server $server -port 7001\n\n";

  ($locks, $cache_entries) = cmdebug(server => $server,
                                     port   => 7001
                                    );
  parse_result($locks, $cache_entries);
}

if ($all || $tests[5]) {
  print "\n******** TEST 5: ********\n";

  print "\ncmdebug -server $server -port $port\n\n";

  ($locks, $cache_entries) = cmdebug(server => $server,
                                     port   => $port
                                    );
  parse_result($locks, $cache_entries);
}


sub parse_result {
  my $l = shift;
  my $c = shift;

  if ($AFS::CODE) {
    print "Error case: ", ref($l), "\n" if (defined($l));
    print "Error case: ", ref($c), "\n" if (defined($c));
    # die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
    print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
    return;
  }

  if ($showdump) {
    local $Data::Dumper::Quotekeys = 0;
    local $Data::Dumper::Sortkeys = 1;
    local $Data::Dumper::Varname = "Locks";
    local $Data::Dumper::Maxdepth = 3;
    local $Data::Dumper::Indent = 1;
    print Dumper($l);
    local $Data::Dumper::Maxdepth = 1;
    local $Data::Dumper::Indent = 0;
    local $Data::Dumper::Varname = "Cache Entries";
    print Dumper($c);
  }

  if ($formatted) {
    foreach my $lock (@$l) {
      printf("Lock %s status: ", $lock->{name});
      print_lock($lock->{lock});
      print "\n";
    }

    foreach my $centry (@$c) {
      if($centry->{addr} == 0) {
        printf("Proc %4d sleeping at %08x, pri %3d\n",
                $centry->{netFid}->{Vnode},
                $centry->{netFid}->{Volume},
                $centry->{netFid}->{Unique} - 25);
        next;
      }
      printf("** Cache entry @ 0x%08x for %d.%d.%d.%d",
              $centry->{addr},
              $centry->{cell}, $centry->{netFid}->{Volume},
              $centry->{netFid}->{Vnode},
              $centry->{netFid}->{Unique});
      if ((exists $centry->{cellname}) && ($centry->{cellname})) {
        printf " [%s]\n", $centry->{cellname};
      }
      else {
        print "\n";
      }
      if (exists $centry->{lock}) {
        print "    locks: ";
        print_lock($centry->{lock});
        print "\n";
      }
      printf("    %d bytes\tDV %d refcnt %d\n",
               $centry->{Length},
               $centry->{DataVersion},
               $centry->{refCount});
      printf("    callback %08x\texpires %u\n",
               $centry->{callback},
               $centry->{cbExpires});
      printf("    %d opens\t%d writers\n",
               $centry->{opens},
               $centry->{writers});

      print "    ";
      if ($centry->{mvstat} == 0) {
        print "normal file";
      }
      elsif ($centry->{mvstat} == 1) {
        print "mount point";
      }
      elsif ($centry->{mvstat} == 2) {
        print "volume root";
      }
      elsif ($centry->{mvstat} == 3) {
        print "directory";
      }
      elsif ($centry->{mvstat} == 4) {
        print "symlink";
      }
      elsif ($centry->{mvstat} == 5) {
        print "microsoft dfs link";
      }
      elsif ($centry->{mvstat} == 6) {
        print "invalid link";
      }
      else {
        printf("bogus mvstat %d", $centry->{mvstat});
      }

      printf("\n    states (0x%x)", $centry->{states});
      if ($centry->{states} & 1) {
        print ", stat'd";
      }
      if ($centry->{states} & 2) {
        print ", backup";
      }
      if ($centry->{states} & 4) {
        print ", read-only";
      }
      if ($centry->{states} & 8) {
        print ", mt pt valid";
      }
      if ($centry->{states} & 0x10) {
        print ", pending core";
      }
      if ($centry->{states} & 0x40) {
        print ", wait-for-store";
      }
      if ($centry->{states} & 0x80) {
        print ", mapped";
      }
      print "\n";
    }
  }
}


sub print_lock {
  my $lock = shift;

  print "(";
  if ($lock->{waitStates}) {
    if($lock->{waitStates} & constant("READ_LOCK")) {
      print "reader_waiting";
    }
    if($lock->{waitStates} & constant("WRITE_LOCK")) {
      print "writer_waiting";
    }
    if($lock->{waitStates} & constant("SHARED_LOCK")) {
      print "upgrade_waiting";
    }
  }
  else {
    print "none_waiting";
  }
  if ($lock->{exclLocked}) {
    if ($lock->{exclLocked} & constant("WRITE_LOCK")) {
       print ", write_locked";
    }
    if ($lock->{exclLocked} & constant("SHARED_LOCK")) {
       print ", upgrade_locked";
    }
    printf("(pid:%d at:%d)",
            $lock->{pid_writer}, $lock->{src_indicator});
  }
  if ($lock->{readersReading}) {
    printf(", %d read_locks(pid:%d)",
            $lock->{readersReading}, $lock->{pid_last_reader});
  }
  if ($lock->{numWaiting}) {
    printf(", %d waiters", $lock->{numWaiting});
  }
  print ")";
}

examples/rxdebug  view on Meta::CPAN


my $servers  = 'virtue.openafs.org'; # machine to run this on
my $port     = 7001;      # port to run this on
my $onlyhost = 'andrew.e.kth.se';  # some of the tests will show only connections from this host
my $onlyport = 7000;      # some of the tests will show only connections on this port
my $onlyauth = 'auth';    # some of the tests will show only connections with this auth level

my @tests;      # choose which tests to run
$tests[1] = 1;  # prints version
$tests[2] = 0;  # prints all peers and all non-dallying connections.
                # (can be long)
$tests[3] = 0;  # nonexistant host
$tests[4] = 0;  # nonexistant port
$tests[5] = 0;  # bad port; getstats fails. (can be slow)
$tests[6] = 0;  # prints long version of all peers. (can be long)
$tests[7] = 0;  # server $servers port $port. prints default info.
$tests[8] = 0;  # prints rxstats, no connections.
$tests[9] = 0;  # prints only auth $onlyauth
$tests[10] = 0; # shows all connections. (can be long)
$tests[11] = 0; # shows all server connections. (can be long)
$tests[12] = 0; # shows all client connections on port $port from host $onlyhost
$tests[13] = 0; # doesn't give port, tries default (7000).
$tests[14] = 0; # no arguments, runs on current machine with default port.
$tests[15] = 0; # port $port, runs on current machine.
$tests[16] = 0; # prints rxstats, all connections, long version of all peers.
                # (can be very long)

my $all = 1;    # show all tests

my $showdump = 0; # dump contents of hash to the screen for each test instead of printing rxdebug formatted output

# all available options:
# rxdebug(nodally        => 1,
#         allconnections => 1,
#         rxstats        => 1,
#         onlyserver     => 1,

examples/scripts/HandlerScript  view on Meta::CPAN

#
# Copyright © 2004 Alf Wachsmann <alfw@slac.stanford.edu> and
#                  Elizabeth Cassell <e_a_c@mailsnare.net>
#
# $Revision: 1.1 $ $Date: 2004/08/05 20:52:03 $ $Author: alfw $
#

print "*** Handler Script called for an overflow!   ***\n";
print "*** Host name: ", shift, " type: ", shift, "  ***\n";
print "*** Overflow in field ", shift,
                " (threshold ", shift, ",
                      actual ", shift, ") ***\n";

my $otherargs = shift;

if ($otherargs) {
  print "*** Other arguments: ", $otherargs;
  while ($otherargs = shift) {
    print " ", $otherargs;
  }
  print " ***\n";
}

examples/udebug  view on Meta::CPAN

my $all = 0;

my $showdump = 0;   # print entire contents of hash for each test
my $formatted = 1;  # print output formatted like the C udebug program


print "# Starting now... #\n";
my $result;

if ($all || $tests[1]) {
  print "\n******** TEST 1: ********\n";

  print "\nudebug -server $server -port $port -long\n\n";

  $result = udebug(server => $server,
                   port   => $port
                  );
  parse_result($result);
}

if ($all || $tests[2]) {
  print "\n******** TEST 2: ********\n";

  print "\nudebug -server $non_sync_server -port $port\n\n";

  $result = udebug(server => $non_sync_server,
                   port   => $port
                  );
  parse_result($result);
}

if ($all || $tests[3]) {
  print "\n******** TEST 3: ********\n";

  print "\nudebug -server $non_sync_server -port $port -long\n\n";

  $result = udebug(server => $non_sync_server,
                   port   => $port,
                   long   => 1
                  );
  parse_result($result);
}

if ($all || $tests[4]) {
  print "\n******** TEST 4: ********\n";

  print "\nudebug -server $server\n\n";

  $result =udebug(server => $server);
  parse_result($result);
}

if ($all || $tests[5]) {
  print "\n******** TEST 5: ********\n";

  print "\nudebug -server nonexistant\n\n";

  $result = udebug(server => "nonexistant");
  parse_result($result);
}

if ($all || $tests[6]) {
  print "\n******** TEST 6: ********\n";

  print "\nudebug -server $server -port 7001\n\n";

  $result = udebug(server => $server,
                   port   => 7001
                  );
  parse_result($result);
}

if ($all || $tests[7]) {
  print "\n******** TEST 7: ********\n";

  print "\nudebug -server $server -port $port\n\n";

  $result = udebug(server => $server,
                   port   => $port
                  );
  parse_result($result);
}


sub parse_result {
  my $info = shift;

  if ($AFS::CODE) {
    print "Error case: ", ref($info), "\n" if (defined($info));
    # die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
    print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
    return;
  }

  if ($showdump) {
    local $Data::Dumper::Indent = 1;
    local $Data::Dumper::Quotekeys = 0;
    local $Data::Dumper::Sortkeys = 1;
    print Dumper($info);
  }

  if ($formatted) {
    my $diff;

    if (exists $info->{interfaceAddr}) {
      print "Host's addresses are: ", join(" ", @{$info->{interfaceAddr}}),
            "\n";
    }
    printf("Host's %s time is %s\n",
           $info->{host},
           scalar localtime($info->{now}));

    $diff = time - $info->{now};
    printf("Local time is %s (time differential %d secs)\n",
           scalar localtime(time),
           $diff);
    if (abs($diff) >= constant("MAXSKEW")) {
      print "****clock may be bad\n";
    }
    if (exists $info->{lastYesHost}) {
      $diff = $info->{now} - $info->{lastYesTime};
      printf("Last yes vote for %s was %d secs ago (%ssync site); \n",
             $info->{lastYesHost}, $diff, $info->{lastYesState} ? "" : "not ");
      $diff = $info->{now} - $info->{lastYesClaim};
      printf("Last vote started %d secs ago (at %s)\n",
              $diff,
              scalar localtime(time - $diff));
    } else {
      print "Last yes vote not cast yet \n";
    }

    printf "Local db version is %d.%d\n",
            $info->{localVersion}->{epoch},
            $info->{localVersion}->{counter};
    if ($info->{amSyncSite}) {
      if ($info->{syncSiteUntil} == 0x7fffffff) {
        printf("I am sync site forever (%d server%s)\n",
		$info->{nServers},
                $info->{nServers} > 1 ? "s" : "");
      } else {
        $diff = $info->{syncSiteUntil} - $info->{now};
        printf("I am sync site until %d secs from now (at %s) (%d server%s)\n",
                $diff,
                scalar localtime(time + $diff),
                $info->{nServers},
                $info->{nServers} > 1 ? "s" : "");
      }
      printf("Recovery state %x\n", $info->{recoveryState});
      if ($info->{activeWrite}) {
        printf("I am currently managing write trans %d.%d\n",
                $info->{epochTime},
                $info->{tidCounter});
      }
    } else {
      if ($info->{isClone}) {
        print "I am a clone and never can become sync site\n";
      } else {
        print "I am not sync site\n";
      }
      $diff = $info->{now} - $info->{lowestTime};
      printf("Lowest host %s was set %d secs ago\n",
              $info->{lowestHost}, $diff);

      $diff = $info->{now} - $info->{syncTime};
      printf("Sync host %s was set %d secs ago\n",
              $info->{syncHost}, $diff);
    }

    printf("Sync site's db version is %d.%d\n",
	    $info->{syncVersion}->{epoch},
            $info->{syncVersion}->{counter});
    printf("%d locked pages, %d of them for write\n",
	    $info->{lockedPages},
            $info->{writeLockedPages});

    if ($info->{anyReadLocks}) {
      print "There are read locks held\n";
    }
    if ($info->{anyWriteLocks}) {
      print "There are write locks held\n";
    }

    if ($info->{currentTrans}) {
      if ($info->{writeTrans}) {
        print "There is an active write transaction\n";
      } else {
        print "There is at least one active read transaction\n";
      }
      printf("Transaction tid is %d.%d\n",
              $info->{syncTid}->{epoch},
              $info->{syncTid}->{counter});
    }
    if ($info->{epochTime}) {
      $diff = $info->{now} - $info->{epochTime};
      printf("Last time a new db version was labelled was:\n\t %d secs ago (at %s)\n",
	      $diff, scalar localtime(time - $diff));
    }

    if (exists $info->{servers}) {
      foreach my $current (@{$info->{servers}}) {
        printf("\nServer (%s", $current->{addr});
        if (exists $current->{altAddr}) {
          print " ", join(" ", @{$current->{altAddr}});
        }
        printf("): (db %d.%d)",
                $current->{remoteVersion}->{epoch},
                $current->{remoteVersion}->{counter});
        if ($current->{isClone}) {
          print "    is only a clone!";
        }
        print "\n";

        if ($current->{lastVoteTime} == 0) {
          print "    last vote never rcvd \n";
        } else {
          $diff = $info->{now} - $current->{lastVoteTime};
          printf("    last vote rcvd %d secs ago (at %s),\n",
                  $diff, scalar localtime(time - $diff));
        }

        if ($current->{lastBeaconSent} == 0) {
          print "    last beacon never sent \n";
        } else {
          $diff = $info->{now} - $current->{lastBeaconSent};
          printf("    last beacon sent %d secs ago (at %s), last vote was %s\n",
                 $diff,
                 scalar localtime(time - $diff),
                 $current->{lastVote} ? "yes" : "no");
        }

        printf("    dbcurrent=%d, up=%d beaconSince=%d\n",
                $current->{currentDB},
                $current->{up},
                $current->{beaconSinceDown});
      }
    }
  }
}

examples/xstat_cm_test  view on Meta::CPAN

my $all = 1;

my $showdump = 0;   # print entire contents of hash for each test
my $formatted = 1;  # print formatted like original xstat_cm_test program

print "# Starting now... #\n";
my $result;


if ($all || $tests[1]) {
  print "\n******** TEST 1: ********\n";

  print "\nxstat_cm_test -cmname ", join(" ", @cmname),
        " -collID ", join(" ", @collID), "\n\n";

  $result = xstat_cm_test(cmname => \@cmname,
                          collID => \@collID);
  parse_result($result);
}

if ($all || $tests[2]) {
  print "\n******** TEST 2: ********\n";

  print "\nxstat_cm_test -cmname ", join(" ", @cmname), "\n\n";

  $result = xstat_cm_test(cmname => \@cmname);
  parse_result($result);
}


if ($all || $tests[3]) {
  print "\n******** TEST 3: ********\n";

  print "\nxstat_cm_test -cmname ", $cmname[0],
                       " -collID 2\n\n";

  $result = xstat_cm_test(cmname => $cmname[0],
                          collID => 2);
  parse_result($result);
}


if ($all || $tests[4]) {
  print "\n******** TEST 4: ********\n";

  print "\nxstat_cm_test -cmname ", $cmname[0], "\n\n";

  $result = xstat_cm_test(cmname => $cmname[0]);
  parse_result($result);
}



sub parse_result {
  my $info = shift;

  if ($AFS::CODE) {
    print "Error case: ", ref($info), "\n" if (defined($info));
    # die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
    print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
    return;
  }

  if ($showdump) {
    local $Data::Dumper::Quotekeys = 0;
    local $Data::Dumper::Sortkeys = 1;
    local $Data::Dumper::Indent = 1;
    local $Data::Dumper::Maxdepth = 2;
    local $Data::Dumper::Varname = "xstat_cm_test";
    print Dumper($info);
  }

  if ($formatted) {
    foreach my $host (@$info) {
      if ($host->{probeOK} == 0) {
        printf("CM_Handler: Probe 1, collection %d to CM on '%s' failed\n",
                $host->{collectionNumber},
                $host->{hostName});
        return;
      }
      if ($host->{collectionNumber} == constant("AFSCB_XSTATSCOLL_CALL_INFO")) {
        PrintCallInfo($host);
      } elsif ($host->{collectionNumber} == constant("AFSCB_XSTATSCOLL_PERF_INFO")) {
        PrintPerfInfo($host);
      } elsif ($host->{collectionNumber} == constant("AFSCB_XSTATSCOLL_FULL_PERF_INFO")) {
        PrintFullPerfInfo($host);
      } else {
        printf "** Unknown collection: %d\n", $host->{collectionNumber};
      }
    }
  }
}


sub PrintPerfInfo {
  my $host = shift;

  printf("AFSCB_XSTATSCOLL_PERF_INFO (coll %d) for CM %s\n[Probe 1, %s]\n\n",
          $host->{collectionNumber},
          $host->{hostName},
          scalar localtime $host->{probeTime});

  PrintOverallPerfInfo($host->{data});
}


sub PrintFullPerfInfo {
  my $host = shift;

  printf("AFSCB_XSTATSCOLL_FULL_PERF_INFO (coll %d) for CM %s\n[Probe 1, %s]\n\n",
          $host->{collectionNumber},
          $host->{hostName},
          scalar localtime $host->{probeTime});

  print "Overall Performance Info:\n-------------------------\n";

  PrintOverallPerfInfo($host->{data}->{perf});

  print "\n";

  PrintRPCPerfInfo($host->{data}->{rpc});

  my $authentP = $host->{data}->{authent};
  print "\nAuthentication info:\n--------------------\n";

  printf("\t%d PAGS, %d records (%d auth, %d unauth), %d max in PAG, chain max: %d\n",
          $authentP->{curr_PAGs},
          $authentP->{curr_Records},
          $authentP->{curr_AuthRecords},
          $authentP->{curr_UnauthRecords},
          $authentP->{curr_MaxRecordsInPAG},
          $authentP->{curr_LongestChain});
  printf("\t%d PAG creations, %d tkt updates\n",
          $authentP->{PAGCreations},
          $authentP->{TicketUpdates});
  printf("\t[HWMs: %d PAGS, %d records, %d max in PAG, chain max: %d]\n",
          $authentP->{HWM_PAGs},
          $authentP->{HWM_Records},
          $authentP->{HWM_MaxRecordsInPAG},
          $authentP->{HWM_LongestChain});

  my $accessinfP = $host->{data}->{accessinf};
  print "\n[Un]replicated accesses:\n------------------------\n";
  printf("\t%d unrep, %d rep, %d reps accessed, %d max reps/ref, %d first OK\n\n",
          $accessinfP->{unreplicatedRefs},
          $accessinfP->{replicatedRefs},
          $accessinfP->{numReplicasAccessed},
          $accessinfP->{maxReplicasPerRef},
          $accessinfP->{refFirstReplicaOK});
}


sub PrintOverallPerfInfo {
  my $perf = shift;

  printf "\t%10d numPerfCalls\n", $perf->{numPerfCalls};

  printf "\t%10d epoch\n",	 $perf->{epoch};
  printf "\t%10d numCellsVisible\n", $perf->{numCellsVisible};
  printf "\t%10d numCellsContacted\n", $perf->{numCellsContacted};
  printf "\t%10d dlocalAccesses\n", $perf->{dlocalAccesses};
  printf "\t%10d vlocalAccesses\n", $perf->{vlocalAccesses};
  printf "\t%10d dremoteAccesses\n", $perf->{dremoteAccesses};
  printf "\t%10d vremoteAccesses\n", $perf->{vremoteAccesses};
  printf "\t%10d cacheNumEntries\n", $perf->{cacheNumEntries};
  printf "\t%10d cacheBlocksTotal\n", $perf->{cacheBlocksTotal};
  printf "\t%10d cacheBlocksInUse\n", $perf->{cacheBlocksInUse};
  printf "\t%10d cacheBlocksOrig\n", $perf->{cacheBlocksOrig};
  printf "\t%10d cacheMaxDirtyChunks\n", $perf->{cacheMaxDirtyChunks};
  printf "\t%10d cacheCurrDirtyChunks\n", $perf->{cacheCurrDirtyChunks};
  printf "\t%10d dcacheHits\n", $perf->{dcacheHits};
  printf "\t%10d vcacheHits\n", $perf->{vcacheHits};
  printf "\t%10d dcacheMisses\n", $perf->{dcacheMisses};
  printf "\t%10d vcacheMisses\n", $perf->{vcacheMisses};
  printf "\t%10d cacheFilesReused\n", $perf->{cacheFilesReused};
  printf "\t%10d vcacheXAllocs\n", $perf->{vcacheXAllocs};
  printf "\t%10d dcacheXAllocs\n", $perf->{dcacheXAllocs};

  printf "\t%10d bufAlloced\n", $perf->{bufAlloced};
  printf "\t%10d bufHits\n",	 $perf->{bufHits};
  printf "\t%10d bufMisses\n", $perf->{bufMisses};
  printf "\t%10d bufFlushDirty\n", $perf->{bufFlushDirty};

  printf "\t%10d LargeBlocksActive\n", $perf->{LargeBlocksActive};
  printf "\t%10d LargeBlocksAlloced\n", $perf->{LargeBlocksAlloced};
  printf "\t%10d SmallBlocksActive\n", $perf->{SmallBlocksActive};
  printf "\t%10d SmallBlocksAlloced\n", $perf->{SmallBlocksAlloced};
  printf "\t%10d OutStandingMemUsage\n", $perf->{OutStandingMemUsage};
  printf "\t%10d OutStandingAllocs\n", $perf->{OutStandingAllocs};
  printf "\t%10d CallBackAlloced\n", $perf->{CallBackAlloced};
  printf "\t%10d CallBackFlushes\n", $perf->{CallBackFlushes};
  printf "\t%10d CallBackLoops\n", $perf->{cbloops};

  printf "\t%10d srvRecords\n", $perf->{srvRecords};
  printf "\t%10d srvNumBuckets\n", $perf->{srvNumBuckets};
  printf "\t%10d srvMaxChainLength\n", $perf->{srvMaxChainLength};
  printf "\t%10d srvMaxChainLengthHWM\n", $perf->{srvMaxChainLengthHWM};
  printf "\t%10d srvRecordsHWM\n", $perf->{srvRecordsHWM};

  printf "\t%10d sysName_ID\n", $perf->{sysName_ID};

  print "\tFile Server up/downtimes, same cell:\n";
  PrintUpDownStats($perf->{fs_UpDown}->[0]);

  print "\tFile Server up/downtimes, diff cell:\n";
  PrintUpDownStats($perf->{fs_UpDown}->[1]);

  print "\tVL Server up/downtimes, same cell:\n";
  PrintUpDownStats($perf->{vl_UpDown}->[0]);

  print "\tVL Server up/downtimes, diff cell:\n";
  PrintUpDownStats($perf->{vl_UpDown}->[1]);
}


sub PrintUpDownStats {
  my $updown = shift;

  printf "\t\t%10d numTtlRecords\n",	$updown->{numTtlRecords};
  printf "\t\t%10d numUpRecords\n",	$updown->{numUpRecords};
  printf "\t\t%10d numDownRecords\n",	$updown->{numDownRecords};
  printf "\t\t%10d sumOfRecordAges\n",$updown->{sumOfRecordAges};
  printf "\t\t%10d ageOfYoungestRecord\n",$updown->{ageOfYoungestRecord};
  printf "\t\t%10d ageOfOldestRecord\n",$updown->{ageOfOldestRecord};
  printf "\t\t%10d numDowntimeIncidents\n",$updown->{numDowntimeIncidents};
  printf "\t\t%10d numRecordsNeverDown\n",$updown->{numRecordsNeverDown};
  printf "\t\t%10d maxDowntimesInARecord\n",$updown->{maxDowntimesInARecord};
  printf "\t\t%10d sumOfDowntimes\n",	$updown->{sumOfDowntimes};
  printf "\t\t%10d shortestDowntime\n",$updown->{shortestDowntime};
  printf "\t\t%10d longestDowntime\n",$updown->{longestDowntime};

  printf "\t\tDowntime duration distribution:\n";
  printf "\t\t\t%8d: 0 min .. 10 min\n",  $updown->{downDurations}->[0];
  printf "\t\t\t%8d: 10 min .. 30 min\n", $updown->{downDurations}->[1];
  printf "\t\t\t%8d: 30 min .. 1 hr\n",   $updown->{downDurations}->[2];
  printf "\t\t\t%8d: 1 hr .. 2 hr\n",     $updown->{downDurations}->[3];
  printf "\t\t\t%8d: 2 hr .. 4 hr\n",     $updown->{downDurations}->[4];
  printf "\t\t\t%8d: 4 hr .. 8 hr\n",     $updown->{downDurations}->[5];
  printf "\t\t\t%8d: > 8 hr\n",           $updown->{downDurations}->[6];

  printf "\t\tDowntime incident distribution:\n";
  printf "\t\t\t%8d: 0 times\n",        $updown->{downIncidents}->[0];
  printf "\t\t\t%8d: 1 time\n",         $updown->{downIncidents}->[1];
  printf "\t\t\t%8d: 2 .. 5 times\n",   $updown->{downIncidents}->[2];
  printf "\t\t\t%8d: 6 .. 10 times\n",  $updown->{downIncidents}->[3];
  printf "\t\t\t%8d: 10 .. 50 times\n", $updown->{downIncidents}->[4];
  printf "\t\t\t%8d: > 50 times\n",     $updown->{downIncidents}->[5];
}


sub PrintRPCPerfInfo {
  my $rpc = shift;

  print "FS Operation Timings:\n---------------------\n";
  foreach (sort keys %{$rpc->{fsRPCTimes}}) {
    printf "%15s: %d ops (%d OK); sum=%f, sqr=%f, min=%f, max=%f\n",
           $_,
           $rpc->{fsRPCTimes}->{$_}->{numOps}, $rpc->{fsRPCTimes}->{$_}->{numSuccesses},
           $rpc->{fsRPCTimes}->{$_}->{sumTime}, $rpc->{fsRPCTimes}->{$_}->{sqrTime},
           $rpc->{fsRPCTimes}->{$_}->{minTime}, $rpc->{fsRPCTimes}->{$_}->{maxTime};
  }

  print "\nError Info:\n-----------\n";
  foreach (sort keys %{$rpc->{fsRPCErrors}}) {
    printf "%15s: %d server, %d network, %d prot, %d vol, %d busies, %d other\n",
           $_,
           $rpc->{fsRPCErrors}->{$_}->{err_Server},
           $rpc->{fsRPCErrors}->{$_}->{err_Network},
           $rpc->{fsRPCErrors}->{$_}->{err_Protection},
           $rpc->{fsRPCErrors}->{$_}->{err_Volume},
           $rpc->{fsRPCErrors}->{$_}->{err_VolumeBusies},
           $rpc->{fsRPCErrors}->{$_}->{err_Other};
  }

  print "\nTransfer timings:\n-----------------\n";
  foreach (sort keys %{$rpc->{fsXferTimes}}) {
    printf "%s: %d xfers (%d OK), time sum=%f, sqr=%f, min=%f, max=%f\n",
           $_,
           $rpc->{fsXferTimes}->{$_}->{numXfers}, $rpc->{fsXferTimes}->{$_}->{numSuccesses},
           $rpc->{fsXferTimes}->{$_}->{sumTime},
           $rpc->{fsXferTimes}->{$_}->{sqrTime},
           $rpc->{fsXferTimes}->{$_}->{minTime},
           $rpc->{fsXferTimes}->{$_}->{maxTime};

    printf "\t[bytes: sum=%d, min=%d, max=%d]\n",
           $rpc->{fsXferTimes}->{$_}->{sumBytes},
           $rpc->{fsXferTimes}->{$_}->{minBytes},
           $rpc->{fsXferTimes}->{$_}->{maxBytes};

    printf "\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d, 6: %d, 7: %d, 8: %d]\n",
           $rpc->{fsXferTimes}->{$_}->{count}->[0],
           $rpc->{fsXferTimes}->{$_}->{count}->[1],
           $rpc->{fsXferTimes}->{$_}->{count}->[2],
           $rpc->{fsXferTimes}->{$_}->{count}->[3],
           $rpc->{fsXferTimes}->{$_}->{count}->[4],
           $rpc->{fsXferTimes}->{$_}->{count}->[5],
           $rpc->{fsXferTimes}->{$_}->{count}->[6],
           $rpc->{fsXferTimes}->{$_}->{count}->[7],
           $rpc->{fsXferTimes}->{$_}->{count}->[8];
  }

  print "\nCM Operation Timings:\n---------------------\n";
  foreach (sort keys %{$rpc->{cmRPCTimes}}) {
    printf "%15s: %d ops (%d OK); sum=%f, sqr=%f, min=%f, max=%f\n",
           $_,
           $rpc->{cmRPCTimes}->{$_}->{numOps}, $rpc->{cmRPCTimes}->{$_}->{numSuccesses},
           $rpc->{cmRPCTimes}->{$_}->{sumTime}, $rpc->{cmRPCTimes}->{$_}->{sqrTime},
           $rpc->{cmRPCTimes}->{$_}->{minTime}, $rpc->{cmRPCTimes}->{$_}->{maxTime};
  }
}



sub PrintCallInfo {
  my $host = shift;

  printf "AFSCB_XSTATSCOLL_CALL_INFO (coll %d) for CM %s\n[Probe 1, %s]\n\n",
    $host->{collectionNumber},
    $host->{hostName},
    scalar localtime $host->{probeTime};

  my $data = $host->{data};

  printf "\t%10d afs_init\n", $data->{afs_init};
  printf "\t%10d gop_rdwr\n", $data->{gop_rdwr};
  printf "\t%10d aix_gnode_rele\n", $data->{aix_gnode_rele};
  printf "\t%10d gettimeofday\n", $data->{gettimeofday};
  printf "\t%10d m_cpytoc\n", $data->{m_cpytoc};
  printf "\t%10d aix_vattr_null\n", $data->{aix_vattr_null};
  printf "\t%10d afs_gn_frunc\n", $data->{afs_gn_ftrunc};
  printf "\t%10d afs_gn_rdwr\n", $data->{afs_gn_rdwr};
  printf "\t%10d afs_gn_ioctl\n", $data->{afs_gn_ioctl};
  printf "\t%10d afs_gn_locktl\n", $data->{afs_gn_lockctl};
  printf "\t%10d afs_gn_readlink\n", $data->{afs_gn_readlink};
  printf "\t%10d afs_gn_readdir\n", $data->{afs_gn_readdir};
  printf "\t%10d afs_gn_select\n", $data->{afs_gn_select};
  printf "\t%10d afs_gn_strategy\n", $data->{afs_gn_strategy};
  printf "\t%10d afs_gn_symlink\n", $data->{afs_gn_symlink};
  printf "\t%10d afs_gn_revoke\n", $data->{afs_gn_revoke};
  printf "\t%10d afs_gn_link\n", $data->{afs_gn_link};
  printf "\t%10d afs_gn_mkdir\n", $data->{afs_gn_mkdir};
  printf "\t%10d afs_gn_mknod\n", $data->{afs_gn_mknod};
  printf "\t%10d afs_gn_remove\n", $data->{afs_gn_remove};
  printf "\t%10d afs_gn_rename\n", $data->{afs_gn_rename};
  printf "\t%10d afs_gn_rmdir\n", $data->{afs_gn_rmdir};
  printf "\t%10d afs_gn_fid\n", $data->{afs_gn_fid};
  printf "\t%10d afs_gn_lookup\n", $data->{afs_gn_lookup};
  printf "\t%10d afs_gn_open\n", $data->{afs_gn_open};
  printf "\t%10d afs_gn_create\n", $data->{afs_gn_create};
  printf "\t%10d afs_gn_hold\n", $data->{afs_gn_hold};
  printf "\t%10d afs_gn_rele\n", $data->{afs_gn_rele};
  printf "\t%10d afs_gn_unmap\n", $data->{afs_gn_unmap};
  printf "\t%10d afs_gn_access\n", $data->{afs_gn_access};
  printf "\t%10d afs_gn_getattr\n", $data->{afs_gn_getattr};
  printf "\t%10d afs_gn_setattr\n", $data->{afs_gn_setattr};
  printf "\t%10d afs_gn_fclear\n", $data->{afs_gn_fclear};
  printf "\t%10d afs_gn_fsync\n", $data->{afs_gn_fsync};
  printf "\t%10d phash\n", $data->{pHash};
  printf "\t%10d DInit\n", $data->{DInit};
  printf "\t%10d DRead\n", $data->{DRead};
  printf "\t%10d FixupBucket\n", $data->{FixupBucket};
  printf "\t%10d afs_newslot\n", $data->{afs_newslot};
  printf "\t%10d DRelease\n", $data->{DRelease};
  printf "\t%10d DFlush\n", $data->{DFlush};
  printf "\t%10d DFlushEntry\n", $data->{DFlushEntry};
  printf "\t%10d DVOffset\n", $data->{DVOffset};
  printf "\t%10d DZap\n", $data->{DZap};
  printf "\t%10d DNew\n", $data->{DNew};
  printf "\t%10d afs_RemoveVCB\n", $data->{afs_RemoveVCB};
  printf "\t%10d afs_NewVCache\n", $data->{afs_NewVCache};
  printf "\t%10d afs_FlushActiveVcaches\n", $data->{afs_FlushActiveVcaches};
  printf "\t%10d afs_VerifyVCache\n", $data->{afs_VerifyVCache};
  printf "\t%10d afs_WriteVCache\n", $data->{afs_WriteVCache};
  printf "\t%10d afs_GetVCache\n", $data->{afs_GetVCache};
  printf "\t%10d afs_StuffVcache\n", $data->{afs_StuffVcache};
  printf "\t%10d afs_FindVCache\n", $data->{afs_FindVCache};
  printf "\t%10d afs_PutDCache\n", $data->{afs_PutDCache};
  printf "\t%10d afs_PutVCache\n", $data->{afs_PutVCache};
  printf "\t%10d CacheStoreProc\n", $data->{CacheStoreProc};
  printf "\t%10d afs_FindDcache\n", $data->{afs_FindDCache};
  printf "\t%10d afs_TryToSmush\n", $data->{afs_TryToSmush};
  printf "\t%10d afs_AdjustSize\n", $data->{afs_AdjustSize};
  printf "\t%10d afs_CheckSize\n", $data->{afs_CheckSize};
  printf "\t%10d afs_StoreWarn\n", $data->{afs_StoreWarn};
  printf "\t%10d CacheFetchProc\n", $data->{CacheFetchProc};
  printf "\t%10d UFS_CacheStoreProc\n", $data->{UFS_CacheStoreProc};
  printf "\t%10d UFS_CacheFetchProc\n", $data->{UFS_CacheFetchProc};
  printf "\t%10d afs_GetDCache\n", $data->{afs_GetDCache};
  printf "\t%10d afs_SimpleVStat\n", $data->{afs_SimpleVStat};
  printf "\t%10d afs_ProcessFS\n", $data->{afs_ProcessFS};
  printf "\t%10d afs_InitCacheInfo\n", $data->{afs_InitCacheInfo};
  printf "\t%10d afs_InitVolumeInfo\n", $data->{afs_InitVolumeInfo};
  printf "\t%10d afs_InitCacheFile\n", $data->{afs_InitCacheFile};
  printf "\t%10d afs_CacheInit\n", $data->{afs_CacheInit};
  printf "\t%10d afs_GetDSlot\n", $data->{afs_GetDSlot};
  printf "\t%10d afs_WriteThroughDSlots\n", $data->{afs_WriteThroughDSlots};
  printf "\t%10d afs_MemGetDSlot\n", $data->{afs_MemGetDSlot};
  printf "\t%10d afs_UFSGetDSlot\n", $data->{afs_UFSGetDSlot};
  printf "\t%10d afs_StoreDCache\n", $data->{afs_StoreDCache};
  printf "\t%10d afs_StoreMini\n", $data->{afs_StoreMini};
  printf "\t%10d afs_StoreAllSegments\n", $data->{afs_StoreAllSegments};
  printf "\t%10d afs_InvalidateAllSegments\n", $data->{afs_InvalidateAllSegments};
  printf "\t%10d afs_TruncateAllSegments\n", $data->{afs_TruncateAllSegments};
  printf "\t%10d afs_CheckVolSync\n", $data->{afs_CheckVolSync};
  printf "\t%10d afs_wakeup\n", $data->{afs_wakeup};
  printf "\t%10d afs_CFileOpen\n", $data->{afs_CFileOpen};
  printf "\t%10d afs_CFileTruncate\n", $data->{afs_CFileTruncate};
  printf "\t%10d afs_GetDownD\n", $data->{afs_GetDownD};
  printf "\t%10d afs_WriteDCache\n", $data->{afs_WriteDCache};
  printf "\t%10d afs_FlushDCache\n", $data->{afs_FlushDCache};
  printf "\t%10d afs_GetDownDSlot\n", $data->{afs_GetDownDSlot};
  printf "\t%10d afs_FlushVCache\n", $data->{afs_FlushVCache};
  printf "\t%10d afs_GetDownV\n", $data->{afs_GetDownV};
  printf "\t%10d afs_QueueVCB\n", $data->{afs_QueueVCB};
  printf "\t%10d afs_call\n", $data->{afs_call};
  printf "\t%10d afs_syscall_call\n", $data->{afs_syscall_call};
  printf "\t%10d afs_syscall_icreate\n", $data->{afs_syscall_icreate};
  printf "\t%10d afs_syscall_iopen\n", $data->{afs_syscall_iopen};
  printf "\t%10d afs_syscall_iincdec\n", $data->{afs_syscall_iincdec};
  printf "\t%10d afs_syscall_ireadwrite\n", $data->{afs_syscall_ireadwrite};
  printf "\t%10d afs_syscall\n", $data->{afs_syscall};
  printf "\t%10d lpioctl\n", $data->{lpioctl};
  printf "\t%10d lsetpag\n", $data->{lsetpag};
  printf "\t%10d afs_CheckInit\n", $data->{afs_CheckInit};
  printf "\t%10d ClearCallback\n", $data->{ClearCallBack};
  printf "\t%10d SRXAFSCB_GetCE\n", $data->{SRXAFSCB_GetCE};
  printf "\t%10d SRXAFSCB_GetLock\n", $data->{SRXAFSCB_GetLock};
  printf "\t%10d SRXAFSCB_CallBack\n", $data->{SRXAFSCB_CallBack};
  printf "\t%10d SRXAFSCB_InitCallBackState\n", $data->{SRXAFSCB_InitCallBackState};
  printf "\t%10d SRXAFSCB_Probe\n", $data->{SRXAFSCB_Probe};
  printf "\t%10d afs_Chunk\n", $data->{afs_Chunk};
  printf "\t%10d afs_ChunkBase\n", $data->{afs_ChunkBase};
  printf "\t%10d afs_ChunkOffset\n", $data->{afs_ChunkOffset};
  printf "\t%10d afs_ChunkSize\n", $data->{afs_ChunkSize};
  printf "\t%10d afs_ChunkToBase\n", $data->{afs_ChunkToBase};
  printf "\t%10d afs_ChunkToSize\n", $data->{afs_ChunkToSize};
  printf "\t%10d afs_SetChunkSize\n", $data->{afs_SetChunkSize};
  printf "\t%10d afs_config\n", $data->{afs_config};
  printf "\t%10d mem_freebytes\n", $data->{mem_freebytes};
  printf "\t%10d mem_getbytes\n", $data->{mem_getbytes};
  printf "\t%10d afs_Daemon\n", $data->{afs_Daemon};
  printf "\t%10d afs_CheckRootVolume\n", $data->{afs_CheckRootVolume};
  printf "\t%10d BPath\n", $data->{BPath};
  printf "\t%10d BPrefetch\n", $data->{BPrefetch};
  printf "\t%10d BStore\n", $data->{BStore};
  printf "\t%10d afs_BBusy\n", $data->{afs_BBusy};
  printf "\t%10d afs_BQueue\n", $data->{afs_BQueue};
  printf "\t%10d afs_BRelease\n", $data->{afs_BRelease};
  printf "\t%10d afs_BackgroundDaemon\n", $data->{afs_BackgroundDaemon};
  printf "\t%10d exporter_add\n", $data->{exporter_add};
  printf "\t%10d exporter_find\n", $data->{exporter_find};
  printf "\t%10d afs_gfs_kalloc\n", $data->{afs_gfs_kalloc};
  printf "\t%10d afs_gfs_kfree\n", $data->{afs_gfs_kfree};
  printf "\t%10d gop_lookupname\n", $data->{gop_lookupname};
  printf "\t%10d afs_uniqtime\n", $data->{afs_uniqtime};
  printf "\t%10d gfs_vattr_null\n", $data->{gfs_vattr_null};
  printf "\t%10d afs_lock\n", $data->{afs_lock};
  printf "\t%10d afs_unlock\n", $data->{afs_unlock};
  printf "\t%10d afs_update\n", $data->{afs_update};
  printf "\t%10d afs_gclose\n", $data->{afs_gclose};
  printf "\t%10d afs_gopen\n", $data->{afs_gopen};
  printf "\t%10d afs_greadlink\n", $data->{afs_greadlink};
  printf "\t%10d afs_select\n", $data->{afs_select};
  printf "\t%10d afs_gbmap\n", $data->{afs_gbmap};
  printf "\t%10d afs_getfsdata\n", $data->{afs_getfsdata};
  printf "\t%10d afs_gsymlink\n", $data->{afs_gsymlink};
  printf "\t%10d afs_namei\n", $data->{afs_namei};
  printf "\t%10d afs_gmount\n", $data->{afs_gmount};
  printf "\t%10d afs_gget\n", $data->{afs_gget};
  printf "\t%10d afs_glink\n", $data->{afs_glink};
  printf "\t%10d afs_gmkdir\n", $data->{afs_gmkdir};
  printf "\t%10d afs_unlink\n", $data->{afs_unlink};
  printf "\t%10d afs_grmdir\n", $data->{afs_grmdir};
  printf "\t%10d afs_makenode\n", $data->{afs_makenode};
  printf "\t%10d afs_grename\n", $data->{afs_grename};
  printf "\t%10d afs_rele\n", $data->{afs_rele};
  printf "\t%10d afs_syncgp\n", $data->{afs_syncgp};
  printf "\t%10d afs_getval\n", $data->{afs_getval};
  printf "\t%10d afs_trunc\n", $data->{afs_trunc};
  printf "\t%10d afs_rwgp\n", $data->{afs_rwgp};
  printf "\t%10d afs_stat\n", $data->{afs_stat};
  printf "\t%10d afsc_link\n", $data->{afsc_link};
  printf "\t%10d afs_vfs_mount\n", $data->{afs_vfs_mount};
  printf "\t%10d afs_uniqtime\n", $data->{afs_uniqtime};
  printf "\t%10d iopen\n", $data->{iopen};
  printf "\t%10d idec\n", $data->{idec};
  printf "\t%10d iinc\n", $data->{iinc};
  printf "\t%10d ireadwrite\n", $data->{ireadwrite};
  printf "\t%10d iread\n", $data->{iread};
  printf "\t%10d iwrite\n", $data->{iwrite};
  printf "\t%10d iforget\n", $data->{iforget};
  printf "\t%10d icreate\n", $data->{icreate};
  printf "\t%10d igetinode\n", $data->{igetinode};
  printf "\t%10d osi_SleepR\n", $data->{osi_SleepR};
  printf "\t%10d osi_SleepS\n", $data->{osi_SleepS};
  printf "\t%10d osi_SleepW\n", $data->{osi_SleepW};
  printf "\t%10d osi_Sleep\n", $data->{osi_Sleep};
  printf "\t%10d afs_LookupMCE\n", $data->{afs_LookupMCE};
  printf "\t%10d afs_MemReadBlk\n", $data->{afs_MemReadBlk};
  printf "\t%10d afs_MemReadUIO\n", $data->{afs_MemReadUIO};
  printf "\t%10d afs_MemWriteBlk\n", $data->{afs_MemWriteBlk};
  printf "\t%10d afs_MemWriteUIO\n", $data->{afs_MemWriteUIO};
  printf "\t%10d afs_MemCacheStoreProc\n", $data->{afs_MemCacheStoreProc};
  printf "\t%10d afs_MemCacheFetchProc\n", $data->{afs_MemCacheFetchProc};
  printf "\t%10d afs_MemCacheTruncate\n", $data->{afs_MemCacheTruncate};
  printf "\t%10d afs_MemCacheStoreProc\n", $data->{afs_MemCacheStoreProc};
  printf "\t%10d afs_GetNfsClientPag\n", $data->{afs_GetNfsClientPag};
  printf "\t%10d afs_FindNfsClientPag\n", $data->{afs_FindNfsClientPag};
  printf "\t%10d afs_PutNfsClientPag\n", $data->{afs_PutNfsClientPag};
  printf "\t%10d afs_nfsclient_reqhandler\n", $data->{afs_nfsclient_reqhandler};
  printf "\t%10d afs_nfsclient_GC\n", $data->{afs_nfsclient_GC};
  printf "\t%10d afs_nfsclient_hold\n", $data->{afs_nfsclient_hold};
  printf "\t%10d afs_nfsclient_stats\n", $data->{afs_nfsclient_stats};
  printf "\t%10d afs_nfsclient_sysname\n", $data->{afs_nfsclient_sysname};
  printf "\t%10d afs_rfs_dispatch\n", $data->{afs_rfs_dispatch};
  printf "\t%10d afs_nfs2afscall\n", $data->{Nfs2AfsCall};
  printf "\t%10d afs_sun_xuntext\n", $data->{afs_sun_xuntext};
  printf "\t%10d osi_Active\n", $data->{osi_Active};
  printf "\t%10d osi_FlushPages\n", $data->{osi_FlushPages};
  printf "\t%10d osi_FlushText\n", $data->{osi_FlushText};
  printf "\t%10d osi_CallProc\n", $data->{osi_CallProc};
  printf "\t%10d osi_CancelProc\n", $data->{osi_CancelProc};
  printf "\t%10d osi_Invisible\n", $data->{osi_Invisible};
  printf "\t%10d osi_Time\n", $data->{osi_Time};
  printf "\t%10d osi_Alloc\n", $data->{osi_Alloc};
  printf "\t%10d osi_SetTime\n", $data->{osi_SetTime};
  printf "\t%10d osi_Dump\n", $data->{osi_Dump};
  printf "\t%10d osi_Free\n", $data->{osi_Free};
  printf "\t%10d osi_UFSOpen\n", $data->{osi_UFSOpen};
  printf "\t%10d osi_Close\n", $data->{osi_Close};
  printf "\t%10d osi_Stat\n", $data->{osi_Stat};
  printf "\t%10d osi_Truncate\n", $data->{osi_Truncate};
  printf "\t%10d osi_Read\n", $data->{osi_Read};
  printf "\t%10d osi_Write\n", $data->{osi_Write};
  printf "\t%10d osi_MapStrategy\n", $data->{osi_MapStrategy};
  printf "\t%10d osi_AllocLargeSpace\n", $data->{osi_AllocLargeSpace};
  printf "\t%10d osi_FreeLargeSpace\n", $data->{osi_FreeLargeSpace};
  printf "\t%10d osi_AllocSmallSpace\n", $data->{osi_AllocSmallSpace};
  printf "\t%10d osi_FreeSmallSpace\n", $data->{osi_FreeSmallSpace};
  printf "\t%10d osi_CloseToTheEdge\n", $data->{osi_CloseToTheEdge};
  printf "\t%10d osi_xgreedy\n", $data->{osi_xgreedy};
  printf "\t%10d osi_FreeSocket\n", $data->{osi_FreeSocket};
  printf "\t%10d osi_NewSocket\n", $data->{osi_NewSocket};
  printf "\t%10d osi_NetSend\n", $data->{osi_NetSend};
  printf "\t%10d WaitHack\n", $data->{WaitHack};
  printf "\t%10d osi_CancelWait\n", $data->{osi_CancelWait};
  printf "\t%10d osi_Wakeup\n", $data->{osi_Wakeup};
  printf "\t%10d osi_Wait\n", $data->{osi_Wait};
  printf "\t%10d dirp_Read\n", $data->{dirp_Read};
  printf "\t%10d dirp_Cpy\n", $data->{dirp_Cpy};
  printf "\t%10d dirp_Eq\n", $data->{dirp_Eq};
  printf "\t%10d dirp_Write\n", $data->{dirp_Write};
  printf "\t%10d dirp_Zap\n", $data->{dirp_Zap};
  printf "\t%10d afs_ioctl\n", $data->{afs_ioctl};
  printf "\t%10d handleIoctl\n", $data->{HandleIoctl};
  printf "\t%10d afs_xioctl\n", $data->{afs_xioctl};
  printf "\t%10d afs_pioctl\n", $data->{afs_pioctl};
  printf "\t%10d HandlePioctl\n", $data->{HandlePioctl};
  printf "\t%10d PGetVolumeStatus\n", $data->{PGetVolumeStatus};
  printf "\t%10d PSetVolumeStatus\n", $data->{PSetVolumeStatus};
  printf "\t%10d PFlush\n", $data->{PFlush};
  printf "\t%10d PFlushVolumeData\n", $data->{PFlushVolumeData};
  printf "\t%10d PNewStatMount\n", $data->{PNewStatMount};
  printf "\t%10d PGetTokens\n", $data->{PGetTokens};
  printf "\t%10d PSetTokens\n", $data->{PSetTokens};
  printf "\t%10d PUnlog\n", $data->{PUnlog};
  printf "\t%10d PCheckServers\n", $data->{PCheckServers};
  printf "\t%10d PCheckAuth\n", $data->{PCheckAuth};
  printf "\t%10d PCheckVolNames\n", $data->{PCheckVolNames};
  printf "\t%10d PFindVolume\n", $data->{PFindVolume};
  printf "\t%10d Prefetch\n", $data->{Prefetch};
  printf "\t%10d PGetCacheSize\n", $data->{PGetCacheSize};
  printf "\t%10d PSetCacheSize\n", $data->{PSetCacheSize};
  printf "\t%10d PSetSysName\n", $data->{PSetSysName};
  printf "\t%10d PExportAfs\n", $data->{PExportAfs};
  printf "\t%10d HandleClientContext\n", $data->{HandleClientContext};
  printf "\t%10d PViceAccess\n", $data->{PViceAccess};
  printf "\t%10d PRemoveCallBack\n", $data->{PRemoveCallBack};
  printf "\t%10d PRemoveMount\n", $data->{PRemoveMount};
  printf "\t%10d PSetVolumeStatus\n", $data->{PSetVolumeStatus};
  printf "\t%10d PListCells\n", $data->{PListCells};
  printf "\t%10d PNewCell\n", $data->{PNewCell};
  printf "\t%10d PGetUserCell\n", $data->{PGetUserCell};
  printf "\t%10d PGetCellStatus\n", $data->{PGetCellStatus};
  printf "\t%10d PSetCellStatus\n", $data->{PSetCellStatus};
  printf "\t%10d PVenusLogging\n", $data->{PVenusLogging};
  printf "\t%10d PGetAcl\n", $data->{PGetAcl};
  printf "\t%10d PGetFID\n", $data->{PGetFID};
  printf "\t%10d PSetAcl\n", $data->{PSetAcl};
  printf "\t%10d PGetFileCell\n", $data->{PGetFileCell};
  printf "\t%10d PGetWSCell\n", $data->{PGetWSCell};
  printf "\t%10d PGetSPrefs\n", $data->{PGetSPrefs};
  printf "\t%10d PSetSPrefs\n", $data->{PSetSPrefs};
  printf "\t%10d afs_ResetAccessCache\n", $data->{afs_ResetAccessCache};
  printf "\t%10d afs_FindUser\n", $data->{afs_FindUser};
  printf "\t%10d afs_GetUser\n", $data->{afs_GetUser};
  printf "\t%10d afs_GCUserData\n", $data->{afs_GCUserData};
  printf "\t%10d afs_PutUser\n", $data->{afs_PutUser};
  printf "\t%10d afs_SetPrimary\n", $data->{afs_SetPrimary};
  printf "\t%10d afs_ResetUserConns\n", $data->{afs_ResetUserConns};
  printf "\t%10d afs_RemoveUserConns\n", $data->{RemoveUserConns};
  printf "\t%10d afs_ResourceInit\n", $data->{afs_ResourceInit};
  printf "\t%10d afs_GetCell\n", $data->{afs_GetCell};
  printf "\t%10d afs_GetCellByIndex\n", $data->{afs_GetCellByIndex};
  printf "\t%10d afs_GetCellByName\n", $data->{afs_GetCellByName};
  if (exists $data->{afs_GetRealCellByIndex}) {
    printf "\t%10d afs_GetRealCellByIndex\n", $data->{afs_GetRealCellByIndex};
  }
  printf "\t%10d afs_NewCell\n", $data->{afs_NewCell};
  printf "\t%10d CheckVLDB\n", $data->{CheckVLDB};
  printf "\t%10d afs_GetVolume\n", $data->{afs_GetVolume};
  printf "\t%10d afs_PutVolume\n", $data->{afs_PutVolume};
  printf "\t%10d afs_GetVolumeByName\n", $data->{afs_GetVolumeByName};
  printf "\t%10d afs_random\n", $data->{afs_random};
  printf "\t%10d InstallVolumeEntry\n", $data->{InstallVolumeEntry};
  printf "\t%10d InstallVolumeInfo\n", $data->{InstallVolumeInfo};
  printf "\t%10d afs_ResetVolumeInfo\n", $data->{afs_ResetVolumeInfo};
  printf "\t%10d afs_FindServer\n", $data->{afs_FindServer};
  printf "\t%10d afs_GetServer\n", $data->{afs_GetServer};
  printf "\t%10d afs_SortServers\n", $data->{afs_SortServers};
  printf "\t%10d afs_CheckServers\n", $data->{afs_CheckServers};
  printf "\t%10d ServerDown\n", $data->{ServerDown};
  printf "\t%10d afs_Conn\n", $data->{afs_Conn};
  printf "\t%10d afs_PutConn\n", $data->{afs_PutConn};
  printf "\t%10d afs_ConnByHost\n", $data->{afs_ConnByHost};
  printf "\t%10d afs_ConnByMHosts\n", $data->{afs_ConnByMHosts};
  printf "\t%10d afs_Analyze\n", $data->{afs_Analyze};
  printf "\t%10d afs_CheckLocks\n", $data->{afs_CheckLocks};
  printf "\t%10d CheckVLServer\n", $data->{CheckVLServer};
  printf "\t%10d afs_CheckCacheResets\n", $data->{afs_CheckCacheResets};
  printf "\t%10d afs_CheckVolumeNames\n", $data->{afs_CheckVolumeNames};
  printf "\t%10d afs_CheckCode\n", $data->{afs_CheckCode};
  printf "\t%10d afs_CopyError\n", $data->{afs_CopyError};
  printf "\t%10d afs_FinalizeReq\n", $data->{afs_FinalizeReq};
  printf "\t%10d afs_GetVolCache\n", $data->{afs_GetVolCache};
  printf "\t%10d afs_GetVolSlot\n", $data->{afs_GetVolSlot};
  printf "\t%10d afs_UFSGetVolSlot\n", $data->{afs_UFSGetVolSlot};
  printf "\t%10d afs_MemGetVolSlot\n", $data->{afs_MemGetVolSlot};
  printf "\t%10d afs_WriteVolCache\n", $data->{afs_WriteVolCache};
  printf "\t%10d haveCallbacksfrom\n", $data->{HaveCallBacksFrom};
  printf "\t%10d afs_getpage\n", $data->{afs_getpage};
  printf "\t%10d afs_putpage\n", $data->{afs_putpage};
  printf "\t%10d afs_nfsrdwr\n", $data->{afs_nfsrdwr};
  printf "\t%10d afs_map\n", $data->{afs_map};
  printf "\t%10d afs_cmp\n", $data->{afs_cmp};
  printf "\t%10d afs_PageLeft\n", $data->{afs_PageLeft};
  printf "\t%10d afs_mount\n", $data->{afs_mount};
  printf "\t%10d afs_unmount\n", $data->{afs_unmount};
  printf "\t%10d afs_root\n", $data->{afs_root};
  printf "\t%10d afs_statfs\n", $data->{afs_statfs};
  printf "\t%10d afs_sync\n", $data->{afs_sync};
  printf "\t%10d afs_vget\n", $data->{afs_vget};
  printf "\t%10d afs_index\n", $data->{afs_index};
  printf "\t%10d afs_setpag\n", $data->{afs_setpag};
  printf "\t%10d genpag\n", $data->{genpag};
  printf "\t%10d getpag\n", $data->{getpag};
  printf "\t%10d afs_GetMariner\n", $data->{afs_GetMariner};
  printf "\t%10d afs_AddMarinerName\n", $data->{afs_AddMarinerName};
  printf "\t%10d afs_open\n", $data->{afs_open};
  printf "\t%10d afs_close\n", $data->{afs_close};
  printf "\t%10d afs_closex\n", $data->{afs_closex};
  printf "\t%10d afs_write\n", $data->{afs_write};
  printf "\t%10d afs_UFSwrite\n", $data->{afs_UFSWrite};
  printf "\t%10d afs_Memwrite\n", $data->{afs_MemWrite};
  printf "\t%10d afs_rdwr\n", $data->{afs_rdwr};
  printf "\t%10d afs_read\n", $data->{afs_read};
  printf "\t%10d afs_UFSread\n", $data->{afs_UFSRead};
  printf "\t%10d afs_Memread\n", $data->{afs_MemRead};
  printf "\t%10d afs_CopyOutAttrs\n", $data->{afs_CopyOutAttrs};
  printf "\t%10d afs_access\n", $data->{afs_access};
  printf "\t%10d afs_getattr\n", $data->{afs_getattr};
  printf "\t%10d afs_setattr\n", $data->{afs_setattr};
  printf "\t%10d afs_VAttrToAS\n", $data->{afs_VAttrToAS};
  printf "\t%10d EvalMountPoint\n", $data->{EvalMountPoint};
  printf "\t%10d afs_lookup\n", $data->{afs_lookup};
  printf "\t%10d afs_create\n", $data->{afs_create};
  printf "\t%10d afs_LocalHero\n", $data->{afs_LocalHero};
  printf "\t%10d afs_remove\n", $data->{afs_remove};
  printf "\t%10d afs_link\n", $data->{afs_link};
  printf "\t%10d afs_rename\n", $data->{afs_rename};
  printf "\t%10d afs_InitReq\n", $data->{afs_InitReq};
  printf "\t%10d afs_mkdir\n", $data->{afs_mkdir};
  printf "\t%10d afs_rmdir\n", $data->{afs_rmdir};
  printf "\t%10d afs_readdir\n", $data->{afs_readdir};
  printf "\t%10d afs_read1dir\n", $data->{afs_read1dir};
  printf "\t%10d afs_readdir_move\n", $data->{afs_readdir_move};
  printf "\t%10d afs_readdir_iter\n", $data->{afs_readdir_iter};
  printf "\t%10d afs_symlink\n", $data->{afs_symlink};
  printf "\t%10d afs_HandleLink\n", $data->{afs_HandleLink};
  printf "\t%10d afs_MemHandleLink\n", $data->{afs_MemHandleLink};
  printf "\t%10d afs_UFSHandleLink\n", $data->{afs_UFSHandleLink};
  printf "\t%10d HandleFlock\n", $data->{HandleFlock};
  printf "\t%10d afs_readlink\n", $data->{afs_readlink};
  printf "\t%10d afs_fsync\n", $data->{afs_fsync};
  printf "\t%10d afs_inactive\n", $data->{afs_inactive};
  printf "\t%10d afs_ustrategy\n", $data->{afs_ustrategy};
  printf "\t%10d afs_strategy\n", $data->{afs_strategy};
  printf "\t%10d afs_bread\n", $data->{afs_bread};
  printf "\t%10d afs_brelse\n", $data->{afs_brelse};
  printf "\t%10d afs_bmap\n", $data->{afs_bmap};
  printf "\t%10d afs_fid\n", $data->{afs_fid};
  printf "\t%10d afs_FakeOpen\n", $data->{afs_FakeOpen};
  printf "\t%10d afs_FakeClose\n", $data->{afs_FakeClose};
  printf "\t%10d afs_StoreOnLastReference\n", $data->{afs_StoreOnLastReference};
  printf "\t%10d afs_AccessOK\n", $data->{afs_AccessOK};
  printf "\t%10d afs_GetAccessBits\n", $data->{afs_GetAccessBits};
  printf "\t%10d afsio_copy\n", $data->{afsio_copy};
  printf "\t%10d afsio_trim\n", $data->{afsio_trim};
  printf "\t%10d afsio_skip\n", $data->{afsio_skip};
  printf "\t%10d afs_page_read\n", $data->{afs_page_read};
  printf "\t%10d afs_page_write\n", $data->{afs_page_write};
  printf "\t%10d afs_page_read\n", $data->{afs_page_read};
  printf "\t%10d afs_get_groups_from_pag\n", $data->{afs_get_groups_from_pag};
  printf "\t%10d afs_get_pag_from_groups\n", $data->{afs_get_pag_from_groups};
  printf "\t%10d AddPag\n", $data->{AddPag};
  printf "\t%10d PagInCred\n", $data->{PagInCred};
  printf "\t%10d afs_getgroups\n", $data->{afs_getgroups};
  printf "\t%10d afs_page_in\n", $data->{afs_page_in};
  printf "\t%10d afs_page_out\n", $data->{afs_page_out};
  printf "\t%10d afs_AdvanceFD\n", $data->{afs_AdvanceFD};
  printf "\t%10d afs_lockf\n", $data->{afs_lockf};
  printf "\t%10d afs_xsetgroups\n", $data->{afs_xsetgroups};
  printf "\t%10d afs_nlinks\n", $data->{afs_nlinks};
  printf "\t%10d afs_lockctl\n", $data->{afs_lockctl};
  printf "\t%10d afs_xflock\n", $data->{afs_xflock};
  printf "\t%10d PGetCPrefs\n", $data->{PGetCPrefs};
  printf "\t%10d PSetCPrefs\n", $data->{PSetCPrefs};
  if (exists $host->{afs_pagein}) {
    printf "\t%10d afs_pagein\n", $data->{afs_pagein};
    printf "\t%10d afs_pageout\n", $data->{afs_pageout};
    printf "\t%10d afs_hp_strategy\n", $data->{afs_hp_strategy};
  }
  printf "\t%10d PFlushMount\n", $data->{PFlushMount};
}

examples/xstat_fs_test  view on Meta::CPAN


my $all = 0;

my $showdump = 0;   # print entire contents of hash for each test
my $formatted = 1;  # print formatted like original xstat_fs_test program

print "# Starting now... #\n";
my $result;

if ($all || $tests[1]) {
  print "\n******** TEST 1: ********\n";

  print "\nxstat_fs_test -fsname ", join(" ", @fsname),
        " -collID ", join(" ", @collID), "\n\n";

  $result = xstat_fs_test(fsname => \@fsname,
                          collID => \@collID);
  parse_result($result);
}

if ($all || $tests[2]) {
  print "\n******** TEST 2: ********\n";

  print "\nxstat_fs_test -fsname ", join(" ", @fsname), "\n\n";

  $result = xstat_fs_test(fsname => \@fsname);
  parse_result($result);
}


if ($all || $tests[3]) {
  print "\n******** TEST 3: ********\n";

  print "\nxstat_fs_test -fsname ", $fsname[0],
                       " -collID 0\n\n";

  $result = xstat_fs_test(fsname => $fsname[0],
                          collID => 0);
  parse_result($result);
}

if ($all || $tests[4]) {
  print "\n******** TEST 4: ********\n";

  print "\nxstat_fs_test -fsname ", $fsname[0],
                       " -collID 1\n\n";

  $result = xstat_fs_test(fsname => $fsname[0],
                          collID => 1);
  parse_result($result);
}

if ($all || $tests[5]) {
  print "\n******** TEST 5: ********\n";

  print "\nxstat_fs_test -fsname ", $fsname[0],
                       " -collID 2\n\n";

  $result = xstat_fs_test(fsname => $fsname[0],
                          collID => 2);
  parse_result($result);
}


if ($all || $tests[6]) {
  print "\n******** TEST 6: ********\n";

  print "\nxstat_fs_test -fsname ", $fsname[0],
                       " -collID 3\n\n";

  $result = xstat_fs_test(fsname => $fsname[0],
                          collID => 3);
  parse_result($result);
}


if ($all || $tests[7]) {
  print "\n******** TEST 7: ********\n";

  print "\nxstat_fs_test -fsname ", $fsname[0], "\n\n";

  $result = xstat_fs_test(fsname => $fsname[0]);
  parse_result($result);
}


sub parse_result {
  my $info = shift;

  if ($AFS::CODE) {
    print "Error case: ", ref($info), "\n" if (defined($info));
    # die("Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n");
    print "Error: AFS::CODE = $AFS::CODE (", ($AFS::CODE+0), ")\n";
    return;
  }

  if ($showdump) {
    local $Data::Dumper::Quotekeys = 0;
    local $Data::Dumper::Sortkeys = 1;
    local $Data::Dumper::Indent = 1;
    local $Data::Dumper::Varname = "xstat_fs_test";
    local $Data::Dumper::Maxdepth = 2;
    print Dumper($info);
  }

  if ($formatted) {
    foreach my $host (@$info) {
      print "\n------------------------------------------------------------\n";
      if ($host->{probeOK} == 0) {
        printf "FS_Handler: Probe 1 to File Server '$host->{hostName}' failed\n",
      } elsif($host->{collectionNumber} == constant("AFS_XSTATSCOLL_CALL_INFO")) {
        parse_CallInfo($host);
      } elsif($host->{collectionNumber} == constant("AFS_XSTATSCOLL_PERF_INFO")) {
        parse_PerfInfo($host);
      } elsif($host->{collectionNumber} == constant("AFS_XSTATSCOLL_FULL_PERF_INFO")) {
        parse_FullPerfInfo($host);
      } elsif($host->{collectionNumber} == constant("AFS_XSTATSCOLL_CBSTATS")) {
        parse_CbCounters($host);
      } else {
        print "Unknown collection: $host->{collectionNumber}\n";
      }
    }
  }
}


sub parse_CallInfo {
  my $host = shift;

  printf("AFS_XSTATSCOLL_CALL_INFO (coll %d) for FS %s\n[Probe 1, %s]\n\n",
          $host->{collectionNumber},
          $host->{hostName},
          scalar localtime $host->{probeTime});

  for (my $i = 0; $i < $host->{data}->{AFS_CollData_len}; $i++) {
    print $host->{i}, " ";
  }
  print "\n";
}


sub parse_PerfInfo {
  my $host = shift;

  printf("AFS_XSTATSCOLL_PERF_INFO (coll %d) for FS %s\n[Probe 1, %s]\n\n",
          $host->{collectionNumber},
          $host->{hostName},
          scalar localtime($host->{probeTime}));
  parse_OverallPerfInfo($host->{data});
}


sub parse_FullPerfInfo {
  my $host = shift;

  printf("AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe 1, %s]\n\n",
          $host->{collectionNumber},
          $host->{hostName},
          scalar localtime($host->{probeTime}));
  parse_OverallPerfInfo($host->{data});
  parse_DetailedPerfInfo($host->{data});
}


sub parse_OverallPerfInfo {
  my $data = shift;

  printf "\t%10d numPerfCalls\n\n",      $data->{numPerfCalls};

  printf "\t%10d vcache_L_Entries\n",    $data->{vcache_L_Entries};
  printf "\t%10d vcache_L_Allocs\n",     $data->{vcache_L_Allocs};
  printf "\t%10d vcache_L_Gets\n",       $data->{vcache_L_Gets};
  printf "\t%10d vcache_L_Reads\n",      $data->{vcache_L_Reads};
  printf "\t%10d vcache_L_Writes\n\n",   $data->{vcache_L_Writes};

  printf "\t%10d vcache_S_Entries\n",    $data->{vcache_S_Entries};
  printf "\t%10d vcache_S_Allocs\n",     $data->{vcache_S_Allocs};
  printf "\t%10d vcache_S_Gets\n",       $data->{vcache_S_Gets};
  printf "\t%10d vcache_S_Reads\n",      $data->{vcache_S_Reads};
  printf "\t%10d vcache_S_Writes\n\n",   $data->{vcache_S_Writes};

  printf "\t%10d vcache_H_Entries\n",    $data->{vcache_H_Entries};
  printf "\t%10d vcache_H_Gets\n",       $data->{vcache_H_Gets};
  printf "\t%10d vcache_H_Replacements\n\n",     $data->{vcache_H_Replacements};

  printf "\t%10d dir_Buffers\n",     $data->{dir_Buffers};
  printf "\t%10d dir_Calls\n",       $data->{dir_Calls};
  printf "\t%10d dir_IOs\n\n",       $data->{dir_IOs};

  printf "\t%10d rx_packetRequests\n",     $data->{rx_packetRequests};
  printf "\t%10d rx_noPackets_RcvClass\n", $data->{rx_noPackets_RcvClass};
  printf "\t%10d rx_noPackets_SendClass\n",      $data->{rx_noPackets_SendClass};
  printf "\t%10d rx_noPackets_SpecialClass\n",   $data->{rx_noPackets_SpecialClass};
  printf "\t%10d rx_socketGreedy\n",       $data->{rx_socketGreedy};
  printf "\t%10d rx_bogusPacketOnRead\n",  $data->{rx_bogusPacketOnRead};
  printf "\t%10d rx_bogusHost\n",        $data->{rx_bogusHost};
  printf "\t%10d rx_noPacketOnRead\n",   $data->{rx_noPacketOnRead};
  printf "\t%10d rx_noPacketBuffersOnRead\n",    $data->{rx_noPacketBuffersOnRead};
  printf "\t%10d rx_selects\n",          $data->{rx_selects};
  printf "\t%10d rx_sendSelects\n",      $data->{rx_sendSelects};
  printf "\t%10d rx_packetsRead_RcvClass\n",     $data->{rx_packetsRead_RcvClass};
  printf "\t%10d rx_packetsRead_SendClass\n",    $data->{rx_packetsRead_SendClass};
  printf "\t%10d rx_packetsRead_SpecialClass\n", $data->{rx_packetsRead_SpecialClass};
  printf "\t%10d rx_dataPacketsRead\n",    $data->{rx_dataPacketsRead};
  printf "\t%10d rx_ackPacketsRead\n",     $data->{rx_ackPacketsRead};
  printf "\t%10d rx_dupPacketsRead\n",     $data->{rx_dupPacketsRead};
  printf "\t%10d rx_spuriousPacketsRead\n",      $data->{rx_spuriousPacketsRead};
  printf "\t%10d rx_packetsSent_RcvClass\n",     $data->{rx_packetsSent_RcvClass};
  printf "\t%10d rx_packetsSent_SendClass\n",    $data->{rx_packetsSent_SendClass};
  printf "\t%10d rx_packetsSent_SpecialClass\n", $data->{rx_packetsSent_SpecialClass};
  printf "\t%10d rx_ackPacketsSent\n",     $data->{rx_ackPacketsSent};
  printf "\t%10d rx_pingPacketsSent\n",    $data->{rx_pingPacketsSent};
  printf "\t%10d rx_abortPacketsSent\n",   $data->{rx_abortPacketsSent};
  printf "\t%10d rx_busyPacketsSent\n",    $data->{rx_busyPacketsSent};
  printf "\t%10d rx_dataPacketsSent\n",    $data->{rx_dataPacketsSent};
  printf "\t%10d rx_dataPacketsReSent\n",  $data->{rx_dataPacketsReSent};
  printf "\t%10d rx_dataPacketsPushed\n",  $data->{rx_dataPacketsPushed};
  printf "\t%10d rx_ignoreAckedPacket\n",  $data->{rx_ignoreAckedPacket};
  printf "\t%10d rx_totalRtt_Sec\n",       $data->{rx_totalRtt_Sec};
  printf "\t%10d rx_totalRtt_Usec\n",      $data->{rx_totalRtt_Usec};
  printf "\t%10d rx_minRtt_Sec\n",         $data->{rx_minRtt_Sec};
  printf "\t%10d rx_minRtt_Usec\n",        $data->{rx_minRtt_Usec};
  printf "\t%10d rx_maxRtt_Sec\n",         $data->{rx_maxRtt_Sec};
  printf "\t%10d rx_maxRtt_Usec\n",        $data->{rx_maxRtt_Usec};
  printf "\t%10d rx_nRttSamples\n",        $data->{rx_nRttSamples};
  printf "\t%10d rx_nServerConns\n",       $data->{rx_nServerConns};
  printf "\t%10d rx_nClientConns\n",       $data->{rx_nClientConns};
  printf "\t%10d rx_nPeerStructs\n",       $data->{rx_nPeerStructs};
  printf "\t%10d rx_nCallStructs\n",       $data->{rx_nCallStructs};
  printf "\t%10d rx_nFreeCallStructs\n", $data->{rx_nFreeCallStructs};
  if (defined($data->{rx_nBusies})) {  # only on OpenAFS-1.4.1
    printf "\t%10d rx_nBusies\n\n", $data->{rx_nBusies};

    printf "\t%10d fs_nBusies\n", $data->{fs_nBusies};
    printf "\t%10d fs_GetCapabilities\n\n", $data->{fs_GetCapabilities};
  }

  printf "\t%10d host_NumHostEntries\n",   $data->{host_NumHostEntries};
  printf "\t%10d host_HostBlocks\n",       $data->{host_HostBlocks};
  printf "\t%10d host_NonDeletedHosts\n",  $data->{host_NonDeletedHosts};
  printf "\t%10d host_HostsInSameNetOrSubnet\n", $data->{host_HostsInSameNetOrSubnet};
  printf "\t%10d host_HostsInDiffSubnet\n",      $data->{host_HostsInDiffSubnet};
  printf "\t%10d host_HostsInDiffNetwork\n",     $data->{host_HostsInDiffNetwork};
  printf "\t%10d host_NumClients\n",       $data->{host_NumClients};
  printf "\t%10d host_ClientBlocks\n\n",   $data->{host_ClientBlocks};

  printf "\t%10d sysname_ID\n",      $data->{sysname_ID};
}


sub parse_DetailedPerfInfo {
  my $data = shift;

  printf "\t%10d epoch\n", $data->{epoch};

  my $rpcop = $data->{rpcOpTimes};

  parse_OpTiming("FetchData", $rpcop);
  parse_OpTiming("FetchACL", $rpcop);
  parse_OpTiming("FetchStatus", $rpcop);
  parse_OpTiming("StoreData", $rpcop);
  parse_OpTiming("StoreACL", $rpcop);
  parse_OpTiming("StoreStatus", $rpcop);
  parse_OpTiming("RemoveFile", $rpcop);
  parse_OpTiming("CreateFile", $rpcop);
  parse_OpTiming("Rename", $rpcop);
  parse_OpTiming("Symlink", $rpcop);
  parse_OpTiming("Link", $rpcop);
  parse_OpTiming("MakeDir", $rpcop);
  parse_OpTiming("RemoveDir", $rpcop);
  parse_OpTiming("SetLock", $rpcop);
  parse_OpTiming("ExtendLock", $rpcop);
  parse_OpTiming("ReleaseLock", $rpcop);
  parse_OpTiming("GetStatistics", $rpcop);
  parse_OpTiming("GiveUpCallbacks", $rpcop);
  parse_OpTiming("GetVolumeInfo", $rpcop);
  parse_OpTiming("GetVolumeStatus", $rpcop);
  parse_OpTiming("SetVolumeStatus", $rpcop);
  parse_OpTiming("GetRootVolume", $rpcop);
  parse_OpTiming("CheckToken", $rpcop);
  parse_OpTiming("GetTime", $rpcop);
  parse_OpTiming("NGetVolumeInfo", $rpcop);
  parse_OpTiming("BulkStatus", $rpcop);
  parse_OpTiming("XStatsVersion", $rpcop);
  parse_OpTiming("GetXStats", $rpcop);

  my $xferop = $data->{xferOpTimes};

  parse_XferTiming("FetchData", $xferop);
  parse_XferTiming("StoreData", $xferop);
}


sub parse_CbCounters {
  my $host = shift;

  printf("AFS_XSTATSCOLL_CBSTATS (coll %d) for FS %s\n[Probe 1, %s]\n\n",
          $host->{collectionNumber},
          $host->{hostName},
          scalar localtime($host->{probeTime}));

  printf "\t%10d DeleteFiles\n",        $host->{CbCounters}->{DeleteFiles};
  printf "\t%10d DeleteCallBacks\n",    $host->{CbCounters}->{DeleteCallBacks};
  printf "\t%10d BreakCallBacks\n",     $host->{CbCounters}->{BreakCallBacks};
  printf "\t%10d AddCallBack\n",        $host->{CbCounters}->{AddCallBack};
  printf "\t%10d GotSomeSpaces\n",      $host->{CbCounters}->{GotSomeSpaces};
  printf "\t%10d DeleteAllCallBacks\n", $host->{CbCounters}->{DeleteAllCallBacks};
  printf "\t%10d nFEs\n",               $host->{CbCounters}->{nFEs};
  printf "\t%10d nCBs\n",               $host->{CbCounters}->{nCBs};
  printf "\t%10d nblks\n",              $host->{CbCounters}->{nblks};
  printf "\t%10d CBsTimedOut\n",        $host->{CbCounters}->{CBsTimedOut};
  printf "\t%10d nbreakers\n",          $host->{CbCounters}->{nbreakers};
  printf "\t%10d GSS1\n",               $host->{CbCounters}->{GSS1};
  printf "\t%10d GSS2\n",               $host->{CbCounters}->{GSS2};
  printf "\t%10d GSS3\n",               $host->{CbCounters}->{GSS3};
  printf "\t%10d GSS4\n",               $host->{CbCounters}->{GSS4};
  printf "\t%10d GSS5\n",               $host->{CbCounters}->{GSS5};
}


sub parse_OpTiming {
  my ($name, $rpcop) = @_;

  printf("%15s: %d ops (%d OK); sum=%f, sqr=%f, min=%f, max=%f\n",
          $name, $rpcop->{$name}->{numOps}, $rpcop->{$name}->{numSuccesses},
          $rpcop->{$name}->{sumTime}, $rpcop->{$name}->{sqrTime},
          $rpcop->{$name}->{minTime}, $rpcop->{$name}->{maxTime});
}


sub parse_XferTiming {
  my ($name, $xferop) = @_;

  printf("%s: %d xfers (%d OK), time sum=%f, sqr=%f, min=%f, max=%f\n",
          $name, $xferop->{$name}->{numXfers}, $xferop->{$name}->{numSuccesses},
          $xferop->{$name}->{sumTime}, $xferop->{$name}->{sqrTime},
          $xferop->{$name}->{minTime}, $xferop->{$name}->{maxTime});

  printf("\t[bytes: sum=%lu, min=%d, max=%d]\n",
          $xferop->{$name}->{sumBytes},
          $xferop->{$name}->{minBytes},
          $xferop->{$name}->{maxBytes});

  printf("\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d, 6: %d, 7: %d, 8: %d]\n",
          $xferop->{$name}->{count}->[0],
          $xferop->{$name}->{count}->[1],
          $xferop->{$name}->{count}->[2],
          $xferop->{$name}->{count}->[3],
          $xferop->{$name}->{count}->[4],
          $xferop->{$name}->{count}->[5],
          $xferop->{$name}->{count}->[6],
          $xferop->{$name}->{count}->[7],
          $xferop->{$name}->{count}->[8]);
}

pod/Makefile  view on Meta::CPAN

CONVERTERS = pod2html

POD2HTML = $(P2H) \
	    --htmlroot=./ \
	    --podpath=./ \
	    --verbose \
	    --noindex \
	    --libpods=Monitor:afsmon_stats:afsmonitor:cmdebug:rxdebug:scout:udebug:xstat_cm_test:xstat_fs_test

all: $(CONVERTERS)

converters: $(CONVERTERS)

P2H = /usr/local/bin/pod2html

POD = \
	afsmon_stats.pod  \
	afsmonitor.pod    \
	Monitor.pod  \
	cmdebug.pod       \
	rxdebug.pod       \
	scout.pod         \
	udebug.pod        \
	xstat_cm_test.pod \
	xstat_fs_test.pod

HTML = \
	afsmon_stats.html  \
	afsmonitor.html    \
	Monitor.html  \
	cmdebug.html       \
	rxdebug.html       \
	scout.html         \
	udebug.html        \
	xstat_cm_test.html \
	xstat_fs_test.html

html:	$(P2H) $(HTML)

.SUFFIXES: .pm .pod

.SUFFIXES: .html

.pod.html:
	$(POD2HTML) --infile=$*.pod --outfile=$*.html

clean:
	rm -f $(HTML)
	rm -f pod2html-*cache
	rm -f pod2htmi.x* pod2htmd.x*

realclean:	clean
	rm -f $(CONVERTERS)

distclean:	realclean

pod/Monitor.pod  view on Meta::CPAN


Gathers the specified data collections associated with the specified File
Server process. See L<xstat_fs_test(1)>

=back

=head1 COMPATIBILITY

The configurations that this package has been tested on are listed below:

  OS              @sys            Perl            	OpenAFS
  -----------------------------------------------------------------------------
  FC5             amd64_linux26   v5.8.8			1.4.2-beta1
  RHEL4-64        amd64_linux26   v5.8.5			1.4.1
  RHEL4-32        no machine
  RHEL3-32        i386linux24     v5.8.0, v5.8.8, v5.6.0	1.4.1, 1.2.10
  RHEL3-64        no machine
  SLES9           ia64_linux26    v5.8.3			1.4.1

  Solaris 5.8     sun4x_58        v5.8.8, v5.6.0, 5.005_03	1.4.1, 1.2.10
  Solaris 5.9     sun4x_59        v5.8.8, v5.6.0		1.4.1, 1.2.10
  Solaris 5.10    sun4x_510       v5.8.8, v5.6.0		1.4.1, 1.2.10

  Mac OS X 10.3   ppc_darwin_70   v5.8.1-RC3			1.4.1
  Mac OS x 10.4   ppc_darwin_80   v5.8.6			1.4.1


Perl 5.6.0 or newer. No problems were found with threaded Perl.
AFS system libraries and header files from B<OpenAFS 1.2.x> or newer.
It is not know whether version 0.3.0 of this module works with
B<IBM/Transarc AFS> because I don't have this version available any more.


=head1 PREREQUISITES

pod/afsmonitor.pod  view on Meta::CPAN

# This library is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#------------------------------------------------------------------------------

=head1 NAME

B<afsmonitor> - Gathers statistics about File Servers and Cache Managers

=head1 SYNOPSIS

  use AFS::Monitor;
  my ($fs, $cm);

  ($fs, $cm) = afsmonitor(cmhosts => "hostName1");

  ($fs, $cm) = afsmonitor(
                          cmhosts => ["hostName1", "hostName2"],
                          fshosts => ["hostName3", "hostName4"],
                         );

  ($fs, $cm) = afsmonitor(
                          config => "configfilename",
                          output => "outputfilename",
                          detailed => 1,
                         );

  foreach $host (@$fs) {
    print "FS Host: $host->{hostName}\n";
    if($host->{probeOK}) {
      print "probe successful\n";
    }
    else {
      print "probe failed\n";
    }
  }

  ($fs, $cm) =
    afsmonitor(
           cmhosts  => ["hostName1", "hostName2"],
           fshosts  => ["hostName3", "hostName4", "hostName5"],
           cmshow   => ["PerfStats_section", "fs_oc_downDst_more_50"],
           fsshow   => ["VnodeCache_group", "FetchData_sqr"],
           fsthresh => [
                        { vcache_S_Entries => 10
                        },
                        { vcache_L_Allocs  => 30
                        },
                        { host => "hostName3",
                          vcache_L_Writes => 20,
                          handler => "HandlerScript arg1 arg2"
                        },
                        { host => "hostName5",
                          vcache_L_Writes => 40,
                        }
                       ],
           cmthresh => [
                        { host => "hostName1",
                          numPerfCalls => 80,
                          handler => "HandlerScript arg"
                        },
                        { fs_oc_downDst_more_50 => 90
                        },
                        { cacheNumEntries => 60,
                          handler => "HandlerScript"
                        },
                        { host => "hostName2",
                          dlocalAccesses => 70
                        }
                       ],
           );

=head1 DESCRIPTION

The B<afsmonitor> function gathers statistics about specified File Server
and Cache Manager operations. It allows the issuer to monitor, from a
single location, a wide range of File Server and Cache Manager
operations on any number of machines in both local and foreign cells.

There are 271 available File Server statistics and 571 available Cache
Manager statistics, listed in the L<afsmon_stats(1)> documentation. By default,

pod/cmdebug.pod  view on Meta::CPAN

# This library is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#------------------------------------------------------------------------------

=head1 NAME

B<cmdebug> - Reports status of cache manager and cache entries on a particular AFS client machine.

=head1 SYNOPSIS

  use AFS::Monitor qw(cmdebug);

  my ($locks, $cache_entries) =
      cmdebug(server => "hostName",
              port   => 7001,
              long   => 1
             );

=head1 DESCRIPTION

The B<cmdebug> function can be used to examine the status of the
cache manager and cache entries on a particular AFS client machine.
This function is useful when you suspect that the cache manager is
hung, or is performing poorly.

=head1 OPTIONS

src/Monitor.xs  view on Meta::CPAN

/***********************************************************************
 *
 * AFS.xs - AFS extensions for Perl
 *
 * RCS-Id: @(#)$Id: Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $
 *
 * Copyright (c) 2003, International Business Machines Corporation and others.
 *
 * This software has been released under the terms of the IBM Public
 * License.  For details, see the IBM-LICENSE file in the LICENCES
 * directory or online at http://www.openafs.org/dl/license10.html
 *
 * Contributors
 *         2004-2006: Elizabeth Cassell <e_a_c@mailsnare.net>
 *                    Alf Wachsmann <alfw@slac.stanford.edu>
 *
 * The code for the original library were mainly taken from the AFS
 * source distribution, which comes with this message:
 *
 *    Copyright (C) 1989-1994 Transarc Corporation - All rights reserved
 *    P_R_P_Q_# (C) COPYRIGHT IBM CORPORATION 1987, 1988, 1989
 *
 ***********************************************************************/

#include "EXTERN.h"

#ifdef __sgi    /* needed to get a clean compile */
#include <setjmp.h>
#endif

#include <stdarg.h>

#include "perl.h"

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.013 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )