Article 13466 of alt.sources: This is the 1.0 distribution of the Project Orion package. This distribution contains the source code and documentation for the program "pis". pis is an alternative to the standard UNIX ps command. The source code supports UnixWare 2.02, SunOS 5.4 and SCO 3.2v5. Other versions of System V may work as well. Larry Plona ljp@tiac.net Submitted-by: ljp@tiac.net Archive-name: orion-1.0/part01 ---- Cut Here and feed the following to sh ---- #!/bin/sh # This is orion-1.0, a shell archive (produced by GNU sharutils 4.2) # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # # Made on 1996-07-01 01:18 EDT by . # Source directory was `/usr/answers/tmp'. # # Existing files will *not* be overwritten unless `-c' is specified. # # This is part 1 of a multipart archive. # Do not concatenate these parts, unpack them in order with `/bin/sh'. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 1479 -rw-rw-r-- orion-1.0/sarrep/native.mk # 2371 -rw-rw-r-- orion-1.0/sarrep/ipcs.c # 1640 -rw-rw-r-- orion-1.0/sarrep/venix.c # 9253 -rw-rw-r-- orion-1.0/sarrep/basic1.c # 3762 -rw-rw-r-- orion-1.0/sarrep/netstat.c # 2324 -rw-rw-r-- orion-1.0/sarrep/ps.c # 1629 -rw-rw-r-- orion-1.0/sarrep/mount.c # 2430 -rw-rw-r-- orion-1.0/sarrep/wollong.c # 4980 -rw-rw-r-- orion-1.0/sarrep/disk.c # 865 -rw-rw-r-- orion-1.0/sarrep/reboot.c # 1185 -rw-rw-r-- orion-1.0/sarrep/streams.c # 2269 -rw-rw-r-- orion-1.0/sarrep/memsys.c # 3597 -rw-rw-r-- orion-1.0/sarrep/proc.c # 3838 -rw-rw-r-- orion-1.0/sarrep/tty.c # 2506 -rw-rw-r-- orion-1.0/sarrep/sarrep.h # 1827 -rw-rw-r-- orion-1.0/sarrep/module.c # 23203 -rw-rw-r-- orion-1.0/sarrep/sarrep.c # 7815 -rw-rw-r-- orion-1.0/pis/pis.h # 31164 -rw-rw-r-- orion-1.0/pis/pis.c # 12643 -rw-rw-r-- orion-1.0/pis/tty.c # 10179 -rw-rw-r-- orion-1.0/pis/db.c # 2080 -rw-rw-r-- orion-1.0/pis/uid.c # 13451 -rw-rw-r-- orion-1.0/pis/util.c # 1614 -rw-rw-r-- orion-1.0/pis/post.c # 2153 -rw-rw-r-- orion-1.0/pis/native.mk # 6839 -rw-rw-r-- orion-1.0/pis/pis-svr3.c # 4272 -rw-rw-r-- orion-1.0/pis/mkpis.c # 1659 -rw-rw-r-- orion-1.0/pis/mkpis.h # 6109 -rw-rw-r-- orion-1.0/pis/pis-sun5.c # 5941 -rw-rw-r-- orion-1.0/pis/pis-uw2.c # 7631 -rw-rw-r-- orion-1.0/pis/sleep.c # 2134 -rw-rw-r-- orion-1.0/pis/pisdb.h # 3904 -rw-rw-r-- orion-1.0/liborion/liborion.h # 1905 -rw-rw-r-- orion-1.0/liborion/getsyms.c # 835 -rw-rw-r-- orion-1.0/liborion/max.c # 1761 -rw-rw-r-- orion-1.0/liborion/mkaddr.c # 1788 -rw-rw-r-- orion-1.0/liborion/native.mk # 1213 -rw-rw-r-- orion-1.0/liborion/fmtbyte.c # 1120 -rw-rw-r-- orion-1.0/liborion/memread.c # 1506 -rw-rw-r-- orion-1.0/liborion/fmtstart.c # 892 -rw-rw-r-- orion-1.0/liborion/fmtsec.c # 2122 -rw-rw-r-- orion-1.0/liborion/pathadj.c # 1422 -rw-rw-r-- orion-1.0/orion.mk # 887 -rw-rw-r-- orion-1.0/rules.mk # 2518 -rw-rw-r-- orion-1.0/defines.mk # 2128 -rw-rw-r-- orion-1.0/README # 1689 -rw-rw-r-- orion-1.0/sargent/native.mk # 9229 -rw-rw-r-- orion-1.0/sargent/basic1.c # 2720 -rw-rw-r-- orion-1.0/sargent/ipcs.c # 23353 -rw-rw-r-- orion-1.0/sargent/kern.c # 5204 -rw-rw-r-- orion-1.0/sargent/ps.c # 5279 -rw-rw-r-- orion-1.0/sargent/proc.c # 9859 -rw-rw-r-- orion-1.0/sargent/sarg.h # 5258 -rw-rw-r-- orion-1.0/sargent/mount.c # 6988 -rw-rw-r-- orion-1.0/sargent/netstat.c # 3513 -rw-rw-r-- orion-1.0/sargent/sar.c # 6784 -rw-rw-r-- orion-1.0/sargent/sarg_p.h # 22433 -rw-rw-r-- orion-1.0/sargent/sarg.c # 6496 -rw-rw-r-- orion-1.0/sargent/disk.c # 1907 -rw-rw-r-- orion-1.0/sargent/tty.c # 5656 -rw-rw-r-- orion-1.0/sargent/streams.c # 2104 -rw-rw-r-- orion-1.0/sargent/venix.c # 4294 -rw-rw-r-- orion-1.0/sargent/wollong.c # 2297 -rw-rw-r-- orion-1.0/sargent/memsys.c # 2150 -rw-rw-r-- orion-1.0/sargent/module.c # 903 -rw-rw-r-- orion-1.0/sargent/procsys.c # 581 -rw------- orion-1.0/COPYRIGHT # 5062 -rw-rw-r-- orion-1.0/docs/pis.1 # 3453 -rw-rw-r-- orion-1.0/docs/sargent.1 # 1330 -rw-rw-r-- orion-1.0/docs/native.mk # 101672 -rw-rw-r-- orion-1.0/docs/orion.ps.gz.uu # 947 -rw--w---- orion-1.0/S21orion # save_IFS="${IFS}" IFS="${IFS}:" gettext_dir=FAILED locale_dir=FAILED first_param="$1" for dir in $PATH do if test "$gettext_dir" = FAILED && test -f $dir/gettext \ && ($dir/gettext --version >/dev/null 2>&1) then set `$dir/gettext --version 2>&1` if test "$3" = GNU then gettext_dir=$dir fi fi if test "$locale_dir" = FAILED && test -f $dir/shar \ && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) then locale_dir=`$dir/shar --print-text-domain-dir` fi done IFS="$save_IFS" if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED then echo=echo else TEXTDOMAINDIR=$locale_dir export TEXTDOMAINDIR TEXTDOMAIN=sharutils export TEXTDOMAIN echo="$gettext_dir/gettext -s" fi if mkdir _sh05649; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' exit 1 fi if test -r _sh05649/seq; then $echo 'Must unpack archives in sequence!' $echo 'Please unpack part' '`cat _sh05649/seq`' 'next!' exit 1 fi # ============= orion-1.0/sarrep/native.mk ============== if test ! -d 'orion-1.0'; then $echo 'x -' 'creating directory' 'orion-1.0' mkdir 'orion-1.0' fi if test ! -d 'orion-1.0/sarrep'; then $echo 'x -' 'creating directory' 'orion-1.0/sarrep' mkdir 'orion-1.0/sarrep' fi if test -f 'orion-1.0/sarrep/native.mk' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/native.mk' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/native.mk' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/native.mk' && X X# ---------------------------------------------------------------- X# X# Copyright (c) 1994,1995,1996 by Larry Plona X# X# This file is part of the Orion software package. The Orion X# software package is copyright by its author, Larry Plona. This X# software, both source code and prepared binaries, may be X# freely distributed as long as all copyright notices remain X# intact and this software is not sold or packaged with other X# commercial software. X# X# No warranty of any kind attached with this software. It is X# supplied as is. X# X# ---------------------------------------------------------------- X X# X# native.mk X# X# General purpose makefile to be distributed with release. This makefile X# is not part of the LPS source code control system. X# X# There should be no need to edit this file; see "../orion.mk". X# X Xinclude ../defines.mk X X# "PLATFORM" is from "../orion.mk". X# "CF" can be used from command line. X# XCFLAGS = -D${PLATFORM} ${COPTS} -I. -I${DIR_INC} ${CF} XLDFLAGS = -L. -L${DIR_LIB} ${LDFLAGS_LOCAL} X XSARREP_SRCS=sarrep.c ps.c netstat.c mount.c wollong.c venix.c ipcs.c \ X proc.c basic1.c reboot.c streams.c tty.c memsys.c module.c disk.c XSARREP_OBJS=${SARREP_SRCS:.c=.o} X X Xall:: sarrep X Xsarrep: ${SARREP_OBJS} X rm -f $@ X ${CC} -o $@ ${SARREP_OBJS} ${LDFLAGS} -lorion ${SARREP_LIBS} X Xincludes:: X Xinstall:: X chown bin sarrep X chgrp bin sarrep X chmod 775 sarrep X mv sarrep ${DIR_INST}/bin/sarrep X Xclean:: X rm -f sarrep ${SARREP_OBJS} X Xinclude ../rules.mk SHAR_EOF chmod 0664 'orion-1.0/sarrep/native.mk' || $echo 'restore of' 'orion-1.0/sarrep/native.mk' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/native.mk:' 'MD5 check failed' 8ac4c5994e38e085821cb60e424c357c orion-1.0/sarrep/native.mk SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/native.mk'`" test 1479 -eq "$shar_count" || $echo 'orion-1.0/sarrep/native.mk:' 'original size' '1479,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/ipcs.c ============== if test -f 'orion-1.0/sarrep/ipcs.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/ipcs.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/ipcs.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/ipcs.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include X#include X#include"sarrep.h" X Xstatic int globalIpcs = 1; X Xint ipcsInit( void ) X{ X globalIpcs = 1; X return 1; X} X Xint crunchIpcs( int fd, struct sargHdr *hdr ) X{ X static struct sargIpcs save; X static time_t timeLast; X int rc; X unsigned flagFirst; X unsigned cntOpMsg, cntOpSem; X float rateMsg, rateSem; X struct sargIpcs sargIpcs; X X if( (rc=recRead(fd,SARG_RTYP_IPCS,&sargIpcs,sizeof(sargIpcs))) < 1 ) X return rc; X X if( globalIpcs ) X { X save = sargIpcs; X timeLast = hdr->h_ts; X globalIpcs = 0; X ++flagFirst; X return 1; X } X else X flagFirst = 0; X X fprintf( stdout, "%s\n", timeFormat(hdr->h_ts,S_FormatTime) ); X fputs( " IPC Facilities.\n", stdout ); X X fprintf( stdout, X " Message header pool: %.1f%% (%d messages).\n", X sargIpcs.perMsgs, sargIpcs.cntMsgs ); X fprintf( stdout, X " Message data pool %.1f%% (%s).\n", X sargIpcs.perMdata, fmtByte(sargIpcs.cntMdata) ); X if( !flagFirst ) X { X cntOpMsg = sargIpcs.cntOpMsg - save.cntOpMsg; X rateMsg = (float)cntOpMsg / (float)(hdr->h_ts-timeLast); X if( rateMsg <= 0 ) X { X fprintf( stdout, X " Message queue operations: %.1f op/s (%d op)\n", X rateMsg, cntOpMsg ); X } X else X { X fprintf( stdout, X " Message queue operations: %.f op/s\n", X rateMsg ); X } X } X X fprintf( stdout, X " Semaphores: %d.\n", X sargIpcs.cntSems ); X if( !flagFirst ) X { X cntOpSem = sargIpcs.cntOpSem - save.cntOpSem; X rateSem = (float)cntOpSem / (float)(hdr->h_ts-timeLast); X if( rateSem <= 0 ) X { X fprintf( stdout, " Semaphore operations: %.1f op/s (%d op)\n", X rateSem, cntOpSem ); X } X else X { X fprintf( stdout, " Semaphore operations: %.1f op/s\n", X rateSem ); X } X } X X return 1; X} SHAR_EOF chmod 0664 'orion-1.0/sarrep/ipcs.c' || $echo 'restore of' 'orion-1.0/sarrep/ipcs.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/ipcs.c:' 'MD5 check failed' 7f83e1ac0e877713912788096d9538d9 orion-1.0/sarrep/ipcs.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/ipcs.c'`" test 2371 -eq "$shar_count" || $echo 'orion-1.0/sarrep/ipcs.c:' 'original size' '2371,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/venix.c ============== if test -f 'orion-1.0/sarrep/venix.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/venix.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/venix.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/venix.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X Xstatic int globalVenix = 1; X X#ifdef VENIX32 Xint crunchVenix( int fd, struct sargHdr *hdr ) X{ X static struct lsarVenix save; X static time_t timeLast; X int rc, cntFix; X float rateFix; X time_t timeCurr; X struct lsarVenix lsarVenix; X X timeCurr = hdr->h_ts; X X if( (rc=recRead(fd,LSAR_RTYP_VENIX,&lsarVenix,sizeof(lsarVenix))) < 1 ) X return rc; X X fprintf( stdout, "%s\n", timeFormat(timeCurr,S_FormatTime) ); X fputs( "\tVENIX Specific Stuff.\n", stdout ); X X if( !globalVenix ) X { X if( (float)(timeCurr-timeLast) <= 0 ) X return 1; X cntFix = lsarVenix.cntVhand - save.cntVhand; X rateFix = (float)cntFix / (float)(timeCurr-timeLast); X if( cntFix==0 || (int)rateFix<=0 ) X { X fprintf( stdout, X "\t\tVhand bug: %d fixes (%d since boot)\n", X cntFix, lsarVenix.cntVhand ); X } X else X { X fprintf( stdout, X "\t\tVhand bug: %d fixes (%.1f fix/s)\n", X cntFix, rateFix ); X } X } X X save = lsarVenix; X timeLast = timeCurr; X globalVenix = 0; X X return 1; X} X#endif SHAR_EOF chmod 0664 'orion-1.0/sarrep/venix.c' || $echo 'restore of' 'orion-1.0/sarrep/venix.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/venix.c:' 'MD5 check failed' 326de177684c6ec2c0f82b19529f94cc orion-1.0/sarrep/venix.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/venix.c'`" test 1640 -eq "$shar_count" || $echo 'orion-1.0/sarrep/venix.c:' 'original size' '1640,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/basic1.c ============== if test -f 'orion-1.0/sarrep/basic1.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/basic1.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/basic1.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/basic1.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X X/* X** On per delta. Contains information derived from two samples. X*/ Xstatic struct recSave X{ X char flagMarker; X time_t time; /* Time of this sample. */ X time_t timeInterval; /* Seconds since last sample. */ X float cpuIdle; X float cpuWait; X float cpuKernel; X float cpuUser; X float cpuIo; X float cpuSwap; X float cpuPio; X float rateMemVfault; X int rateMemSwapIn; X int rateMemSwapOut; X int rateProcSwitch; X int rateSysTotal; X int rateSysRead; X int rateSysWrite; X int rateSysFork; X int rateSysExec; X int rateIpcMsg; X int rateIpcSem; X int countSysFork; X int countSysExec; X int countIpcMsg; X int countIpcSem; X unsigned countProcOv; X unsigned countFileOvFile; X unsigned countFileOvInode; X unsigned countFileOvLock; X unsigned perProcTab; X unsigned perFileFile; X unsigned perFileInode; X unsigned perFileFlock; X}; X Xstatic int globalBasic1 = 1; X Xint basic1Init( void ) X{ X globalBasic1 = 1; X X return 1; X} X Xint crunchBasic1( int fd, struct sargHdr *hdr ) X{ X static time_t timeLast; X static struct sargBasic1 orecSar; X int i; X float timeDelta, wtimeDelta; X struct sargBasic1 recSar; X struct recSave recSave; X time_t timeCurr; X X timeCurr = hdr->h_ts; X X if( (i=recRead(fd,SARG_RTYP_BASIC1,&recSar,sizeof(recSar))) < 1 ) X return i; X X if( globalBasic1 ) X { X orecSar = recSar; X timeLast = timeCurr; X globalBasic1 = 0; X return 1; X } X X /* X ** Calculate the number of seconds which have passed. X */ X recSave.timeInterval = timeCurr - timeLast; X if( globalDebug ) X { X fprintf( stdout, "%ld seconds since last sample.\n", X recSave.timeInterval ); X } X X /* X ** Calculate the amount of CPU time that has passed. X */ X { X time_t timeLast; X time_t timeCurr; X X timeLast = 0; X timeCurr = 0; X X for( i=0; i 0 ) X { X recSave.cpuIo = X (float)(recSar.wait[W_IO]-orecSar.wait[W_IO]) / X wtimeDelta*100; X recSave.cpuSwap = X (float)(recSar.wait[W_SWAP]-orecSar.wait[W_SWAP]) / X wtimeDelta*100; X recSave.cpuPio = X (float)(recSar.wait[W_PIO]-orecSar.wait[W_PIO]) / X wtimeDelta*100; X } X } X X recSave.cpuIdle = X (float)(recSar.cpu[CPU_IDLE]-orecSar.cpu[CPU_IDLE]) / X timeDelta * 100; X recSave.cpuWait = X (float)(recSar.cpu[CPU_WAIT]-orecSar.cpu[CPU_WAIT]) / X timeDelta * 100; X recSave.cpuUser = X (float)(recSar.cpu[CPU_USER]-orecSar.cpu[CPU_USER]) / X timeDelta * 100; X recSave.cpuKernel = X (float)(recSar.cpu[CPU_KERNEL]-orecSar.cpu[CPU_KERNEL]) / X timeDelta * 100; X X if( recSave.timeInterval > 0 ) X { X recSave.rateMemVfault = (recSar.cntVfault-orecSar.cntVfault) X / recSave.timeInterval; X recSave.rateMemSwapIn = (recSar.cntSwapIn-orecSar.cntSwapIn) X / recSave.timeInterval; X recSave.rateMemSwapOut = (recSar.cntSwapOut-orecSar.cntSwapOut) X / recSave.timeInterval; X recSave.rateProcSwitch = (recSar.cntPswitch-orecSar.cntPswitch) X / recSave.timeInterval; X recSave.rateSysTotal = (recSar.cntSys-orecSar.cntSys) X / recSave.timeInterval; X recSave.rateSysRead = (recSar.cntSysRead-orecSar.cntSysRead) X / recSave.timeInterval; X recSave.rateSysWrite = (recSar.cntSysWrite-orecSar.cntSysWrite) X / recSave.timeInterval; X recSave.countSysFork = recSar.cntSysFork - orecSar.cntSysFork; X recSave.rateSysFork = recSave.countSysFork / X recSave.timeInterval; X recSave.countSysExec = recSar.cntSysExec - orecSar.cntSysExec; X recSave.rateSysExec = recSave.countSysExec / X recSave.timeInterval; X recSave.countIpcMsg = recSar.cntMsg - orecSar.cntMsg; X recSave.rateIpcMsg = recSave.countIpcMsg / recSave.timeInterval; X recSave.countIpcSem = recSar.cntSema - orecSar.cntSema; X recSave.rateIpcSem = recSave.countIpcSem / recSave.timeInterval; X } X else X { X recSave.countSysFork = -1; X recSave.countSysExec = -1; X recSave.countIpcMsg = -1; X recSave.countIpcSem = -1; X X recSave.rateMemVfault = 0; X recSave.rateMemSwapIn = 0; X recSave.rateMemSwapOut = 0; X recSave.rateProcSwitch = 0; X recSave.rateSysTotal = 0; X recSave.rateSysRead = 0; X recSave.rateSysWrite = 0; X recSave.rateSysFork = 0; X recSave.rateSysExec = 0; X recSave.rateIpcMsg = 0; X recSave.rateIpcSem = 0; X } X X recSave.perProcTab = (recSar.cntProc*100) / recSar.cntProcMax; X X /* X ** UnixWare 2 does not seem to specify a maximum file count, X ** so check for a zero value. X */ X if( recSar.cntFileMax < 1 ) X recSave.perFileFile = 0; X else X recSave.perFileFile = (recSar.cntFile*100) / recSar.cntFileMax; X X recSave.perFileInode = (recSar.cntInode*100) / recSar.cntInodeMax; X recSave.perFileFlock = (recSar.cntLock*100) / recSar.cntLockMax; X recSave.countProcOv = recSar.cntProcOvf - orecSar.cntProcOvf; X recSave.countFileOvFile = recSar.cntFileOvf - orecSar.cntFileOvf; X recSave.countFileOvInode = recSar.cntInodeOvf - orecSar.cntInodeOvf; X recSave.countFileOvLock = recSar.cntLockOvf - orecSar.cntLockOvf; X } X X { X char strTime[31+1]; X struct tm *recTime; X X if( (recTime=localtime(&timeCurr)) == NULL ) X return -1; X ascftime( strTime, S_FormatTime, recTime ); X X fprintf( stdout, X "%s\n", X strTime ); X } X X fprintf( stdout, X " Seconds since last sample: %u.\n", X (unsigned)recSave.timeInterval ); X fputs( " CPU Processing.\n", stdout ); X fprintf( stdout, X " Total: Idle %.1f%%, User %.1f%%, Wait %.1f%%, Kernel %.1f%%.\n", X recSave.cpuIdle, recSave.cpuUser, X recSave.cpuWait, recSave.cpuKernel ); X if( recSave.cpuWait>0 && recSave.cpuIo!=-1 ) X { X fprintf( stdout, X " Wait: IO %.1f%%, Swap %.1f%%, PIO %.1f%%.\n", X recSave.cpuIo, recSave.cpuSwap, recSave.cpuPio ); X } X X /* X ** Processes. X */ X fputs( " Processes Management Subsystem.\n", stdout ); X fprintf( stdout, X " Process entries: %d\n", recSar.cntProc ); X fprintf( stdout, X " Process table: %d%% full\n", X recSave.perProcTab ); X fprintf( stdout, X " Context switches: %d switch/s\n", X recSave.rateProcSwitch ); X fprintf( stdout, X " Process table overflows: %d\n", X recSave.countProcOv ); X X /* X ** Memory Management Subsystem. X */ X fputs( " Memory Management Subsystem.\n", stdout ); X fprintf( stdout, X " Swap ins: %d swap/s\n", X recSave.rateMemSwapIn ); X fprintf( stdout, X " Swap outs: %d swap/s\n", X recSave.rateMemSwapOut ); X X fprintf( stdout, X " Address faults: %.2f fault/s\n", X recSave.rateMemVfault ); X X /* X ** File Management Subsystem. X */ X fputs( " File Management Subsystem.\n", stdout ); X fprintf( stdout, X " File entries: %d\n", recSar.cntFile ); X fprintf( stdout, X " File table: %d%% full\n", X recSave.perFileFile ); X fprintf( stdout, X " Inode entries: %d\n", recSar.cntInode ); X fprintf( stdout, X " Inode table: %d%% full\n", X recSave.perFileInode ); X fprintf( stdout, X " Flock table: %d%% full\n", X recSave.perFileFlock ); X fprintf( stdout, X " Inode table overflows: %d\n", X recSave.countFileOvFile ); X fprintf( stdout, X " File table overflows: %d\n", X recSave.countFileOvInode ); X X /* X ** System calls. X */ X fputs( " System calls.\n", stdout ); X fprintf( stdout, " Total: %d call/s\n", X recSave.rateSysTotal ); X if( recSave.countSysFork>0 && recSave.countSysFork<50 ) X { X fprintf( stdout, " Fork: %d call/s (%d calls)\n", X recSave.rateSysFork, recSave.countSysFork ); X } X else X { X fprintf( stdout, " Fork: %d call/s\n", X recSave.rateSysFork ); X } X if( recSave.countSysExec>0 && recSave.countSysExec<50 ) X { X fprintf( stdout, " Exec: %d call/s (%d calls)\n", X recSave.rateSysExec, recSave.countSysExec ); X } X else X { X fprintf( stdout, " Exec: %d call/s\n", X recSave.rateSysExec ); X } X fprintf( stdout, " Read: %d call/s\n", X recSave.rateSysRead ); X fprintf( stdout, " Write: %d call/s\n", X recSave.rateSysWrite ); X X orecSar = recSar; X timeLast = timeCurr; X X return 1; X} SHAR_EOF chmod 0664 'orion-1.0/sarrep/basic1.c' || $echo 'restore of' 'orion-1.0/sarrep/basic1.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/basic1.c:' 'MD5 check failed' a362dcba2d40108e1038558af98ab481 orion-1.0/sarrep/basic1.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/basic1.c'`" test 9253 -eq "$shar_count" || $echo 'orion-1.0/sarrep/basic1.c:' 'original size' '9253,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/netstat.c ============== if test -f 'orion-1.0/sarrep/netstat.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/netstat.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/netstat.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/netstat.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xint crunchNetstat( int fd, struct sargHdr *hdr ) X{ X int i; X struct sargNetstat sargNetstat; X X if( (i=read(fd,&sargNetstat,sizeof(sargNetstat))) == -1 ) X { X fputs( "Could not read Netstat record from lsar file.\n", stdout ); X fprintf( stdout, "Bad read(2). %s.\n", X sys_errlist[errno] ); X return -1; X } X if( i == 0 ) X return 0; X if( i != sizeof(sargNetstat) ) X { X fprintf( stdout, X "Bad record in sargent file. Only read %d bytes.\n", i ); X return -1; X } X X fprintf( stdout, "%s\n", timeFormat(hdr->h_ts,S_FormatTime) ); X X if( sargNetstat.loadTcp ) X { X fputs( " TCP.\n", stdout ); X X fprintf( stdout, " Attempts: %ld\n", sargNetstat.cntAttempt ); X fprintf( stdout, " Accepts: %ld\n", sargNetstat.cntAccept ); X fprintf( stdout, " Connects: %ld\n", sargNetstat.cntConnect ); X X fprintf( stdout, " Persist timeouts: %ld\n", X sargNetstat.cntTimeoPersist ); X fprintf( stdout, " Heartbeat timeouts: %ld\n", X sargNetstat.cntTimeoKeep ); X fprintf( stdout, " Rxmt timeouts: %ld\n", X sargNetstat.cntTimeoRtx ); X X fprintf( stdout, " Keep alive drops: %ld\n", X sargNetstat.cntDropKeep ); X fprintf( stdout, " Rxmt timeout drops: %ld\n", X sargNetstat.cntDropRtx ); X X fprintf( stdout, " Packets sent: %lu.\n", X sargNetstat.cntPktTx ); X fprintf( stdout, " Data: %.01f%% (%s).\n", X ((float)sargNetstat.cntPktData/(float)sargNetstat.cntPktTx)*100.0, X fmtByte(sargNetstat.cntBytesData) ); X fprintf( stdout, " Retransmitted: %.01f%%.\n", X ((float)sargNetstat.cntPktRtx/ X (float)sargNetstat.cntPktTx)*100.0 ); X X fprintf( stdout, " Packets received: %ld.\n", X sargNetstat.cntPktRx ); X fprintf( stdout, " In sequence: %.01f%% (%s).\n", X ((float)sargNetstat.cntPktSeq/(float)sargNetstat.cntPktRx)*100.0, X fmtByte(sargNetstat.cntBytesSeq) ); X fprintf( stdout, " Out of order: %.01f%%.\n", X ((float)sargNetstat.cntPktOorder/ X (float)sargNetstat.cntPktRx)*100.0 ); X fprintf( stdout, " Duplicate: %.01f%%.\n", X ((float)sargNetstat.cntPktDup/ X (float)sargNetstat.cntPktRx)*100.0 ); X fprintf( stdout, " Bad checksum: %.01f%%.\n", X ((float)sargNetstat.cntPktSum/ X (float)sargNetstat.cntPktRx)*100.0 ); X fprintf( stdout, " Bad offset: %.01f%%.\n", X ((float)sargNetstat.cntPktOff/ X (float)sargNetstat.cntPktRx)*100.0 ); X fprintf( stdout, " Short: %.01f%%.\n", X ((float)sargNetstat.cntPktShort/ X (float)sargNetstat.cntPktRx)*100.0 ); X } X else X fputs( " TCP not loaded.\n", stdout ); X X if( sargNetstat.loadUdp ) X { X fputs( " UDP.\n", stdout ); X X fprintf( stdout, " Bad: %lu\n", sargNetstat.cntUdpBad ); X fprintf( stdout, " Dropped: %lu\n", sargNetstat.cntUdpDrop ); X } X else X fputs( " UDP not loaded.\n", stdout ); X X if( sargNetstat.loadIp ) X { X fputs( " IP.\n", stdout ); X fprintf( stdout, " Forwarded: %lu\n", sargNetstat.cntIpForw ); X fprintf( stdout, " Not forwarded: %lu\n", sargNetstat.cntIpNforw ); X fprintf( stdout, " Bad: %lu\n", sargNetstat.cntIpBad ); X } X X return 1; X} SHAR_EOF chmod 0664 'orion-1.0/sarrep/netstat.c' || $echo 'restore of' 'orion-1.0/sarrep/netstat.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/netstat.c:' 'MD5 check failed' b2f76ff870c2613d6cc04ca128b4a5c6 orion-1.0/sarrep/netstat.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/netstat.c'`" test 3762 -eq "$shar_count" || $echo 'orion-1.0/sarrep/netstat.c:' 'original size' '3762,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/ps.c ============== if test -f 'orion-1.0/sarrep/ps.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/ps.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/ps.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/ps.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xint crunchPs( int fd, struct sargHdr *hdr ) X{ X char chrState; X unsigned int state; X int i; X struct sargPs sargPs; X X if( (i=read(fd,&sargPs,sizeof(sargPs))) == -1 ) X { X fputs( "Could not read Processes record from lsar file.\n", stdout ); X fprintf( stdout, "Bad read(2). %s.\n", X sys_errlist[errno] ); X return -1; X } X if( i == 0 ) X return 0; X if( i != sizeof(sargPs) ) X { X fprintf( stdout, X "Bad record in lsar file. Only read %d bytes.\n", i ); X return -1; X } X X if( !(sargPs.count) ) X { X if( globalDebug ) X fputs( "Empty Processes record.\n", stdout ); X return 1; X } X X fprintf( stdout, "%s\n", timeFormat(hdr->h_ts,S_FormatTime) ); X fputs( "\tProcesses.\n", stdout ); X fprintf( stdout, "\t\tReady to run: %d\n", X sargPs.cntRun ); X if( sargPs.cntSwap > 0 ) X { X fprintf( stdout, "\t\tSwapped %d\n", X sargPs.cntSwap ); X } X if( sargPs.cntZomb > 0 ) X { X fprintf( stdout, "\t\tZombie: %d\n", X sargPs.cntZomb ); X } X fprintf( stdout, "\t\tSleeping: %d\n", X sargPs.cntSleep ); X X for( i=0; i&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/ps.c:' 'MD5 check failed' eb08524db68ef2686cb934b2af891ecf orion-1.0/sarrep/ps.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/ps.c'`" test 2324 -eq "$shar_count" || $echo 'orion-1.0/sarrep/ps.c:' 'original size' '2324,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/mount.c ============== if test -f 'orion-1.0/sarrep/mount.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/mount.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/mount.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/mount.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xint crunchMount( int fd, struct sargHdr *hdr ) X{ X int i; X struct sargMount recMount; X X if( (i=read(fd,&recMount,sizeof(recMount))) == -1 ) X { X fputs( "Could not read Filesystems record from lsar file.\n", stdout ); X fprintf( stdout, "Bad read(2). %s.\n", X sys_errlist[errno] ); X return -1; X } X if( i == 0 ) X return 0; X if( i != sizeof(recMount) ) X { X fprintf( stdout, X "Bad record in sargent file. Only read %d bytes.\n", i ); X return -1; X } X X if( !(recMount.count) ) X { X if( globalDebug ) X fputs( "Empty Filesystems record.\n", stdout ); X return 1; X } X X fprintf( stdout, "%s\n", timeFormat(hdr->h_ts,S_FormatTime) ); X fputs( "\tMounted filesystems.\n", stdout ); X X for( i=0; i&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/mount.c:' 'MD5 check failed' 87f9654b2c574e8a57217b0ffff3b4a0 orion-1.0/sarrep/mount.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/mount.c'`" test 1629 -eq "$shar_count" || $echo 'orion-1.0/sarrep/mount.c:' 'original size' '1629,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/wollong.c ============== if test -f 'orion-1.0/sarrep/wollong.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/wollong.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/wollong.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/wollong.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#ifdef WOLLONG32 Xint crunchWollong( int fd, struct sargHdr *hdr ) X{ X int i; X struct lsarWollong recWollong; X X if( (i=read(fd,&recWollong,sizeof(recWollong))) == -1 ) X { X fputs( "Could not read Wollongong record from lsar file.\n", stdout ); X fprintf( stdout, "Bad read(2). %s.\n", X sys_errlist[errno] ); X return -1; X } X if( i == 0 ) X return 0; X if( i != sizeof(recWollong) ) X { X fprintf( stdout, X "Bad record in lsar file. Only read %d bytes.\n", i ); X return -1; X } X X if( !(recWollong.valid) ) X { X if( flagDebug ) X fputs( "Empty Wollongong record.\n", stdout ); X return 1; X } X X fprintf( stdout, "%s\n", timeFormat(hdr->timeCurr,S_FormatTime) ); X fputs( "\tWollongong SVR3 Drivers.\n", stdout ); X X for( i=0; i&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/wollong.c:' 'MD5 check failed' 6f8c74860278e33d888df5f8f4255bd4 orion-1.0/sarrep/wollong.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/wollong.c'`" test 2430 -eq "$shar_count" || $echo 'orion-1.0/sarrep/wollong.c:' 'original size' '2430,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/disk.c ============== if test -f 'orion-1.0/sarrep/disk.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/disk.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/disk.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/disk.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xstruct saved X{ X unsigned long cntReadBuf; X unsigned long cntWriteBuf; X unsigned long cntReadPhys; X unsigned long cntWritePhys; X unsigned long cntReadLogic; X unsigned long cntWriteLogic; X struct X { X unsigned long cntRW; X unsigned long cntBRW; X } disks[SARG_MAX_DISKS]; X}; X Xstatic int flagInit = 0; X Xint crunchDisk( int fd, struct sargHdr *hdr ) X{ X static time_t timeLast; X static struct saved saved; X int i; X float timeDelta; X struct sargDisk recDisk; X time_t timeCurr; X float rateIoRRead; X float rateIoBRead; X float rateIoRWrite; X float rateIoBWrite; X float perIoRead; X float perIoWrite; X float rateDiskRW[SARG_MAX_DISKS]; X float rateDiskBRW[SARG_MAX_DISKS]; X X timeCurr = hdr->h_ts; X X if( (i=recRead(fd,SARG_RTYP_DISK,&recDisk,sizeof(recDisk))) < 1 ) X return 0; X X if( flagInit ) X { X /* X ** Calculate the number of seconds which have passed. X */ X timeDelta = (float)(timeCurr-timeLast); X if( globalDebug ) X { X fprintf( stdout, "%.01f SEConds since last sample.\n", X timeDelta ); X } X } X X if( flagInit && timeDelta>0 ) X { X rateIoBRead = (recDisk.cntReadBuf-saved.cntReadBuf) X / timeDelta; X rateIoBWrite = (recDisk.cntWriteBuf-saved.cntWriteBuf) X / timeDelta; X rateIoRRead = (recDisk.cntReadPhys-saved.cntReadPhys) X / timeDelta; X rateIoRWrite = (recDisk.cntWritePhys-saved.cntWritePhys) X / timeDelta; X X /* X ** FUTURE: Compute cache hit percentages. Sometimes, the number of X ** disk writes exceeds the total writes. This creates a X ** negative total number of writes and a negative percentage. X */ X { X long total, hits; X X total = recDisk.cntReadLogic - saved.cntReadLogic; X hits = total - (recDisk.cntReadBuf-saved.cntReadBuf); X perIoRead = ((float)hits/(float)total) * 100.0; X X total = recDisk.cntWriteLogic - saved.cntWriteLogic; X hits = total - (recDisk.cntWriteBuf-saved.cntWriteBuf); X perIoWrite = ((float)hits/(float)total) * 100.0; X } X X for( i=0; i 0 ) X { X fprintf( stdout, X " Averaging %.1f blks/op for the past %.01f sec\n", X (float)cntBRW/(float)cntRW, timeDelta ); X } X } X } X X saved.cntReadBuf = recDisk.cntReadBuf; X saved.cntWriteBuf = recDisk.cntWriteBuf; X saved.cntReadPhys = recDisk.cntReadPhys; X saved.cntWritePhys = recDisk.cntWritePhys; X saved.cntReadLogic = recDisk.cntReadLogic; X saved.cntWriteLogic = recDisk.cntWriteLogic; X for( i=0; i&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/disk.c:' 'MD5 check failed' 4a45cc16deedc977165f73172b013a05 orion-1.0/sarrep/disk.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/disk.c'`" test 4980 -eq "$shar_count" || $echo 'orion-1.0/sarrep/disk.c:' 'original size' '4980,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/reboot.c ============== if test -f 'orion-1.0/sarrep/reboot.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/reboot.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/reboot.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/reboot.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xint crunchReboot( int fd, struct sargHdr *hdr ) X{ X fprintf( stdout, "%s\n", timeFormat(hdr->h_ts,S_FormatTime) ); X fputs( "System reboot.\n", stdout ); X X basic1Init(); X ipcsInit(); X procInit(); X} SHAR_EOF chmod 0664 'orion-1.0/sarrep/reboot.c' || $echo 'restore of' 'orion-1.0/sarrep/reboot.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/reboot.c:' 'MD5 check failed' 803eec38445a88626fcbd68eea68e62e orion-1.0/sarrep/reboot.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/reboot.c'`" test 865 -eq "$shar_count" || $echo 'orion-1.0/sarrep/reboot.c:' 'original size' '865,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/streams.c ============== if test -f 'orion-1.0/sarrep/streams.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/streams.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/streams.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/streams.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xint crunchStreams( int fd, struct sargHdr *hdr ) X{ X int rc; X struct sargStreams recSar; X X if( (rc=recRead(fd,SARG_RTYP_IPCS,&recSar,sizeof(recSar))) < 1 ) X return rc; X X fprintf( stdout, "%s\n", timeFormat(hdr->h_ts,S_FormatTime) ); X X fputs( " STREAMS.\n", stdout ); X fprintf( stdout, X " Queue pool: %.1f%%.\n", X recSar.perQueues ); X fprintf( stdout, X " Message block pool: %.1f%%.\n", X recSar.perMsgblks ); X fprintf( stdout, X " Data block pool: %.1f%%.\n", X recSar.perDatablks ); X X return 1; X} SHAR_EOF chmod 0664 'orion-1.0/sarrep/streams.c' || $echo 'restore of' 'orion-1.0/sarrep/streams.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/streams.c:' 'MD5 check failed' 09ce66cd3d0f5433a917ce6ad8d133f2 orion-1.0/sarrep/streams.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/streams.c'`" test 1185 -eq "$shar_count" || $echo 'orion-1.0/sarrep/streams.c:' 'original size' '1185,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/memsys.c ============== if test -f 'orion-1.0/sarrep/memsys.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/memsys.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/memsys.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/memsys.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xstatic int flag = 1; X Xint crunchMemsys( int fd, struct sargHdr *hdr ) X{ X static struct sargMemsys orec; X static time_t timeLast = 0; X int rc; X time_t timeDelta; X struct sargMemsys rec; X X if( (rc=recRead(fd,SARG_RTYP_MEMSYS,&rec,sizeof(rec))) < 1 ) X return rc; X X if( !flag ) X timeDelta = hdr->h_ts - timeLast; X X fputs( "\tMemory Management Subsystem.\n", stdout ); X X if( !flag ) X { X unsigned long h, l; X const double upper = 4.294967296e9; X X h = rec.cntMemRam.dl_hop - orec.cntMemRam.dl_hop; X if( rec.cntMemRam.dl_lop >= orec.cntMemRam.dl_lop ) X l = rec.cntMemRam.dl_lop - orec.cntMemRam.dl_lop; X else X { X l = 1 + (~(orec.cntMemRam.dl_lop-rec.cntMemRam.dl_lop)); X --h; X } X X fprintf( stdout, "\t\tFree core: %.0f\n", X (double)(l+(upper*(double)h))/(double)timeDelta ); X X h = rec.cntMemSwap.dl_hop - orec.cntMemSwap.dl_hop; X if( rec.cntMemSwap.dl_lop >= orec.cntMemSwap.dl_lop ) X l = rec.cntMemSwap.dl_lop - orec.cntMemSwap.dl_lop; X else X { X l = 1 + (~(orec.cntMemSwap.dl_lop-rec.cntMemSwap.dl_lop)); X --h; X } X fprintf( stdout, "\t\tSwap: %.0f\n", X (double)(l+(upper*(double)h))/(double)timeDelta ); X } X X fprintf( stdout, X "\t\tKMA used: %.1f%%.\n", X rec.perUsed ); X X if( !flag ) X { X fprintf( stdout, X "\t\tKMA failures: %lu in last %d sec.\n", X rec.cntFail-orec.cntFail, timeDelta ); X fprintf( stdout, X "\t\tKMA allocations: %.1fop/s (%ldops).\n", X (float)(rec.cntSucced-orec.cntSucced)/(float)(timeDelta), X rec.cntSucced-orec.cntSucced ); X } X else X flag = 0; X X orec = rec; X timeLast = hdr->h_ts; X X return 1; X} SHAR_EOF chmod 0664 'orion-1.0/sarrep/memsys.c' || $echo 'restore of' 'orion-1.0/sarrep/memsys.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/memsys.c:' 'MD5 check failed' 83c72e71fccb5ab230f52c83f0ae26bf orion-1.0/sarrep/memsys.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/memsys.c'`" test 2269 -eq "$shar_count" || $echo 'orion-1.0/sarrep/memsys.c:' 'original size' '2269,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/proc.c ============== if test -f 'orion-1.0/sarrep/proc.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/proc.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/proc.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/proc.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xint procInit( void ) X{ X int i; X X for( i=0; i= SARREP_MAX_PROCS ) X { X /* X ** If there are no more slots to hold process tracking X ** data, free one up. X */ X slot = slotFree; X if( slot == -1 ) X { X slot = 0; X if( globalDebug ) X { X fprintf( stdout, X "Too many processes. Dropping pid %d.\n", X globalProcs[slot].pid ); X } X } X X globalProcs[slot].pid = recProc.pid; X globalProcs[slot].timeCpu = 0; X ++flagFirst; X } X } X X fprintf( stdout, "%s\n", timeFormat(hdr->h_ts,S_FormatTime) ); X fprintf( stdout, " Process %d.\n", recProc.pid ); X if( flagFirst && globalDebug ) X fputs( " First sample.\n", stdout ); X X if( recProc.flagGone ) X { X fprintf( stdout, " Process not in process table.\n", stdout ); X globalProcs[slot].pid = -1; X return 1; X } X X /* X ** Amount of CPU time accumulated since the last sample. X */ X timeProc = (recProc.timeUsr+recProc.timeSys) - X globalProcs[slot].timeCpu; X X if( !flagFirst ) X { X time_t timeCpu; X X timeCpu = hdr->h_ts - globalProcs[slot].timeLast; X perCpu = ((float)timeProc/(float)timeCpu) * 100.0; X X#if 0 X fprintf( stdout, "time (%lu+%lu-%lu)/(%lu-%lu) * 100\n", X recProc.timeUsr, recProc.timeSys, globalProcs[slot].timeCpu, X hdr->h_ts, globalProcs[slot].timeLast ); X#endif X } X X fprintf( stdout, " CPU. User %s.", X secFormat(recProc.timeUsr) ); X fprintf( stdout, " Kernel %s.", X secFormat(recProc.timeSys) ); X if( !flagFirst ) X fprintf( stdout, " %.4f%% of sample.\n", perCpu ); X else X fputc( (int)'\n', stdout ); X X fprintf( stdout, " Regions. %s data.", X fmtByte(recProc.regions[SARG_REGION_DATA]) ); X fprintf( stdout, " %s stack.\n", X fmtByte(recProc.regions[SARG_REGION_STACK]) ); X X globalProcs[slot].timeLast = hdr->h_ts; X globalProcs[slot].timeCpu = recProc.timeUsr + recProc.timeSys; X X return 1; X} SHAR_EOF chmod 0664 'orion-1.0/sarrep/proc.c' || $echo 'restore of' 'orion-1.0/sarrep/proc.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'orion-1.0/sarrep/proc.c:' 'MD5 check failed' 9a0b231bc1178c075ea3747db8c34d34 orion-1.0/sarrep/proc.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'orion-1.0/sarrep/proc.c'`" test 3597 -eq "$shar_count" || $echo 'orion-1.0/sarrep/proc.c:' 'original size' '3597,' 'current size' "$shar_count!" fi fi # ============= orion-1.0/sarrep/tty.c ============== if test -f 'orion-1.0/sarrep/tty.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'orion-1.0/sarrep/tty.c' '(file already exists)' rm -f _sh05649/new else > _sh05649/new $echo 'x -' extracting 'orion-1.0/sarrep/tty.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'orion-1.0/sarrep/tty.c' && X X/* X** ---------------------------------------------------------------- X** X** Copyright (c) 1994,1995,1996 by Larry Plona X** X** This file is part of the Orion software package. The Orion X** software package is copyright by its author, Larry Plona. This X** software, both source code and prepared binaries, may be X** freely distributed as long as all copyright notices remain X** intact and this software is not sold or packaged with other X** commercial software. X** X** No warranty of any kind attached with this software. It is X** supplied as is. X** X** ---------------------------------------------------------------- X*/ X X#include"sarrep.h" X Xstatic struct recSave X{ X unsigned countTtyRaw; X float rateTtyRaw; X unsigned countTtyOut; X float rateTtyOut; X unsigned countTtyCan; X float rateTtyCan; X float rateTtyModem; X float rateTtyTx; X float rateTtyRx; X}; X Xstatic int globalTty; X Xint ttyInit( void ) X{ X globalTty = 1; X} X Xint crunchTty( int fd, struct sargHdr *hdr ) X{ X static time_t timeLast; X static struct sargTty orecSar; X int i; X time_t timeInterval; X struct sargTty recSar; X struct recSave recSave; X time_t timeCurr; X X timeCurr = hdr->h_ts; X X if( (i=recRead(fd,SARG_RTYP_TTY,&recSar,sizeof(recSar))) < 1 ) X return i; X X if( globalTty ) X { X orecSar = recSar; X timeLast = timeCurr; X globalTty = 0; X return 1; X } X X /* X ** Calculate the number of seconds which have passed. X */ X timeInterval = timeCurr - timeLast; X X /* X ** Calculate the amount of CPU time that has passed. X */ X { X if( timeInterval > 0 ) X { X recSave.countTtyRaw = recSar.cntTtyRaw - orecSar.cntTtyRaw; X recSave.rateTtyRaw = (float)recSave.countTtyRaw / (float)timeInterval; X recSave.countTtyOut = recSar.cntTtyOut - orecSar.cntTtyOut; X recSave.rateTtyOut = (float)recSave.countTtyOut / (float)timeInterval; X recSave.countTtyCan = recSar.cntTtyCan - orecSar.cntTtyCan; X recSave.rateTtyCan = (float)recSave.countTtyCan / (float)timeInterval; X recSave.rateTtyModem = (float)(recSar.cntIntrMdm-orecSar.cntIntrMdm) X / (float)timeInterval; X recSave.rateTtyTx = (float)(recSar.cntIntrXmt-orecSar.cntIntrXmt) X / (float)timeInterval; X recSave.rateTtyRx = (float)(recSar.cntIntrRcv-orecSar.cntIntrRcv) X / (float)timeInterval; X } X else X { X recSave.countTtyOut = -1; X recSave.countTtyRaw = -1; X recSave.countTtyCan = -1; X recSave.rateTtyRaw = 0.0; X recSave.rateTtyOut = 0.0; X recSave.rateTtyModem = 0.0; X recSave.rateTtyTx = 0.0; X recSave.rateTtyRx = 0.0; X } X } X X fprintf( stdout, "%s\n", timeFormat(timeCurr,S_FormatTime) ); SHAR_EOF : || $echo 'restore of' 'orion-1.0/sarrep/tty.c' 'failed' fi $echo 'End of' 'orion-1.0' 'part' '1' $echo 'File' 'orion-1.0/sarrep/tty.c' 'is continued in part' '2' echo 2 > _sh05649/seq exit 0