SUMMARY: sar for osf/1

From: Stuart 'Zen' Bishop <zen_at_bf.rmit.edu.au>
Date: Thu, 22 Jun 1995 11:38:04 +1000 (EST)

Hi Peoples.

This have become a bit hectic around here, so I havn't tested any of these
solutions out yet. I'm just attaching all of the full replies I got
to this message, as I know there is at least one other person out there
waiting for this summary.

 _____
// // __ For a good time call http://www.bf.rmit.edu.au/~zen //
   // / \ I\ I zen_at_rmit.edu.au //
  // (-- I \I Unix Systems Administrator //
 // \__/ I I alias Stuart Bishop Business Faculty, RMIT //
((_______________________________________________________________________//


From fagan_at_large.fnal.gov Wed Jun 7 22:24:37 1995
Received: from large.fnal.gov (large.fnal.gov [131.225.220.68]) by otto.bf.rmit.edu.au (8.6.12/8.6.12) with ESMTP id WAA13200 for <zen_at_bf.rmit.edu.au>; Wed, 7 Jun 1995 22:24:34 +1000
Received: from localhost by large.fnal.gov via SMTP (940816.SGI.8.6.9/940406.SGI)
        for <zen_at_bf.rmit.edu.au> id HAA05920; Wed, 7 Jun 1995 07:24:24 -0500
Message-Id: <199506071224.HAA05920_at_large.fnal.gov>
To: "Stuart 'Zen' Bishop" <zen_at_bf.rmit.edu.au>
From: Sid Fagan - Sublimation MAN (NID) <fagan_at_large.fnal.gov>
Organization: Fermilab Unix System Support Group
Subject: Re: sar for osf/1 3.2
In-hurl-to: (Your message of Wed, 07 Jun 1995 16:40:17 CDT.)
             <Pine.OSF.3.91.950607162238.15552D-100000_at_otto.bf.rmit.edu.au>
Date: Wed, 07 Jun 1995 07:24:23 CDT
Sender: fagan_at_large.fnal.gov
Status: RO
X-Status:


        This is good enough for me...
        haven't tried this on osf, but on Sun's, SGI's, AIsucX

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/times.h>
#include <sys/param.h>
#include <malloc.h>

static char *Program = "<unknown>";

extern int errno;

static void
msg(text)
char *text;
{
        fprintf(stderr,"%s: %s\n",Program,text);
}

static void
msgerr(text)
char *text;
{
        fprintf(stderr,"%s: %s -- %s\n",Program,text,strerror(errno));
}


main(argc,argv)
int argc;
char **argv;
{
        extern int getopt ();
        extern char *optarg;
        extern int optind, opterr;
        extern clock_t times();
        int chr, error = 0, Block = 512, Sync = 0;
        int Count = 2048, ICount = 0, OCount = 0, Report_Count;
        char *In = (char *)0, *Out = (char *)0;
        int hDup = 0, iDup = 0, oDup = 0, bDup = 0, cDup = 0, sDup = 0;
        int Ifd = 0, Ofd = 1;
        char *End, *Buffer, *Header = (char *)0;
        clock_t Start_time, Finish_time;
        long ILength, OLength, Bytes = 0L;
        double DBytes;
        double Wall, User, System, CPU;
        struct tms Start, Finish;

        if (argv[0] && argv[0][0]) {
                Program = argv[0];
        }

        while ((chr = getopt(argc, argv, "h:i:o:b:c:s")) != -1) {
                switch (chr) {
                case 'h':
                        if (hDup) {
                                error = 1;
                                msg("multiple -h");
                        } else {
                                hDup = 1;
                                Header = optarg;
                        }
                        break;
                case 'i':
                        if (iDup) {
                                error = 1;
                                msg("multiple -i");
                        } else {
                                iDup = 1;
                                In = optarg;
                        }
                        break;
                case 'o':
                        if (oDup) {
                                error = 1;
                                msg("multiple -o");
                        } else {
                                oDup = 1;
                                Out = optarg;
                        }
                        break;
                case 'b':
                        if (bDup) {
                                error = 1;
                                msg("multiple -b");
                        } else {
                                bDup = 1;
                                Block = strtol(optarg,&End,0);
                                if (End == optarg) {
                                        msg("invalid -b number");
                                        error = 1;
                                } else {
                                        while (*End && !error) {
                                                switch (*End) {
                                                case 'k': case 'K':
                                                        Block <<= 10;
                                                        break;
                                                case 'm': case 'M':
                                                        Block <<= 20;
                                                        break;
                                                default:
                                                    msg("invalid -b extension");
                                                        error = 1;
                                                }
                                                ++End;
                                        }
                                }
                        }
                        break;
                case 'c':
                        if (cDup) {
                                error = 1;
                                msg("multiple -c");
                        } else {
                                cDup = 1;
                                Count = strtol(optarg,&End,0);
                                if (End == optarg) {
                                        msg("invalid -c number");
                                        error = 1;
                                } else {
                                        while (*End && !error) {
                                                switch (*End) {
                                                case 'k': case 'K':
                                                        Count <<= 10;
                                                        break;
                                                case 'm': case 'M':
                                                        Count <<= 20;
                                                        break;
                                                default:
                                                    msg("invalid -c extension");
                                                        error = 1;
                                                }
                                                ++End;
                                        }
                                }
                        }
                        break;
                case 's':
                        if (sDup) {
                                error = 1;
                                msg("multiple -s");
                        } else {
                                sDup = 1;
                                Sync = O_SYNC;
                        }
                        break;
                default:
                        error = 1;
                        fprintf(stderr,"%s: invalid -%c\n",Program,chr);
                        break;
                }
        }
        if (cDup && !oDup) {
                error = 1;
                msg("-c without -o");
        }
        if (cDup && iDup) {
                error = 1;
                msg("-c with -i");
        }
        if (sDup && !oDup) {
                error = 1;
                msg("-s without -o");
        }
        if (iDup) {
                Ifd = open(In,O_RDONLY);
                if (Ifd < 0) {
                        error = 1;
                        msgerr("input open failed");
                }
        }
        if (oDup) {
                Ofd = open(Out,O_WRONLY|O_CREAT|O_TRUNC|Sync,0644);
                if (Ofd < 0) {
                        error = 1;
                        msgerr("output open failed");
                }
        }
        if (!(iDup || oDup)) {
                error = 1;
                msg("no I/O requested");
        } else {
                Buffer = (char *)malloc((long)Block);
                if (!Buffer) {
                        error = 1;
                        msg("unable to obtain I/O buffer");
                }
        }
        if (error) {
                msg("execution terminated because of above errors");
                exit(1);
        }
        Report_Count = Count;

        if ((Start_time = times(&Start)) == -1) {
                msgerr("unable to obtain start times");
                exit(1);
        }

        if(iDup) {
                if (oDup) {
                        while((ILength = read(Ifd,Buffer,Block)) > 0) {
                                ++ICount;
                                if (ILength != Block) {
                                        fprintf(stderr,"%s: input is %ld\n",
                                                Program,ILength);
                                }
                                Bytes += ILength;
                                OLength = write(Ofd,Buffer,ILength);
                                if (OLength >= 0) {
                                        ++OCount;
                                        if (OLength != ILength) {
                                                fprintf(stderr,
                                                        "%s: output is %ld\n",
                                                        Program,OLength);
                                        }
                                        Bytes += OLength;
                                } else {
                                        msgerr("output error");
                                        exit(1);
                                }
                        }
                        if (ILength < 0) {
                                msgerr("input error");
                        }
                } else {
                        while((ILength = read(Ifd,Buffer,Block)) > 0) {
                                ++ICount;
                                if (ILength != Block) {
                                        fprintf(stderr,"%s: input is %ld\n",
                                                Program,ILength);
                                }
                                Bytes += ILength;
                        }
                        if (ILength < 0) {
                                msgerr("input error");
                        }
                }
        } else {
                if (oDup) {
                        while(Count-- > 0) {
                                OLength = write(Ofd,Buffer,Block);
                                if (OLength >= 0) {
                                        ++OCount;
                                        if (OLength != Block) {
                                                fprintf(stderr,
                                                        "%s: output is %ld\n",
                                                        Program,OLength);
                                        }
                                        Bytes += OLength;
                                } else {
                                        msgerr("output error");
                                        exit(1);
                                }
                        }
                } else {
                        msg("logic error in program!");
                        exit(1);
                }
        }

        if ((Finish_time = times(&Finish)) == -1) {
                msgerr("unable to obtain finish times");
                exit(1);
        }

        Start.tms_utime += Start.tms_cutime;
        Start.tms_stime += Start.tms_cstime;
        Finish.tms_utime += Finish.tms_cutime;
        Finish.tms_stime += Finish.tms_cstime;
        Wall = (double)(Finish_time-Start_time)/(double)(HZ);
        User = (double)(Finish.tms_utime-Start.tms_utime)/(double)(HZ);
        System = (double)(Finish.tms_stime-Start.tms_stime)/(double)(HZ);
        CPU = User + System;
        DBytes = Bytes;
        if(Header) fprintf(stderr,"Header is %s\n",Header);
        fprintf(stderr,"Block size is %d\n",Block);
        if(oDup && !iDup) {
                fprintf(stderr,"Count is %d\n",Report_Count);
        }
        fprintf(stderr,"Wall clock time %f seconds, %f bytes/sec\n",
                Wall, DBytes / Wall);
        fprintf(stderr,"User time %f seconds, %f bytes/sec\n",
                User, DBytes / User);
        fprintf(stderr,"System time %f seconds, %f bytes/sec\n",
                System, DBytes / System);
        fprintf(stderr,"CPU time %f seconds, %f bytes/sec\n",
                CPU, DBytes / CPU);
        if(iDup) {
                fprintf(stderr,"Input count %7d on %s\n",ICount,In);
        }
        if(oDup) {
                fprintf(stderr,"Output count %7d on %s\n",OCount,Out);
        }
        exit(0);
}
                                        ,,,
                                       (o o)
-----------------------------------oOO--(_)--OOo--------------------------------
      * to err is human, to really foul things up use an AIX machine *
--------------------------------------------------------------------------------
David J. Fagan | The Silicon Sorcerer | Bitnet: Fagan_at_fnal
   SGI-liaison | Liaison Requests use SGI-liaison_at_fnal
   * Feed the homeless to the hungry * | Internet: Fagan_at_large (.fnal.gov)
Fermi National Accelerator Laboratory | MaBellnet: 1 (708) 840-2914
 WARNING: Please keep the flashlights away from the blondes!!!
        -=(Sid)=- it's simple but my guns never overheat...
--------------------------------------------------------------------------------
                                   ooO Ooo

From atp_at_mssly1.mssl.ucl.ac.uk Wed Jun 7 22:28:25 1995
Received: from mail-d.bcc.ac.uk (mail-d.bcc.ac.uk [144.82.100.24]) by otto.bf.rmit.edu.au (8.6.12/8.6.12) with SMTP id WAA13251 for <zen_at_bf.rmit.edu.au>; Wed, 7 Jun 1995 22:28:05 +1000
Received: from mssly1.mssl.ucl.ac.uk by mail-d.bcc.ac.uk with SMTP (PP);
          Wed, 7 Jun 1995 12:52:21 +0100
Received: from mssly3.mssl.ucl.ac.uk by mssly1.mssl.ucl.ac.uk;
          (5.65v3.0/1.1.8.2/26May95-0149PM) id AA16488;
          Wed, 7 Jun 1995 12:52:03 +0100
From: Andy Phillips <atp_at_mssly1.mssl.ucl.ac.uk>
Received: by mssly3.mssl.ucl.ac.uk;
          (5.65v3.0/1.1.8.2/24May95-0116PM) id AA18234;
          Wed, 7 Jun 1995 12:51:58 +0100
Message-Id: <9506071151.AA18234_at_mssly3.mssl.ucl.ac.uk>
Subject: Re: sar for osf/1 3.2
To: zen_at_bf.rmit.edu.au
Date: Wed, 7 Jun 1995 12:51:56 +0100 (BST)
In-Reply-To: <Pine.OSF.3.91.950607162238.15552D-100000_at_otto.bf.rmit.edu.au> from "Stuart 'Zen' Bishop" at Jun 7, 95 04:40:17 pm
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Length: 738
Status: RO
X-Status:

Hi,
> Does anyone know if such a beastie (or similar) exists for osf/1 3.2?
        
        This depends on what SAR does. There is a SAR disk set for linux
      which is a boot/root disk combination.
      
> I have a lecturer who keeps ringing me up wanting a tool to test disk
> performance. He really wants a program called 'csar' that used to run on
        
        A good program to do this is "iozone". This compiles ok on OSF/1
     (well vn 2.1 anyway, which is when I last tried it.). Alternatives are
     the VET tools.

                andy

--
atp_at_mssly1.mssl.ucl.ac.uk Andy Phillips
atp_at_mssl.ucl.ac.uk Mullard Space Science Laboratory,
phillips_at_isass1.solar.isas.ac.jp Dept. Space and Climate Physics,
mssly1::atp University College London.

From drew_at_ny.ox.com Fri Jun 9 00:09:38 1995
Received: from spruce.ny.ox.com (spruce.ny.ox.com [129.77.2.74]) by otto.bf.rmit.edu.au (8.6.12/8.6.12) with SMTP id AAA32407 for <zen_at_bf.rmit.edu.au>; Fri, 9 Jun 1995 00:09:36 +1000
Received: by spruce.ny.ox.com (Smail3.1.28.1 #13)
        id m0sJiGx-000hdDC; Thu, 8 Jun 95 10:09 EDT
Message-Id: <m0sJiGx-000hdDC_at_spruce.ny.ox.com>
To: "Stuart 'Zen' Bishop" <zen_at_bf.rmit.edu.au>
Subject: Re: sar for osf/1 3.2
In-reply-to: Your message of "Wed, 07 Jun 95 16:40:17 +1000."
             <Pine.OSF.3.91.950607162238.15552D-100000_at_otto.bf.rmit.edu.au>
Date: Thu, 08 Jun 95 10:09:22 -0400
From: Drew Kramer <drew_at_ny.ox.com>
X-Mts: smtp
Status: RO
X-Status:

I think montior works fine. You can even send the data to a collection file for
later processing. It is all curses based as well.

-drew
-------
USMail: OTA Limited Partnership E-mail: drew_at_ox.com
        1 Manhattanville Road Phone: +1 914 694 5800
        Purchase, New York 10577 FAX: +1 914 694 5831
                       "Welcome, to the machine..."

Received on Thu Jun 22 1995 - 04:30:40 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT