From: sources@anomaly.sbs.risc.net
Subject: v01i122 - u386mon v3.40, SCO UNIX Performance Monitor - Part 02/06
Reply-To: sources@anomaly.sbs.risc.net
Organization: The Rhode Island Internet Systems Cooperative Network
Date: Mon, 14 Sep 1992 14:18:07 GMT
Followup-To: biz.sco.general


#!/bin/sh
# this is part.02 (part 2 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file Make.sco continued
#
if test ! -r shar3_seq_.tmp; then
	echo "Please unpack part 1 first!"
	exit 1
fi
(read Scheck
 if test "$Scheck" != 2; then
	echo "Please unpack part $Scheck next!"
	exit 1
 else
	exit 0
 fi
) < shar3_seq_.tmp || exit 1
echo "x - Continuing file Make.sco"
sed 's/^X//' << 'SHAR_EOF' >> Make.sco &&
X		 >> mkdep.rule.tmp) ;\
X		fi
X
X		echo 1 >mkdep.ex.tmp
X		echo '/^# DO NOT DELETE THIS LINE' >>mkdep.ex.tmp
X		echo '.+1,$$d' >>mkdep.ex.tmp
X		echo 'r mkdep.rule.tmp' >> mkdep.ex.tmp
X		echo 'w' >> mkdep.ex.tmp
X		cp Makefile.sco Makefile.new
X		ex Makefile.new < mkdep.ex.tmp
X		rm mkdep.ex.tmp mkdep.rule.tmp
X		echo '#	DEPENDENCIES MUST END AT END OF	FILE' >>Makefile.new
X		echo '#	IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
X		echo '#	see make depend	above'>>Makefile.new
X		mv Makefile.sco Makefile.bak
X		mv Makefile.new Makefile.sco
X
X# DO NOT DELETE THIS LINE
Xu386mon.o: config.h
Xu386mon.o: /usr/include/curses.h
Xu386mon.o: libpanel.h
Xu386mon.o: /usr/include/signal.h
Xu386mon.o: /usr/include/string.h
Xu386mon.o: /usr/include/fcntl.h
Xu386mon.o: /usr/include/nlist.h
Xu386mon.o: /usr/include/errno.h
Xu386mon.o: /usr/include/time.h
Xu386mon.o: /usr/include/sys/types.h
Xu386mon.o: /usr/include/sys/lock.h
Xu386mon.o: /usr/include/sys/utsname.h
Xu386mon.o: /usr/include/sys/stat.h
Xu386mon.o: /usr/include/sys/param.h
Xu386mon.o: /usr/include/sys/tuneable.h
Xu386mon.o: /usr/include/sys/sysinfo.h
Xu386mon.o: /usr/include/sys/sysmacros.h
Xu386mon.o: /usr/include/sys/immu.h
Xu386mon.o: /usr/include/sys/region.h
Xu386mon.o: /usr/include/sys/proc.h
Xu386mon.o: /usr/include/sys/var.h
Xu386mon.o: /usr/include/sys/swap.h
Xu386mon.o: /usr/include/sys/trap.h
Xu386mon.o: nlsym.h
Xu386mon.o: libkmem.h
Xu386mon.o: libmem.h
Xu386mon.o: libswap.h
Xu386mon.o: libnlsym.h
Xu386mon.o: u386mon.h
Xbootinfo.o: config.h
Xbootinfo.o: /usr/include/curses.h
Xbootinfo.o: /usr/include/sys/types.h
Xbootinfo.o: /usr/include/sys/bootinfo.h
Xbootinfo.o: u386mon.h
Xdetail.o: config.h
Xdetail.o: /usr/include/curses.h
Xdetail.o: /usr/include/signal.h
Xdetail.o: /usr/include/string.h
Xdetail.o: /usr/include/fcntl.h
Xdetail.o: /usr/include/nlist.h
Xdetail.o: /usr/include/errno.h
Xdetail.o: /usr/include/time.h
Xdetail.o: /usr/include/pwd.h
Xdetail.o: /usr/include/sys/types.h
Xdetail.o: /usr/include/utmp.h
Xdetail.o: /usr/include/sys/utsname.h
Xdetail.o: /usr/include/sys/stat.h
Xdetail.o: /usr/include/sys/param.h
Xdetail.o: /usr/include/sys/tuneable.h
Xdetail.o: /usr/include/sys/sysinfo.h
Xdetail.o: /usr/include/sys/sysmacros.h
Xdetail.o: /usr/include/sys/immu.h
Xdetail.o: /usr/include/sys/region.h
Xdetail.o: /usr/include/sys/proc.h
Xdetail.o: /usr/include/sys/var.h
Xdetail.o: nlsym.h
Xdetail.o: libkmem.h
Xdetail.o: libnlsym.h
Xdetail.o: u386mon.h
Xdet_proc.o: config.h
Xdet_proc.o: /usr/include/curses.h
Xdet_proc.o: /usr/include/signal.h
Xdet_proc.o: /usr/include/string.h
Xdet_proc.o: /usr/include/fcntl.h
Xdet_proc.o: /usr/include/nlist.h
Xdet_proc.o: /usr/include/errno.h
Xdet_proc.o: /usr/include/time.h
Xdet_proc.o: /usr/include/pwd.h
Xdet_proc.o: /usr/include/sys/types.h
Xdet_proc.o: /usr/include/utmp.h
Xdet_proc.o: /usr/include/sys/stat.h
Xdet_proc.o: /usr/include/sys/param.h
Xdet_proc.o: /usr/include/sys/tuneable.h
Xdet_proc.o: /usr/include/sys/sysinfo.h
Xdet_proc.o: /usr/include/sys/sysmacros.h
Xdet_proc.o: /usr/include/sys/immu.h
Xdet_proc.o: /usr/include/sys/region.h
Xdet_proc.o: /usr/include/sys/proc.h
Xdet_proc.o: /usr/include/sys/fs/s5dir.h
Xdet_proc.o: /usr/include/sys/user.h
Xdet_proc.o: /usr/include/sys/var.h
Xdet_proc.o: nlsym.h
Xdet_proc.o: libkmem.h
Xdet_proc.o: libmem.h
Xdet_proc.o: libswap.h
Xdet_proc.o: libnlsym.h
Xdet_proc.o: u386mon.h
Xdet_sio.o: config.h
Xdet_sio.o: /usr/include/curses.h
Xdet_sio.o: /usr/include/string.h
Xdet_sio.o: /usr/include/nlist.h
Xdet_sio.o: /usr/include/sys/types.h
Xdet_sio.o: /usr/include/sys/stat.h
Xdet_sio.o: /usr/include/sys/ascii.h
Xdet_sio.o: /usr/include/sys/param.h
Xdet_sio.o: /usr/include/sys/tty.h
Xdet_sio.o: nlsym.h
Xdet_sio.o: libkmem.h
Xdet_sio.o: libmem.h
Xdet_sio.o: libswap.h
Xdet_sio.o: libnlsym.h
Xdet_sio.o: u386mon.h
Xdisputil.o: config.h
Xdisputil.o: /usr/include/curses.h
Xdisputil.o: /usr/include/sys/types.h
Xdisputil.o: u386mon.h
Xkludge.o: /usr/include/curses.h
Xlibkmem.o: /usr/include/sys/types.h
Xlibkmem.o: /usr/include/fcntl.h
Xlibkmem.o: libkmem.h
Xlibmem.o: /usr/include/sys/types.h
Xlibmem.o: /usr/include/fcntl.h
Xlibmem.o: libmem.h
Xlibpanel.o: config.h
Xlibpanel.o: /usr/include/curses.h
Xlibpanel.o: u386mon.h
Xlibswap.o: /usr/include/sys/types.h
Xlibswap.o: /usr/include/fcntl.h
Xlibswap.o: libswap.h
Xlibnlsym.o: config.h
Xlibnlsym.o: /usr/include/stdio.h
Xlibnlsym.o: /usr/include/sys/types.h
Xlibnlsym.o: /usr/include/sys/stat.h
Xlibnlsym.o: /usr/include/fcntl.h
Xlibnlsym.o: /usr/include/nlist.h
Xlibnlsym.o: nlsym.h
Xlibnlsym.o: libnlsym.h
Xnlsym.o: config.h
Xnlsym.o: /usr/include/stdio.h
Xnlsym.o: /usr/include/sys/types.h
Xnlsym.o: /usr/include/sys/stat.h
Xnlsym.o: /usr/include/fcntl.h
Xnlsym.o: /usr/include/nlist.h
Xnlsym.o: nlsym.h
Xproc.o: config.h
Xproc.o: /usr/include/curses.h
Xproc.o: /usr/include/sys/types.h
Xproc.o: /usr/include/sys/param.h
Xproc.o: /usr/include/sys/immu.h
Xproc.o: /usr/include/sys/region.h
Xproc.o: /usr/include/sys/proc.h
Xproc.o: /usr/include/sys/var.h
Xproc.o: /usr/include/nlist.h
Xproc.o: nlsym.h
Xproc.o: libkmem.h
Xproc.o: libnlsym.h
Xproc.o: u386mon.h
Xtune.o: config.h
Xtune.o: /usr/include/curses.h
Xtune.o: /usr/include/sys/types.h
Xtune.o: /usr/include/sys/tuneable.h
Xtune.o: u386mon.h
Xvar.o: config.h
Xvar.o: /usr/include/curses.h
Xvar.o: /usr/include/sys/types.h
Xvar.o: /usr/include/sys/var.h
Xvar.o: u386mon.h
X#	DEPENDENCIES MUST END AT END OF	FILE
X#	IF YOU PUT STUFF HERE IT WILL GO AWAY
X#	see make depend	above
SHAR_EOF
echo "File Make.sco is complete" &&
# ============= Make.sco.gcc ==============
echo "x - extracting Make.sco.gcc (Text)"
sed 's/^X//' << 'SHAR_EOF' > Make.sco.gcc &&
X#+-------------------------------------------------------------------
X#  Makefile for u386mon for SCO UNIX V/386 with gcc
X#  ...!{gatech,emory}!n4hgf!wht
X#--------------------------------------------------------------------
X#+:EDITS:*/
X#:08-01-1991-23:34-wht@n4hgf-release 3.40 source control point
X#:05-09-1991-03:51-wht@n4hgf-gcc support
X#:04-16-1991-02:24-martin@hppcmart-additions for SCO 3.2.2
X#:04-15-1991-16:05-martin@hppcmart-add table/wd/streams for SCO
X#:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2
X#:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates
X#:08-02-1990-15:35-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations
X#:08-01-1990-21:39-wht@n4hgf-add Dell make file
X#:08-01-1990-12:26-wht@n4hgf-2.11-try to support ISC 1.x.x
X#:07-28-1990-18:07-wht@n4hgf-2.10 release
X#:07-26-1990-02:55-wht@n4hgf-add -nointl -- smaller + we don't use it
X#:07-24-1990-18:53-wht@n4hgf-add USIZE_FIXED reminder
X#:07-21-1990-16:03-wht@n4hgf-add libpanel + remake depend
X#:06-30-1990-19:06-wht@n4hgf-run nlsym using full pathname
X#:06-27-1990-01:57-wht@n4hgf-1.10 - incorporate suggestions from alpha testers
X#:06-25-1990-04:14-wht@n4hgf-1.03-better error handling
X#:06-21-1990-14:27-r@n4hgf-version x0.12 seems bug free
X#:06-19-1990-21:37-wht@n4hgf-get ready for 0.08 release
X
X#------------> CFLAGS_LOCAL
X# Use -DVPIX         if you have kernel support for VP/ix
X#                    whether installed or not
X# Use -DMERGE386
X#                    if you have kernel support for Merge/386 (ODT-DOS)
X#                    whether installed or not
X#
X# Use -DUSIZE_FIXED  if you get erroneous process sizes (leave off for 3.2.0;
X#                    you do want this for any UNIX after 3.2.0 or any ODT)
X#
X# Use -DSCO322       if you are using SCO version 3.2.2 (UNIX 3.2r2 or ODT 1.1)
X#                    or later
X#
XCFLAGS_LOCAL = -DSCO322 -DMERGE386 -DUSIZE_FIXED
X
X#------------> compiler choice (CC, CFLAGS, LDFLAGS)
X#--> cc (native MSC 5.x)
X#CC = cc
X#CFLAGS = -c $(CFLAGS_LOCAL) -nointl -Octl -CSON -DLINT_ARGS
X#LDFLAGS = -s -nointl
X
X#--> gcc (some people make their gcc predefine 'i386' but others do not)
X#        You'll get bad explosions with -pedantic -ansi' unless you've
X#        hacked your header files to remove #idents plus some other changes.
X#        You probably want to substitute -traditional (I like GccAbuse).
XCC = gcc
XCFLAGS = -c $(CFLAGS_LOCAL)\
X	-traditional -O\
X	-fstrength-reduce -fpcc-struct-return -fwritable-strings\
X	-finline-functions -fforce-mem -fforce-addr\
X	-fcombine-regs\
X	-fcall-used-ax -fcall-used-bx -fcall-used-cx -fcall-used-dx\
X	-Wunused -Wpointer-arith -Wcast-qual\
X	-DM_UNIX -DM_XENIX -DM_SYSV -DM_SYS5 -DM_I386\
X	-Di386
XLDFLAGS = -s
X
X#------------> LIB
XLIB = -lpanel -ltinfo -lx -lmalloc -lc_s
X
X#------------> KMEMGRP
XKMEMGRP = mem
X
X#------------> BINDIR
XBINDIR = /usr/lbin
X
XVERSION = 2.40
X
X#handle Sys V make "feature" of using SHELL
XSHELL = /bin/sh
X
X#FCRC = fcrc -u $*.c ;
X.c.o:
X	@echo ignore redefinition warnings for box and newterm;
X	$(FCRC) $(CC) $(CFLAGS) $*.c 
X
XSRC = \
X	u386mon.c\
X	bootinfo.c\
X	detail.c\
X	det_proc.c\
X	det_sio.c\
X	det_stream.c\
X	det_table.c\
X	det_wd.c\
X	disputil.c\
X	kludge.c\
X	libkmem.c\
X	libmem.c\
X	libpanel.c\
X	libswap.c\
X	libnlsym.c\
X	nlsym.c\
X	proc.c\
X	tune.c\
X	var.c
X
XHDR = \
X	config.h\
X	libkmem.h\
X	libmem.h\
X	libpanel.h\
X	libswap.h\
X	libnlsym.h\
X	lint_args.h\
X	nlsym.h\
X	u386mon.h
X
XNLSYM_OBJ =\
X	nlsym.o
X
XU386MON_OBJ =\
X	u386mon.o\
X	detail.o\
X	det_proc.o\
X	det_sio.o\
X	det_stream.o\
X	det_table.o\
X	det_wd.o\
X	bootinfo.o\
X	kludge.o\
X	proc.o\
X	tune.o\
X	var.o\
X	disputil.o\
X	libkmem.o\
X	libmem.o\
X	libswap.o\
X	libnlsym.o
X
XSHARFLS = \
X	README\
X	CHANGES\
X	Make.*\
X	EXPLAIN\
X	$(SRC)\
X	$(HDR)\
X	renice/Makefile\
X	renice/renice.c\
X	panel/README\
X	panel/panel.3\
X	panel/ptest.c\
X	panel/Makefile
X
Xall: nlsym u386mon
X
X#must run as root
Xinstall: all
X	strip nlsym
X	mcs -d nlsym
X	cp nlsym $(BINDIR)
X	chown bin $(BINDIR)/nlsym
X	chgrp bin $(BINDIR)/nlsym
X	chmod 711 $(BINDIR)/nlsym
X	strip u386mon
X	mcs -d u386mon
X	mv u386mon $(BINDIR)
X	chown bin $(BINDIR)/u386mon
X	chgrp $(KMEMGRP) $(BINDIR)/u386mon
X	chmod 2711 $(BINDIR)/u386mon
X	$(BINDIR)/nlsym
X	@echo ' ';echo 'csh users rehash before executing'
X
Xnlsym: $(NLSYM_OBJ)
X	$(CC) $(LDFLAGS) -o $@ $(NLSYM_OBJ) $(LIB)
X
Xu386mon: $(U386MON_OBJ)
X	$(CC) $(LDFLAGS) -o $@ $(U386MON_OBJ) $(LIB)
X
X/unix.nlsym: nlsym /unix
X	$(BINDIR)/nlsym
X	chmod 644 /unix.nlsym
X
X#not delivered
Xsrc.fls: $(SRC) Makefile
X	ls $(SRC) > src.fls
Xlint_args: src.fls
X	echo ' ' > lint_args.h
X	csh zgcc src.fls lint_args.h $(CFLAGS)
X
Xclean:
X	rm -f $(U386MON_OBJ) $(NLSYM_OBJ) \
X		core u386mon.lint Makefile.bak src.fls mkdep.* cscope.out tags a.out
X
Xclobber: clean
X	rm -f nlsym u386mon
X
Xlint:
X	lint -ux *.c > u386mon.lint
X
X#for shar 3.27 or later
Xshar:
X	shar -a -n u386mon.$(VERSION) -l 55 -o u386m-$(VERSION) $(SHARFLS)
X
X# MAKE DEPEND: regenerate .c:.h, .ol:.c, .ol:.asm dependencies automatically
X#
Xdepend:
X		rm -f mkdep.rule.tmp
X		if test '$(SRC)' ;\
X		then (grep '^#include' $(SRC) \
X		| sed	-e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
X			-e 's?:[^"]*"\([^"]*\)".*?: \1?'\
X			-e 's?\(.*\)\.c?\1.o?'\
X		 >> mkdep.rule.tmp) ;\
X		fi
X
X		echo 1 >mkdep.ex.tmp
X		echo '/^# DO NOT DELETE THIS LINE' >>mkdep.ex.tmp
X		echo '.+1,$$d' >>mkdep.ex.tmp
X		echo 'r mkdep.rule.tmp' >> mkdep.ex.tmp
X		echo 'w' >> mkdep.ex.tmp
X		cp Makefile.sco Makefile.new
X		ex Makefile.new < mkdep.ex.tmp
X		rm mkdep.ex.tmp mkdep.rule.tmp
X		echo '#	DEPENDENCIES MUST END AT END OF	FILE' >>Makefile.new
X		echo '#	IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
X		echo '#	see make depend	above'>>Makefile.new
X		mv Makefile.sco Makefile.bak
X		mv Makefile.new Makefile.sco
X
X# DO NOT DELETE THIS LINE
Xu386mon.o: config.h
Xu386mon.o: /usr/include/curses.h
Xu386mon.o: libpanel.h
Xu386mon.o: /usr/include/signal.h
Xu386mon.o: /usr/include/string.h
Xu386mon.o: /usr/include/fcntl.h
Xu386mon.o: /usr/include/nlist.h
Xu386mon.o: /usr/include/errno.h
Xu386mon.o: /usr/include/time.h
Xu386mon.o: /usr/include/sys/types.h
Xu386mon.o: /usr/include/sys/lock.h
Xu386mon.o: /usr/include/sys/utsname.h
Xu386mon.o: /usr/include/sys/stat.h
Xu386mon.o: /usr/include/sys/param.h
Xu386mon.o: /usr/include/sys/tuneable.h
Xu386mon.o: /usr/include/sys/sysinfo.h
Xu386mon.o: /usr/include/sys/sysmacros.h
Xu386mon.o: /usr/include/sys/immu.h
Xu386mon.o: /usr/include/sys/region.h
Xu386mon.o: /usr/include/sys/proc.h
Xu386mon.o: /usr/include/sys/var.h
Xu386mon.o: /usr/include/sys/swap.h
Xu386mon.o: /usr/include/sys/trap.h
Xu386mon.o: nlsym.h
Xu386mon.o: libkmem.h
Xu386mon.o: libmem.h
Xu386mon.o: libswap.h
Xu386mon.o: libnlsym.h
Xu386mon.o: u386mon.h
Xbootinfo.o: config.h
Xbootinfo.o: /usr/include/curses.h
Xbootinfo.o: /usr/include/sys/types.h
Xbootinfo.o: /usr/include/sys/bootinfo.h
Xbootinfo.o: u386mon.h
Xdetail.o: config.h
Xdetail.o: /usr/include/curses.h
Xdetail.o: /usr/include/signal.h
Xdetail.o: /usr/include/string.h
Xdetail.o: /usr/include/fcntl.h
Xdetail.o: /usr/include/nlist.h
Xdetail.o: /usr/include/errno.h
Xdetail.o: /usr/include/time.h
Xdetail.o: /usr/include/pwd.h
Xdetail.o: /usr/include/sys/types.h
Xdetail.o: /usr/include/utmp.h
Xdetail.o: /usr/include/sys/utsname.h
Xdetail.o: /usr/include/sys/stat.h
Xdetail.o: /usr/include/sys/param.h
Xdetail.o: /usr/include/sys/tuneable.h
Xdetail.o: /usr/include/sys/sysinfo.h
Xdetail.o: /usr/include/sys/sysmacros.h
Xdetail.o: /usr/include/sys/immu.h
Xdetail.o: /usr/include/sys/region.h
Xdetail.o: /usr/include/sys/proc.h
Xdetail.o: /usr/include/sys/var.h
Xdetail.o: nlsym.h
Xdetail.o: libkmem.h
Xdetail.o: libnlsym.h
Xdetail.o: u386mon.h
Xdet_proc.o: config.h
Xdet_proc.o: /usr/include/curses.h
Xdet_proc.o: /usr/include/signal.h
Xdet_proc.o: /usr/include/string.h
Xdet_proc.o: /usr/include/fcntl.h
Xdet_proc.o: /usr/include/nlist.h
Xdet_proc.o: /usr/include/errno.h
Xdet_proc.o: /usr/include/time.h
Xdet_proc.o: /usr/include/pwd.h
Xdet_proc.o: /usr/include/sys/types.h
Xdet_proc.o: /usr/include/utmp.h
Xdet_proc.o: /usr/include/sys/stat.h
Xdet_proc.o: /usr/include/sys/param.h
Xdet_proc.o: /usr/include/sys/tuneable.h
Xdet_proc.o: /usr/include/sys/sysinfo.h
Xdet_proc.o: /usr/include/sys/sysmacros.h
Xdet_proc.o: /usr/include/sys/immu.h
Xdet_proc.o: /usr/include/sys/region.h
Xdet_proc.o: /usr/include/sys/proc.h
Xdet_proc.o: /usr/include/sys/fs/s5dir.h
Xdet_proc.o: /usr/include/sys/user.h
Xdet_proc.o: /usr/include/sys/var.h
Xdet_proc.o: nlsym.h
Xdet_proc.o: libkmem.h
Xdet_proc.o: libmem.h
Xdet_proc.o: libswap.h
Xdet_proc.o: libnlsym.h
Xdet_proc.o: u386mon.h
Xdet_sio.o: config.h
Xdet_sio.o: /usr/include/curses.h
Xdet_sio.o: /usr/include/string.h
Xdet_sio.o: /usr/include/nlist.h
Xdet_sio.o: /usr/include/sys/types.h
Xdet_sio.o: /usr/include/sys/stat.h
Xdet_sio.o: /usr/include/sys/ascii.h
Xdet_sio.o: /usr/include/sys/param.h
Xdet_sio.o: /usr/include/sys/tty.h
Xdet_sio.o: nlsym.h
Xdet_sio.o: libkmem.h
Xdet_sio.o: libmem.h
Xdet_sio.o: libswap.h
Xdet_sio.o: libnlsym.h
Xdet_sio.o: u386mon.h
Xdisputil.o: config.h
Xdisputil.o: /usr/include/curses.h
Xdisputil.o: /usr/include/sys/types.h
Xdisputil.o: u386mon.h
Xkludge.o: /usr/include/curses.h
Xlibkmem.o: /usr/include/sys/types.h
Xlibkmem.o: /usr/include/fcntl.h
Xlibkmem.o: libkmem.h
Xlibmem.o: /usr/include/sys/types.h
Xlibmem.o: /usr/include/fcntl.h
Xlibmem.o: libmem.h
Xlibpanel.o: config.h
Xlibpanel.o: /usr/include/curses.h
Xlibpanel.o: u386mon.h
Xlibswap.o: /usr/include/sys/types.h
Xlibswap.o: /usr/include/fcntl.h
Xlibswap.o: libswap.h
Xlibnlsym.o: config.h
Xlibnlsym.o: /usr/include/stdio.h
Xlibnlsym.o: /usr/include/sys/types.h
Xlibnlsym.o: /usr/include/sys/stat.h
Xlibnlsym.o: /usr/include/fcntl.h
Xlibnlsym.o: /usr/include/nlist.h
Xlibnlsym.o: nlsym.h
Xlibnlsym.o: libnlsym.h
Xnlsym.o: config.h
Xnlsym.o: /usr/include/stdio.h
Xnlsym.o: /usr/include/sys/types.h
Xnlsym.o: /usr/include/sys/stat.h
Xnlsym.o: /usr/include/fcntl.h
Xnlsym.o: /usr/include/nlist.h
Xnlsym.o: nlsym.h
Xproc.o: config.h
Xproc.o: /usr/include/curses.h
Xproc.o: /usr/include/sys/types.h
Xproc.o: /usr/include/sys/param.h
Xproc.o: /usr/include/sys/immu.h
Xproc.o: /usr/include/sys/region.h
Xproc.o: /usr/include/sys/proc.h
Xproc.o: /usr/include/sys/var.h
Xproc.o: /usr/include/nlist.h
Xproc.o: nlsym.h
Xproc.o: libkmem.h
Xproc.o: libnlsym.h
Xproc.o: u386mon.h
Xtune.o: config.h
Xtune.o: /usr/include/curses.h
Xtune.o: /usr/include/sys/types.h
Xtune.o: /usr/include/sys/tuneable.h
Xtune.o: u386mon.h
Xvar.o: config.h
Xvar.o: /usr/include/curses.h
Xvar.o: /usr/include/sys/types.h
Xvar.o: /usr/include/sys/var.h
Xvar.o: u386mon.h
X#	DEPENDENCIES MUST END AT END OF	FILE
X#	IF YOU PUT STUFF HERE IT WILL GO AWAY
X#	see make depend	above
SHAR_EOF
# ============= Makefile ==============
echo "x - extracting Makefile (Text)"
sed 's/^X//' << 'SHAR_EOF' > Makefile &&
X#+-------------------------------------------------------------------
X#  Makefile for u386mon for SCO UNIX V/386
X#  ...!{gatech,emory}!n4hgf!wht
X#--------------------------------------------------------------------
X#+:EDITS:*/
X#:08-01-1991-23:34-wht@n4hgf-release 3.40 source control point
X#:05-09-1991-03:51-wht@n4hgf-gcc support
X#:04-16-1991-02:24-martin@hppcmart-additions for SCO 3.2.2
X#:04-15-1991-16:05-martin@hppcmart-add table/wd/streams for SCO
X#:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2
X#:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates
X#:08-02-1990-15:35-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations
X#:08-01-1990-21:39-wht@n4hgf-add Dell make file
X#:08-01-1990-12:26-wht@n4hgf-2.11-try to support ISC 1.x.x
X#:07-28-1990-18:07-wht@n4hgf-2.10 release
X#:07-26-1990-02:55-wht@n4hgf-add -nointl -- smaller + we don't use it
X#:07-24-1990-18:53-wht@n4hgf-add USIZE_FIXED reminder
X#:07-21-1990-16:03-wht@n4hgf-add libpanel + remake depend
X#:06-30-1990-19:06-wht@n4hgf-run nlsym using full pathname
X#:06-27-1990-01:57-wht@n4hgf-1.10 - incorporate suggestions from alpha testers
X#:06-25-1990-04:14-wht@n4hgf-1.03-better error handling
X#:06-21-1990-14:27-r@n4hgf-version x0.12 seems bug free
X#:06-19-1990-21:37-wht@n4hgf-get ready for 0.08 release
X
X#------------> CFLAGS_LOCAL
X# Use -DVPIX         if you have kernel support for VP/ix
X#                    whether installed or not
X# Use -DMERGE386
X#                    if you have kernel support for Merge/386 (ODT-DOS)
X#                    whether installed or not
X#
X# Use -DUSIZE_FIXED  if you get erroneous process sizes (leave off for 3.2.0;
X#                    you do want this for any UNIX after 3.2.0 or any ODT)
X#
X# Use -DSCO322       if you are using SCO version 3.2.2 (UNIX 3.2r2 or ODT 1.1)
X#                    or later
X#
XCFLAGS_LOCAL = -DSCO322 -DMERGE386 -DUSIZE_FIXED
X
X#------------> compiler choice (CC, CFLAGS, LDFLAGS)
X#--> cc (native MSC 5.x)
XCC = cc
XCFLAGS = -c $(CFLAGS_LOCAL) -nointl -Octl -CSON -DLINT_ARGS
XLDFLAGS = -s -nointl
X
X#--> gcc (some people make their gcc predefine 'i386' but others do not)
X#        You'll get bad explosions with -pedantic -ansi' unless you've
X#        hacked your header files to remove #idents plus some other changes.
X#        You probably want to substitute -traditional (I like GccAbuse).
X#CC = gcc
X#CFLAGS = -c $(CFLAGS_LOCAL)\
X#	-pedantic -ansi -O\
X#	-fstrength-reduce -fpcc-struct-return -fwritable-strings\
X#	-finline-functions -fforce-mem -fforce-addr\
X#	-fcombine-regs\
X#	-Wunused -Wpointer-arith -Wcast-qual\
X#	-DM_UNIX -DM_XENIX -DM_SYSV -DM_SYS5 -DM_I386\
X#	-Di386
X#LDFLAGS = -s
X
X#------------> LIB
XLIB = -lpanel -ltinfo -lx -lmalloc -lc_s
X
X#------------> KMEMGRP
XKMEMGRP = mem
X
X#------------> BINDIR
XBINDIR = /usr/lbin
X
XVERSION = 2.40
X
X#handle Sys V make "feature" of using SHELL
XSHELL = /bin/sh
X
X#FCRC = fcrc -u $*.c ;
X.c.o:
X	@echo ignore redefinition warnings for box and newterm;
X	$(FCRC) $(CC) $(CFLAGS) $*.c 
X
XSRC = \
X	u386mon.c\
X	bootinfo.c\
X	detail.c\
X	det_proc.c\
X	det_sio.c\
X	det_stream.c\
X	det_table.c\
X	det_wd.c\
X	disputil.c\
X	kludge.c\
X	libkmem.c\
X	libmem.c\
X	libpanel.c\
X	libswap.c\
X	libnlsym.c\
X	nlsym.c\
X	proc.c\
X	tune.c\
X	var.c
X
XHDR = \
X	config.h\
X	libkmem.h\
X	libmem.h\
X	libpanel.h\
X	libswap.h\
X	libnlsym.h\
X	lint_args.h\
X	nlsym.h\
X	u386mon.h
X
XNLSYM_OBJ =\
X	nlsym.o
X
XU386MON_OBJ =\
X	u386mon.o\
X	detail.o\
X	det_proc.o\
X	det_sio.o\
X	det_stream.o\
X	det_table.o\
X	det_wd.o\
X	bootinfo.o\
X	kludge.o\
X	proc.o\
X	tune.o\
X	var.o\
X	disputil.o\
X	libkmem.o\
X	libmem.o\
X	libswap.o\
X	libnlsym.o
X
XSHARFLS = \
X	README\
X	CHANGES\
X	Make.*\
X	EXPLAIN\
X	$(SRC)\
X	$(HDR)\
X	renice/Makefile\
X	renice/renice.c\
X	panel/README\
X	panel/panel.3\
X	panel/ptest.c\
X	panel/Makefile
X
Xall: nlsym u386mon
X
X#must run as root
Xinstall: all
X	strip nlsym
X	mcs -d nlsym
X	cp nlsym $(BINDIR)
X	chown bin $(BINDIR)/nlsym
X	chgrp bin $(BINDIR)/nlsym
X	chmod 711 $(BINDIR)/nlsym
X	strip u386mon
X	mcs -d u386mon
X	mv u386mon $(BINDIR)
X	chown bin $(BINDIR)/u386mon
X	chgrp $(KMEMGRP) $(BINDIR)/u386mon
X	chmod 2711 $(BINDIR)/u386mon
X	$(BINDIR)/nlsym
X	@echo ' ';echo 'csh users rehash before executing'
X
Xnlsym: $(NLSYM_OBJ)
X	$(CC) $(LDFLAGS) -o $@ $(NLSYM_OBJ) $(LIB)
X
Xu386mon: $(U386MON_OBJ)
X	$(CC) $(LDFLAGS) -o $@ $(U386MON_OBJ) $(LIB)
X
X/unix.nlsym: nlsym /unix
X	$(BINDIR)/nlsym
X	chmod 644 /unix.nlsym
X
X#not delivered
Xsrc.fls: $(SRC) Makefile
X	ls $(SRC) > src.fls
Xlint_args: src.fls
X	echo ' ' > lint_args.h
X	csh zgcc src.fls lint_args.h $(CFLAGS)
X
Xclean:
X	rm -f $(U386MON_OBJ) $(NLSYM_OBJ) \
X		core u386mon.lint Makefile.bak src.fls mkdep.* cscope.out tags a.out
X
Xclobber: clean
X	rm -f nlsym u386mon
X
Xlint:
X	lint -ux *.c > u386mon.lint
X
X#for shar 3.27 or later
Xshar:
X	shar -a -n u386mon.$(VERSION) -l 55 -o u386m-$(VERSION) $(SHARFLS)
X
X# MAKE DEPEND: regenerate .c:.h, .ol:.c, .ol:.asm dependencies automatically
X#
Xdepend:
X		rm -f mkdep.rule.tmp
X		if test '$(SRC)' ;\
X		then (grep '^#include' $(SRC) \
X		| sed	-e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
X			-e 's?:[^"]*"\([^"]*\)".*?: \1?'\
X			-e 's?\(.*\)\.c?\1.o?'\
X		 >> mkdep.rule.tmp) ;\
X		fi
X
X		echo 1 >mkdep.ex.tmp
X		echo '/^# DO NOT DELETE THIS LINE' >>mkdep.ex.tmp
X		echo '.+1,$$d' >>mkdep.ex.tmp
X		echo 'r mkdep.rule.tmp' >> mkdep.ex.tmp
X		echo 'w' >> mkdep.ex.tmp
X		cp Makefile.sco Makefile.new
X		ex Makefile.new < mkdep.ex.tmp
X		rm mkdep.ex.tmp mkdep.rule.tmp
X		echo '#	DEPENDENCIES MUST END AT END OF	FILE' >>Makefile.new
X		echo '#	IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
X		echo '#	see make depend	above'>>Makefile.new
X		mv Makefile.sco Makefile.bak
X		mv Makefile.new Makefile.sco
X
X# DO NOT DELETE THIS LINE
Xu386mon.o: config.h
Xu386mon.o: /usr/include/curses.h
Xu386mon.o: libpanel.h
Xu386mon.o: /usr/include/signal.h
Xu386mon.o: /usr/include/string.h
Xu386mon.o: /usr/include/fcntl.h
Xu386mon.o: /usr/include/nlist.h
Xu386mon.o: /usr/include/errno.h
Xu386mon.o: /usr/include/time.h
Xu386mon.o: /usr/include/sys/types.h
Xu386mon.o: /usr/include/sys/lock.h
Xu386mon.o: /usr/include/sys/utsname.h
Xu386mon.o: /usr/include/sys/stat.h
Xu386mon.o: /usr/include/sys/param.h
Xu386mon.o: /usr/include/sys/tuneable.h
Xu386mon.o: /usr/include/sys/sysinfo.h
Xu386mon.o: /usr/include/sys/sysmacros.h
Xu386mon.o: /usr/include/sys/immu.h
Xu386mon.o: /usr/include/sys/region.h
Xu386mon.o: /usr/include/sys/proc.h
Xu386mon.o: /usr/include/sys/var.h
Xu386mon.o: /usr/include/sys/swap.h
Xu386mon.o: /usr/include/sys/trap.h
Xu386mon.o: nlsym.h
Xu386mon.o: libkmem.h
Xu386mon.o: libmem.h
Xu386mon.o: libswap.h
Xu386mon.o: libnlsym.h
Xu386mon.o: u386mon.h
Xbootinfo.o: config.h
Xbootinfo.o: /usr/include/curses.h
Xbootinfo.o: /usr/include/sys/types.h
Xbootinfo.o: /usr/include/sys/bootinfo.h
Xbootinfo.o: u386mon.h
Xdetail.o: config.h
Xdetail.o: /usr/include/curses.h
Xdetail.o: /usr/include/signal.h
Xdetail.o: /usr/include/string.h
Xdetail.o: /usr/include/fcntl.h
Xdetail.o: /usr/include/nlist.h
Xdetail.o: /usr/include/errno.h
Xdetail.o: /usr/include/time.h
Xdetail.o: /usr/include/pwd.h
Xdetail.o: /usr/include/sys/types.h
Xdetail.o: /usr/include/utmp.h
Xdetail.o: /usr/include/sys/utsname.h
Xdetail.o: /usr/include/sys/stat.h
Xdetail.o: /usr/include/sys/param.h
Xdetail.o: /usr/include/sys/tuneable.h
Xdetail.o: /usr/include/sys/sysinfo.h
Xdetail.o: /usr/include/sys/sysmacros.h
Xdetail.o: /usr/include/sys/immu.h
Xdetail.o: /usr/include/sys/region.h
Xdetail.o: /usr/include/sys/proc.h
Xdetail.o: /usr/include/sys/var.h
Xdetail.o: nlsym.h
Xdetail.o: libkmem.h
Xdetail.o: libnlsym.h
Xdetail.o: u386mon.h
Xdet_proc.o: config.h
Xdet_proc.o: /usr/include/curses.h
Xdet_proc.o: /usr/include/signal.h
Xdet_proc.o: /usr/include/string.h
Xdet_proc.o: /usr/include/fcntl.h
Xdet_proc.o: /usr/include/nlist.h
Xdet_proc.o: /usr/include/errno.h
Xdet_proc.o: /usr/include/time.h
Xdet_proc.o: /usr/include/pwd.h
Xdet_proc.o: /usr/include/sys/types.h
Xdet_proc.o: /usr/include/utmp.h
Xdet_proc.o: /usr/include/sys/stat.h
Xdet_proc.o: /usr/include/sys/param.h
Xdet_proc.o: /usr/include/sys/tuneable.h
Xdet_proc.o: /usr/include/sys/sysinfo.h
Xdet_proc.o: /usr/include/sys/sysmacros.h
Xdet_proc.o: /usr/include/sys/immu.h
Xdet_proc.o: /usr/include/sys/region.h
Xdet_proc.o: /usr/include/sys/proc.h
Xdet_proc.o: /usr/include/sys/fs/s5dir.h
Xdet_proc.o: /usr/include/sys/user.h
Xdet_proc.o: /usr/include/sys/var.h
Xdet_proc.o: nlsym.h
Xdet_proc.o: libkmem.h
Xdet_proc.o: libmem.h
Xdet_proc.o: libswap.h
Xdet_proc.o: libnlsym.h
Xdet_proc.o: u386mon.h
Xdet_sio.o: config.h
Xdet_sio.o: /usr/include/curses.h
Xdet_sio.o: /usr/include/string.h
Xdet_sio.o: /usr/include/nlist.h
Xdet_sio.o: /usr/include/sys/types.h
Xdet_sio.o: /usr/include/sys/stat.h
Xdet_sio.o: /usr/include/sys/ascii.h
Xdet_sio.o: /usr/include/sys/param.h
Xdet_sio.o: /usr/include/sys/tty.h
Xdet_sio.o: nlsym.h
Xdet_sio.o: libkmem.h
Xdet_sio.o: libmem.h
Xdet_sio.o: libswap.h
Xdet_sio.o: libnlsym.h
Xdet_sio.o: u386mon.h
Xdisputil.o: config.h
Xdisputil.o: /usr/include/curses.h
Xdisputil.o: /usr/include/sys/types.h
Xdisputil.o: u386mon.h
Xkludge.o: /usr/include/curses.h
Xlibkmem.o: /usr/include/sys/types.h
Xlibkmem.o: /usr/include/fcntl.h
Xlibkmem.o: libkmem.h
Xlibmem.o: /usr/include/sys/types.h
Xlibmem.o: /usr/include/fcntl.h
Xlibmem.o: libmem.h
Xlibpanel.o: config.h
Xlibpanel.o: /usr/include/curses.h
Xlibpanel.o: u386mon.h
Xlibswap.o: /usr/include/sys/types.h
Xlibswap.o: /usr/include/fcntl.h
Xlibswap.o: libswap.h
Xlibnlsym.o: config.h
Xlibnlsym.o: /usr/include/stdio.h
Xlibnlsym.o: /usr/include/sys/types.h
Xlibnlsym.o: /usr/include/sys/stat.h
Xlibnlsym.o: /usr/include/fcntl.h
Xlibnlsym.o: /usr/include/nlist.h
Xlibnlsym.o: nlsym.h
Xlibnlsym.o: libnlsym.h
Xnlsym.o: config.h
Xnlsym.o: /usr/include/stdio.h
Xnlsym.o: /usr/include/sys/types.h
Xnlsym.o: /usr/include/sys/stat.h
Xnlsym.o: /usr/include/fcntl.h
Xnlsym.o: /usr/include/nlist.h
Xnlsym.o: nlsym.h
Xproc.o: config.h
Xproc.o: /usr/include/curses.h
Xproc.o: /usr/include/sys/types.h
Xproc.o: /usr/include/sys/param.h
Xproc.o: /usr/include/sys/immu.h
Xproc.o: /usr/include/sys/region.h
Xproc.o: /usr/include/sys/proc.h
Xproc.o: /usr/include/sys/var.h
Xproc.o: /usr/include/nlist.h
Xproc.o: nlsym.h
Xproc.o: libkmem.h
Xproc.o: libnlsym.h
Xproc.o: u386mon.h
Xtune.o: config.h
Xtune.o: /usr/include/curses.h
Xtune.o: /usr/include/sys/types.h
Xtune.o: /usr/include/sys/tuneable.h
Xtune.o: u386mon.h
Xvar.o: config.h
Xvar.o: /usr/include/curses.h
Xvar.o: /usr/include/sys/types.h
Xvar.o: /usr/include/sys/var.h
Xvar.o: u386mon.h
X#	DEPENDENCIES MUST END AT END OF	FILE
X#	IF YOU PUT STUFF HERE IT WILL GO AWAY
X#	see make depend	above
SHAR_EOF
# ============= README ==============
echo "x - extracting README (Text)"
sed 's/^X//' << 'SHAR_EOF' > README &&
Xu386mon 2.40 README - Thu Aug 01 23:21:51 EDT 1991
X==================================================
X
XThis is u386mon 2.40, a "performance" monitor, ostensibly for SCO UNIX
XV/386 and ISC 386/ix, although it has been ported to a 68k VME System V
XRelease 3.1 platform and to ISC 1.0.x and to the Tandem Integrity S2
X(both S5R3.0-ish).  Also, a renice is included as an example of
Xalternate uses of the kmem/mem/swap utility objects.
X
XThanks to some excellent work by martin@hppcmart.grenoble.hp.com (Martin
XCroome), STREAMS, table and winchester statistics are new since the last
Xreleased version (2.20).  These are currently enabled only on SCO and
XS5R3.1 since that's all we had to test with.  I asked for porting
Xassistance from several, but I guess everybody had a busy spring and
Xsummer.  Bless nba@sysware (Neils Baggesen) for doing the work for the
X3.1 world.
X
XU386mon has been tested on SCO 3.2.x and ODT and ISC 1.0.x, 2.0.x and
X2.2.x, Tandem Integrity S2 NonStop-UX and at least one MC68000 VME-based
XSys V Rel 3.1 system.
X
XThese may work with other UNIX System 5 Release 3.x systems with a
Xlittle work.  XENIX systems have greatly different kernel
Ximplementations and use xlist instead of nlist.  These programs will not
Xwork there; sorry.  Someone reported he was working on a port to XENIX,
Xbut jct!jct's mon386 is great (posted to comp.unix.xenix on 11 Jul 89 in
X9 parts, starting with Message-ID: <278@jct.UUCP>).
X
XU386mon requires terminfo style curses and will use color if you have
Xit.  It works best with a 43 line (or greater) screen, but will work
Xwith a 25 line screen with some limitations.  It works very well on SCO
XODT, Metro Link X11R4 and ISC xterms.  On a Wyuse 60, the SCO color
Xcurses does some interesting attribute mappings.
X
XOn a 20Mhz Compaq 386 running SCO UNIX 3.2.0, u386mon on a 43-line VGA,
Xwith a two second update interval, appears to consume 3 to 5% of the CPU
Xwhen in the "main" display and about 7 to 11% when displaying process
Xstatus (NPROC, v.v_proc == 100).  This is a bit expensive, but the job
Xis sorta hard: according to prof(1)/prof(CP), 50% of the time is spent
Xin curses.  Of course, on the Tandem Integrity S2 (a MIPS based
Xmachine), these figures were MUCH, MUCH lower :-).  On a 486 33 MHz
Xmachine, I get very much lower figures as well.  In fact, the guy was so
Xfast we found a divide by zero possibility where u386mon could run a
Xwhole cycle without ticking the clocks, getting zero total cpu ticks
Xover the cycle.
X
XAcknowledgments
X===============
X
XThanks to martin@hppcmart.grenoble.hp.com (Martin Croome), who gets
Xcomplete credit for the nice SCO STREAMS, table and winchester statistics.
XNeils Baggesen ported/tested them on S5R3.1.
X
XThanks to peter@radig.de (Peter Radig), dug@kd4nc (Doug Drye),
Xjdc@uudell.dell.com (Jeremy Chatfield), andy@rbdc (Andy Pitts),
Xtrb@ima.ima.isc.com (Andrew Tannenbaum) for the help with ISC 386/ix.
X
XThanks to nba@sysware.dk (Neils Baggesen) and allbery@ncoast.org
X(Brandon Allbery) for the System V Release 3.1 work.
X
XThanks to jmd@tdmsou (emory!n4hgf!tdmsou!jmd, John Dashner) for the Tandem
XS2 work.
X
XIf I missed mentioning some work you did, please accept my apology and
Xremind me.
X
XYellow Brick Road
X=================
X
XRead through this and you will finally reach "How to get going" below.
X
XSample output (somewhat obsolete)
X=================================
X(with 43-line screen; a 25 line screen will be missing Var/Bootinfo/Tune/Proc
Xon the 'main' display)
X
X u386mon 2.11/SCO 3.2 - n4hgf                                 04:39:36 wht@n4hgf
X---- CPU --- tot usr ker brk ---------------------------------------------------
X Instant %    93  54  39   0 uuuuuuuuuuuuuuuuuuuuuuuuuuukkkkkkkkkkkkkkkkkkk     
X 5 Sec Avg %  87  26  61   0 uuuuuuuuuuuuukkkkkkkkkkkkkkkkkkkkkkkkkkkkkk        
X10 Sec Avg %  89  45  44   0 uuuuuuuuuuuuuuuuuuuuuukkkkkkkkkkkkkkkkkkkkkk       
X---- Wait -- tot  io pio swp -- (% of real time) -------------------------------
X Instant %     5   5   0   0 ii                                                 
X 5 Sec Avg %  12  12   0   0 iiiiii                                             
X10 Sec Avg %   9   9   0   0 iiii                                               
X---- Sysinfo/Minfo --- (last  1000 msec activity) ------------------------------
Xbread          5  readch    60416  pswitch    21   vfault    1    unmodsw   0   
Xbwrite         9  writch     2507  syscall   261   demand    1    unmodfl   0   
Xlread        331  rawch         2  sysread   100   pfault   15    psoutok   0   
Xlwrite        42  canch         0  syswrit     4   cw        0    psinfai   0   
Xphread         0  outch      2508  sysfork     1   steal    15    psinok    0   
Xphwrite        0  msg           0  sysexec     0   frdpgs    0    rsout     0   
Xswapin         0  sema          0                  vfpg      0    rsin      0   
Xswapout        0  maxmem    5724k  runque      0   sfpg      0                  
Xbswapin        0  frmem     3284k  runocc      0   vspg      0    pages on      
Xbswapout       0  mem used    43%  swpque      0   sspg      0    swap      0   
Xiget          72  nswap    10000k  swpocc      0   pnpfault  0    cache     0   
Xnamei         71  frswp    10000k                  wrtfault  0    file      0   
Xdirblk        92  swp used     0%                                               
X                                                                                
X                                                                                
X                                                                                
X-- Var ---------  -- Bootinfo ----------   -- Tune ---------  -- Proc ---       
Xv_autoup      10  basemem      640k        t_ageintvl      9  sleep    22       
Xv_buf        600  extmem      6144k        t_bdflushr      1  run       1       
Xv_clist      200  bflags   00000000        t_gpgshi       40  zombie    0       
Xv_file       200  memory available         t_gpgslo       25  stop      0       
Xv_hbuf        64  00000000 000a0000        t_gpgsmsk   0x420  idle      0       
Xv_inode      200  00100000 00600000        t_maxfc         1  onproc    1       
Xv_maxpmem      0  00f40000 00060000 NODM   t_maxsc         1  xbrk      0       
Xv_maxup       60  memory used              t_maxumem    2560  total    24       
Xv_mount        5  00000000 00004000 RSVD   t_minarmem     25  in mem   24       
Xv_pbuf        20  006bb000 00037000 KBSS   t_minasmem     25                    
Xv_proc       100  006f2000 0000e000 KDTA                                        
Xv_region     210  00fa9000 00057000 KTXT                                        
Xv_vhndfrac    16                                                                
X
XThe main display
X================
X
XA brief description of reported information:
X
X0.  The '+' and '-' command adds or subtracts one second from the
X    update interval.  The value at startup is 2 seconds, the
X    range 1 to 4.  Below, the terms "x1", "x5" and "x10" mean
X    "interval X 1", "interval times 5" and "interval times 10,"
X    respectively.
X
X    You can determine the update interval by looking at the top
X    CPU histogram, labeled "Instant" for 1, "X sec" for 2-4 second
X    intervals.
X
X    On some *fast* systems, values may be too large in 3 and 4
X    second intervals and corrupt the display.  But the, you have
X    the extra CPU to run it more often :-).
X
X1.  The CPU utilization is shown with smoothing of x1 ("instant" if
X    the update interval is 1 second), x5 and x10 seconds.  Total
X    CPU usage is shown, with user, kernel and "break" subdivided.
X    Most performance utilities (vmstat) lump kernel (CPU_KERNEL)
X    and wait (CPU_WAIT) times together as kernel time.  u386mon
X    considers CPU_WAIT time as idle (the CPU could have been
X    doing something if an otherwise ready process wasn't waited).
X
X    On a color display, total cpu utilization is displayed in
X    green if the cpu utilization is below 70%, yellow if utilization
X    is between 70% and 89% and red if 90% or above.
X
X2.  The Wait display shows the x1, x5 and x10 second smoothed
X    percentages of real time no process could be run because
X    otherwise ready to run processes were waiting on logical,
X    swap or physical I/O.
X
X    On a color display, total wait time is displayed in green if
X    it is below 30%, yellow if utilization is between 30% and 49%
X    and red if 50% or above.
X
X3.  Sysinfo/Minfo display shows, generally, the number of events
X    for a measured value since the last display update.  For
X    example, runque shows the number of times a process was
X    placed on the run queue.  An exception is the memory and swap
X    space fields: These numbers reflect absolute current
X    utilization over the period shown in the "last XXXXX msec"
X    value in the banner.  Periods of 4000 milliseconds are shown
X    in red, 1500 to 3990 milliseconds in blue and less than 1500
X    milliseconds in the normal banner color.
X
X    My guess as to the meaning of the sysinfo and minfo values is
X    in the file EXPLAIN.  I am not familiar with the meanings of
X    all the items, having looked through the header files, sar
X    man pages and the other UNIX hacker-ganda I could find.
X    Comments are appreciated.
X
X4.  If you run u386mon on a 43 line display, extra information is displayed
X    on the bottom of the screen (from the struct var v, bootinfo
X    and proc kernel databases).
X
X    On a 24/25-line screen, the 'e' command accesses the Var/Bootinfo/
X    Tune/Proc display, overlaying the Sysinfo/Minfo display.
X    Using 'm' returns you to the main display.
X
X    Bootinfo will be missing from version running on platforms which
X    do not support it.
X
X5.  On a color display, static numeric values, such as maxmem appear
X    in blue (the same color as screen literals/labels).  Dynamic
X    numeric values are displayed in green, with the exception of
X    total cpu and wait percentages, which appear in light green,
X    red or yellow.
X
X6.  An "INEXACT" indication on the top line means that u386mon was
X    not scheduled quickly enough to capture accurate 1 second (nominal)
X    values.  Continued INEXACT indication suggests the x5 and x10
X    second smoothed values are also wrong.
X
X    An "INVALID" indication means u386mon was scheduled 3 or more
X    seconds late; all percentage isplays are now suspect.
X
X7.  IN GENERAL, if you see any red characters on the display,
X    immediately take grain of salt. If you have no color screen
X    and still see red, add tequila to salt.
X
X8.  If you are running as root, you may use the -l switch or the
X    'l' command to lock u386mon into memory.  If you do this, PLOCK
X    will appear at the top of the screen to remind you of this hoggy
X    behavior.  The u386mon process will not be listed in a process
X    status display since SSYS (locked, resident) processes are not
X    shown.
X
X9.  The ISC bootinfo field will have different information due to
X    different porting by ISC and SCO.
X
XProcess Status Display
X======================
X
X1.  Pressing 'p' causes a process status display of sorts to be
X    shown, overlaying Sysinfo/Minfo on a 25 line screen or
X    Var/Bootinfo/Tune/Proc on a 43 line screen.  On a 43 line screen, 'P'
X    causes a larger ps display to be shown, overlaying Sysinfo/Minfo and
X    Var/Bootinfo/Tune/Proc.
X
X    Sample output:
X
XS     USER   PID  CPU PRI NI  UCPU   SCPU  SIZE TTY CMD
Xs     root    148   0  26 20   0:00   0:05  108  ?? /etc/cron
Xs      wht  14946   2  39 20   0:02   0:11  224  05 TMR 01000a12
Xs      wht  14947   2  39 20   0:02   0:11  220  05 TMR 01011101
Xs      wht  14950   0  27 20   0:00   0:02  228  05 IP 01000a12
Xs      wht  14951   1  27 20   0:00   0:02  224  05 IP 01011101
Xs      wht  14952   0  27 20   0:01   0:02  228  05 TP4 01000a12
Xs      wht  14953   1  27 20   0:01   0:03  224  05 TP4 01011101
Xs      wht  14957   0  27 20   0:00   0:04  200  05 smpad.x
Xs      wht  14960   1  27 20   0:00   0:04  204  05 mmpad.x
Xs     root  15044   0  28 20   0:01   0:01  296  12 vi README
Xs     uucp  15053   0  30 26   0:00   0:00  696  ?? /usr/lib/uucp/uusched
Xs     uucp  15055   0  30 26   0:00   0:00  748  ?? UUCICO -r1 -sgatech
Xs     uucp  15060   0  28 26   0:00   0:00  768  ?? dialTBIT tty2E 2222222UC 192
X
X    NOTES
X    a.   S - two character status
X            1st character - process status
X               s - sleeping
X               R - ready to run (might be running if u386mon were not)
X               z - zombie
X               d - stopped by debugger
X               i - idle (in creation?)
X               p - running on processor (on single CPU systems, only u386mon
X                   will show this)
X               x - XBREAK - process growing or shrinking
X            2nd character - process swap status
X               S - process is swapped
X               blank - process is in memory
X
X    b.  If the process is running with setuid, a '#' appears to
X        the right of the username.
X
X    c.  On color systems, processes ready to run are shown in yellow
X        unless they are ready, but swapped out, in which case they
X        are shown in red.
X
X3.  Since a limited space is available for displaying process
X    status, particularly on a 25-line screen, a selective elimination
X    algorithm is used to whittle the list when insufficient room
X    is available.  init (pid 1) and system/resident (SSYS)
X    processes are never displayed.  When a display cycle is to begin
X    and there is not room for all of the processes to be shown,
X    processes are eliminated in the following order:
X
X    a. 'getty', 'uugetty', 'sh', 'csh', and 'ksh'
X    b. swapped and zombie processes
X    c. no cpu processes (no cpu time during last cycle)
X    d. sleeping processes
X
X    If there is still insufficient room, an indication to the effect
X    is displayed (tough cookies).
X
XDisk (Winchester) display
X=========================
X
XThis display shows each disk and diskette device known to the system
Xand performance statistics for each.  Currently, the information is
Xavailable only on SCO systems.  The percentages will be inaccurate for
Xone or two display cycles after the 'w' (winchester) selection
Xbecomes active.  Further updates may be inaccurate due to either
Xnoisy kernel data, data capture latency, our having to guess a
Xlot, or any combination of the above.
X
XSTREAMS (Net) display
X=====================
X
XThis display shows STREAMS queues and buffers utilization a bit
Xfaster and more dynamically than /etc/crash strstat!  Currently,
Xthe information is available only on SCO systems.
X
XTable Display
X=============
X
XThe current and maximum occupancy of various kernel tables are displayed.
XThis may not be enabled for all systems (I couldn't test Everywhere!).
X
XSio display
X===========
X
XThe experimental, "undocumented" sio display is a stab at tty I/O
Xmonitoring for SCO only. It will misbehave harmlessly if you do
Xnot have the sio driver installed (i.e., FAS in use).
X
XA $0.0002 tour: why nlsym and /unix.nlsym?
X==========================================
X
XAccess to kernel (/dev/kmem) and physical (/dev/mem) memory and
Xswap (/dev/swap) is required for u386mon to do its thing.
XTo find kmem addresses of interest, an nlist(S) call must be made
Xagainst /unix.  This can be quite expensive.
X
XThe 'nlist' procedure is performed by a separate program (nlsym)
Xand the resulting nlist structure array is stored in /unix.nlsym.
Xu386mon thus may obtain nlist information rapidly without nlist(S) each
Xtime it is executed.  Also stored in /unix.nlsym is a stat structure of
X/unix at the time of nlsym execution.  A unique word is stored at the
Xend of the file in case /unix.nlsym's nlist structure is expanded for
Xother applications.  The u386mon program reads /unix.nlsym by means
Xof facilities in libnlsym.c.  If the stat structure in /unix.nlsym
Xdoes not match a dynamic stat of /unix or if the unique word does
Xnot match, the nlist information is not trusted and u386mon prompts
Xthe user to run (or have run) the nlsym program to update /unix.nlsym.
X
XMany symbols are nlist'ed by nlsym which are not used by u386mon.
XYou may find other uses for libnlsym/libkmem which make use of them.
X
XHow to get going
X================
X
X1.  Copy the appropriate Make. file to Makefile, depending on
X    your type of system.  It has been a while since I have had
X    good reports on the various OSs other than SCO UNIX, so good luck.
X
X    Make.dell           DELL System V (ISC derived)
X    Make.isc1           ISC 1.x
X    Make.isc2           ISC 2.x
X    Make.isc2.gcc       ISC 2.x with gcc (untested)
X    Make.s2             Tandem Integrity S2 Non-Stop UX
X    Make.sVr31          Various System 5 Release 3.1 (good luck)
X    Make.sco            SCO UNIX 3.2, 3.2.1, 3.2r2, ODT 1.x
X    Make.sco.gcc        same with gcc 1.39
X
X2.  Edit Makefile to change BINDIR to match your local requirements.
X    If you have a kernel that knows about MERGE386 as with SCO ODT,
X    add -DMERGE386 to CFLAGS. Likewise, if you have VPIX, add -DVPIX.
X    You may need to add -Dm68k for a MC68000 system if your
X    compiler does not (This may sound like an odd statement for a
X    program with 386 in the name, but we are broadening our territory :->).
X
X3.  make all.  Please report compile errors to me.  You shouldn't
X    get any on SCO 3.2.x or ISC 2.x.x for any "recent" or current versions.
X
X3a. Note: Don't worry, if on SCO makes, you see warnings on many modules'
X    compilation similar to the following:
X
X                 cc -nointl -c -Octl -CSON -DLINT_ARGS u386mon.c
X        u386mon.c
X        /usr/include/tinfo.h(442) : warning C4005: 'box' : redefinition
X        /usr/include/tinfo.h(443) : warning C4005: 'newterm' : redefinition
X
X    This is confusion on part of tinfo.h resulting from our use of
X    some valuable speedup macros built into tinfo.h, but not quite
X    kosher enough to satisfy the compiler we know what we are doing.
X    If it bothers you, or something breaks, remove #define CURSES_MACROS
X    from u386mon's config.h.
X
X3b. If you get undefined externs for is_linetouched and is_wintouched(),
X    you can try editing config.h and #define NO_ISTOUCH.  Good luck -
X    these are hack attempts and I have no idea if they will work.
X
X4.  You must run make install as root since u386mon must be setuid to
X    'mem' ('sys' for ISC) and nlsym must produce /unix.nlsym.
X    For S5R3.1 systems, all bets on "make install" are off.  I don't
X    know what it takes, it'll vary from system to system, and the
X    Make.sVr31 is only a guide.  For instance, you may want to
X    rename the program to u68kmon on 68000 systems :-).
X
X    If you are a user of old u386mon versions, run the new nlsym since
X    the older /unix.nlsym format is not compatible with this version.
X
X5.  Sources are in 4-spaced tab format (please don't flame :->).
X
X6.  Under SCO, you may have to chgrp mem /dev/swap; I did.  For some reason,
X    I found the group name for /dev/swap on my system to be 'network'.
X    I guess something may have been broken by my changing the group,
X    but it hasn't bit me yet (now 2 months, but I don't have any EtherStuff).
X
X    The ISC Makefile unconditionally sets g+r on /dev/swap, since this
X    necessary permission is not ordinarily present.
X
X7.  usage: u386mon [-l] [-p | -P]
X    -l lock process into memory (if root)
X    -p begin with short ps display
X    -P begin with long ps display (if 43 line screen)
X    -w begin with disk (winchester) stats [SCO and S5R3.1 only]
X    -n begin with STREAMS (net) stats [SCO and S5R3.1 only]
X
X8.  If you are running SCO and get 4 as the size of most or all processes,
X    try adding -DUSIZE_FIXED.  SCO 3.2.0 had this info in the struct
X    user fields u_tsize, u_dsize, u_ssize wrong, IMHO, and fixed it
X    in ODT/3.2.1.  See det_proc.c for more detail.  Your port
X    may/WILL vary.
X
X9.  The renice program by Ford Ditto, from which the kmem routines
X    came, has been reworked and in included with this release.
X    It needs a current /unix.nlsym.
X
X    usage: renice -# pid     decrease nice by #
X           renice +# pid     increase nice by #
X           renice =# pid     set nice to #
X
X    The traditional privileges for root and non-root are supported.
X
X10. The libpanel.c module is not an efficient replacement for the
X    SVR3.2 panel facility.  It is, however, fully featured and serves
X    the needs of u386mon, assisting a port to SVR3.1.  It seems
X    efficient enough to use in lieu of native (vendor-supplied)
X    panels.
X
XComments are appreciated, especially bug fixes and information
Xhelping to port the program to another 386 SVR3 system.
XSomebody was purported to be working on a XENIX/386 lookalike.
X
XNO FSF, LPF, FOO or LSD -- just free.
X
X{gatech,emory}!n4hgf!wht -or- wht@n4hgf.Mt-Park.GA.US
X
XMany thanks to:
Xaaron@odt.icom.com
Xalan@cms2
Xallbery@ncoast.org
Xandy@rbdc
Xbbt.se!pgd
Xcms2!alan
Xdionj@sco.com (triple plus thanks)
Xdug@kd4nc
Xfocsys!larry
Xhowardl@wb3ffv.ampr.org
Xhppcmart!martin
Xjdc@uudell.dell.com
Xjonl@sco.com
Xlarry@focsys
Xmarlor@cup.portal.com
Xnba@sysware.dk
Xpat@rwing
Xrandy@chinet.chi.il
Xsoward@ms.uky.edu
Xsteen@kiku.dk
Xtrb@ima.ima.isc.com
Xradig.de!peter
Xwgs6386!budp
SHAR_EOF
# ============= bootinfo.c ==============
echo "x - extracting bootinfo.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > bootinfo.c &&
X/*+-------------------------------------------------------------------------
X	bootinfo.c - u386mon bootinfo struct display
X
X  Defined functions:
X	bmemf_text(flags)
X	display_bootinfo(win,y,x)
X
XWe try to be dynamic with memory block counts, but if the sum of
Xmemavailcnt and memusedcnt ever exceeds 7, we will lose in 24 line
Xsessions (8 in 25 line, 9 in 43 line)
X
X
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:08-01-1991-23:34-wht@n4hgf-release 3.40 source control point */
X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
X/*:08-02-1990-15:35-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
X/*:07-11-1990-17:19-root@n4hgf-more input from trb@ima.ima.isc.com */
X/*:07-04-1990-01:28-root@n4hgf-alan@cms2.lonestar.org reported missing M_ */
X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
X/*:06-25-1990-03:18-wht@n4hgf-ODT/3.2.1 has B_MEM_CANTDMA not B_MEM_NODMA */
X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
X/*:06-17-1990-14:59-wht-creation */
X
X#include "config.h"
X#if defined(HAS_BOOTINFO)
X#define M_TERMINFO
X#include <curses.h>
X#undef timeout /* conflict in curses.h and bootinfo.h per trb@ima.ima.isc.com */
X#undef reg     /* per nba@sysware.dk */
X#ifdef NATIVE_PANELS
X# include <panel.h>
X#else
X# include "libpanel.h"
X#endif
X#include <sys/types.h>
X#include <sys/bootinfo.h>
X#include "u386mon.h"
X
X/*+-------------------------------------------------------------------------
X	bmemf_text(flags)
X--------------------------------------------------------------------------*/
Xchar *
Xbmemf_text(flags)
Xulong flags;
X{
Xstatic char hex_errant[16];
Xulong orig_flags = flags;
X
X#if defined(B_MEM_DOWN)		/* SCO only */
X	flags &= ~B_MEM_DOWN;
X#endif
X#if defined(B_MEM_BASE)		/* ISC only (or is it SVR3.2.2?) */
X	flags &= ~B_MEM_BASE;
X#endif
X#if defined(B_MEM_EXPANS)	/* ISC */
X	flags &= ~B_MEM_EXPANS;
X#endif
X#if defined(B_MEM_SHADOW)	/* ISC */
X	flags &= ~B_MEM_SHADOW;
X#endif
X#if defined(B_MEM_TREV)		/* ISC */
X	flags &= ~B_MEM_TREV;
X#endif
X
X	if(!flags)
X		return("    ");
X	switch(flags)
X	{
X#if defined(B_MEM_RSRVD)
X		case B_MEM_RSRVD: return("RSVD");
X#endif
X#if defined(B_MEM_KBSS)
X		case B_MEM_KBSS:  return("KBSS");
X#endif
X#if defined(B_MEM_KTEXT)
X		case B_MEM_KTEXT: return("KTXT");
X#endif
X#if defined(B_MEM_KDATA)
X		case B_MEM_KDATA: return("KDTA");
X#endif
X#if defined(B_MEM_NODMA)
X		case B_MEM_NODMA: return("NODM");
X#endif
X#if defined(B_MEM_CANTDMA)
X		case B_MEM_CANTDMA: return("NODM");
X#endif
X	}
X	sprintf(hex_errant,"%04x",(ushort)orig_flags);
X	return(hex_errant);
X}	/* end of bmemf_text */
X
X/*+-------------------------------------------------------------------------
X	ISC_machinetype_text(machine)
X--------------------------------------------------------------------------*/
X#if defined(ME_COMPAQVGA)	/* ISC machdep.h */
Xchar *
XISC_machinetype_text(machine)
Xunsigned char machine;
X{
X	switch(machine)
X	{
X#if defined(M_UNKNOWN)	/* some ISC bootinfo.h do not have these */
X		case M_UNKNOWN:
X			return("");
X			break;
X#endif
X#if defined(M_COMPAQ)
X		case M_COMPAQ:
X			return("Compaq");
X			break;
X#endif
X#if defined(M_PS2)
X		case M_PS2:
X			return("PS/2");
X			break;
X#endif
X#if defined(M_AT)
X		case M_AT:
X			return("Generic 386");
X			break;
X#endif
X#if defined(M_ATT)
X		case M_ATT:
X			return("AT&T 6386");
X			break;
X#endif
X#if defined(M_ATT5)
X		case M_ATT5:
X			return("AT&T 6386");
X			break;
X#endif
X#if defined(M_M380)
X		case M_M380:
X			return("Olivetti M380");
X			break;
X#endif
X#if defined(M_DELL)
X		case M_DELL:
X			return("Dell 386");
X			break;
X#endif
X#if defined(M_D325)
X		case M_D325:
X			return("Dell 325");
X			break;
X#endif
X#if defined(M_ALR)
X		case M_ALR:
X			return("Adv Logic Res");
X			break;
X#endif
X#if defined(M_ZDS)
X		case M_ZDS:
X			return("Zenith Data");
X			break;
X#endif
X	}
X	return("i386");
X}	/* end of ISC_machinetype_text */
X#endif
X
X/*+-------------------------------------------------------------------------
X	ISC_displaytype_text(adapter)
X--------------------------------------------------------------------------*/
X#if defined(ME_COMPAQVGA)	/* ISC machdep.h */
Xchar *
XISC_displaytype_text(adapter)
Xunsigned char adapter;
X{
X
X	switch(adapter)
X	{
X		case ME_UNKNOWN:
X			return("unknown to sys");
X			break;
X		case ME_EGA:
X			return("EGA");
X			break;
X		case ME_CGA80:
X			return("CGA");
X			break;
X		case ME_MONO:
X			return("MONO");
X			break;
X		case ME_COMPAQHR:
X			return("Compaq mono");
X			break;
X		case ME_Z449:
X			return("Zenith Z449");
X			break;
X		case ME_T5100:
X			return("Toshiba T5100");
X			break;
X		case ME_COMPAQVGA:
X			return("Compaq VGA");
X			break;
X		case ME_OTHERVGA:
X			return("VGA");
X			break;
X#if defined(ME_PVGA1)
X		case ME_PVGA1:
X			return("Paradise VGA1");
X			break;
X#endif /*ME_PVGA1*/
X#if defined(ME_V7VGA)
X		case ME_V7VGA:
X			return("Video 7 VGA");
X			break;
X#endif /*ME_V7VGA*/
X	}
X	return("???");
X}	/* end of ISC_displaytype_text */
X#endif
X
X/*+-------------------------------------------------------------------------
X	display_bootinfo(win,y,x)
X--------------------------------------------------------------------------*/
Xvoid
Xdisplay_bootinfo(win,y,x)
XWINDOW *win;
Xint y;
Xint x;
X{
Xregister itmp;
Xregister struct bootmem *bmem;
X
X	use_cp(win,cpBANNER);
X	wmove(win,y++,x);
X	waddstr(win,"-- Bootinfo ----------");
X#if defined(M_UNIX)	/* ISC doesn't have this in struct */
X	wmove(win,y++,x);
X	disp_static_long(win,"basemem  ","%7ldk     ",bootinfo.basemem / 1024);
X	wmove(win,y++,x);
X	disp_static_long(win,"extmem   ","%7ldk     ",bootinfo.extmem / 1024);
X#endif
X#if defined(ME_COMPAQVGA)	/* ISC machdep.h */
X	wmove(win,y++,x);
X	wprintw(win,"machine %14.14s",
X		ISC_machinetype_text(bootinfo.machenv.machine));
X	wmove(win,y++,x);
X	wprintw(win,"disp %17.17s",
X		ISC_displaytype_text(bootinfo.machenv.adapter));
X#endif
X	wmove(win,y++,x);
X	disp_static_long(win,"bflags   ","%08lx     ",bootinfo.bootflags);
X
X	wmove(win,y++,x); waddstr(win,"memory available      ");
X	for(itmp = 0; itmp < bootinfo.memavailcnt; itmp++)
X	{
X		bmem = &bootinfo.memavail[itmp];
X#if defined(B_MEM_DOWN)
X		if(bmem->flags & B_MEM_DOWN)
X		{
X			bmem->base -= bmem->extent;
X			bmem->flags &= ~B_MEM_DOWN;
X		}
X#endif
X		wmove(win,y++,x);
X		wprintw(win,"%08lx %08lx %s",bmem->base,bmem->extent,
X			bmemf_text(bmem->flags));
X	}
X
X	wmove(win,y++,x); waddstr(win,"memory used           ");
X	for(itmp = 0; itmp < bootinfo.memusedcnt; itmp++)
X	{
X		bmem = &bootinfo.memused[itmp];
X#if defined(B_MEM_DOWN)
X		if(bmem->flags & B_MEM_DOWN)
X		{
X			bmem->base -= bmem->extent;
X			bmem->flags &= ~B_MEM_DOWN;
X		}
X#endif
X		wmove(win,y++,x);
X		wprintw(win,"%08lx %08lx %s",bmem->base,bmem->extent,
X			bmemf_text(bmem->flags));
X	}
X
X}	/* end of display_bootinfo */
X
X#endif /* HAS_BOOTINFO */
X/* vi: set tabstop=4 shiftwidth=4: */
X/* end of bootinfo.c */
SHAR_EOF
# ============= config.h ==============
echo "x - extracting config.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > config.h &&
X/*+-------------------------------------------------------------------------
X	config.h - u386mon system monitor configuration
X
XHopefully, we will hide most of the Machiavellian version-hackery
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:08-01-1991-23:34-wht@n4hgf-release 3.40 source control point */
X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
X/*:08-02-1990-15:35-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
X/*:08-01-1990-19:24-jdc@dell.com-add DELL config */
X/*:08-01-1990-12:24-wht@n4hgf-2.11-try to support ISC 1.x.x */
X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
X/*:07-26-1990-17:51-wht-creation */
X
X#define U386MON
X
X#if defined(M_UNIX)
X#define HAS_RDCHK
X#define HAS_NAP
X#if !defined(SVR32)
X#define SVR32
X#endif
X#if !defined(SCO320) && !defined(USIZE_FIXED)	/* you want USIZE_FIXED */
X#define USIZE_FIXED					/* unless you are using SCO 3.2.0 */
X#endif
X/* The next two lines may speed up other True S5R3 versions, but I can't say */
X#define PERFORMANCE /* see u386mon.c, kludge.c, /usr/include/tinfo.h */
X#define CURSES_MACROS
X#endif
X
X#if defined(DELL)
X#define ISC
X#if !defined(SVR32)
X#define SVR32
X#endif
X#endif
X
X#ifdef ISC_1
X#define ISC
X#if !defined(SVR31)
X#define SVR31
X#endif
X#ifndef NO_ISTOUCH
X#define NO_ISTOUCH
X#endif
X#else /* !ISC 1.x.x */
X#if defined(ISC)
X#define HAS_RDCHK
X#define HAS_NAP
X#if !defined(SVR32)
X#define SVR32
X#endif
X#endif
X#endif
X
X#if defined(SVR32)
X#define NATIVE_PANELS
X#define HAS_BOOTINFO
X#define HAS_TIMEB
X#endif
X
X/*
X * some old curses do not have is_wintouched() or is_linetouched()
X * ... sigh ... This makes our homebrew panel object severely
X * disappointed, maybe useless ... but define NO_ISTOUCH to try
X * it if you get undefined externs for these two work saver functions.
X */
X#ifdef SVR31
X#ifndef NO_ISTOUCH
X/* #define NO_ISTOUCH */
X#endif
X#endif
X
X#if defined(mips)
X#if !defined(SVR31)
X#define SVR31
X#endif
X#if !defined(NO_ISTOUCH)
X#define NO_ISTOUCH
X#endif
X#endif
X
X/* vi: set tabstop=4 shiftwidth=4: */
X/* end of config.h */
SHAR_EOF
# ============= det_proc.c ==============
echo "x - extracting det_proc.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > det_proc.c &&
X/*+-------------------------------------------------------------------------
X	det_proc.c - UNIX V/386 system monitor proc status detail
X	...!{gatech,emory}!n4hgf!wht
X
X  Defined functions:
X	det_proc_init()
X	display_proc_stat(win,iproc,initial)
X	display_proc_stats(win,initial)
X	find_utmp_for_pgrp(pgrp)
X	get_cpu_time_str(ticks)
X	get_user(tproc,tuser)
X	getpwent_and_enter(uid)
X	init_uid_name_hash()
X	pgrp_to_ttyname(pgrp)
X	ppproc_pid_compare(ppp1,ppp2)
X	read_and_sort_procs(initial)
X	read_utmp()
X	uid_name_enter(uid,name)
X	uid_to_name(uid)
X
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:08-01-1991-23:34-wht@n4hgf-release 3.40 source control point */
X/*:02-14-1991-11:26-martin@hppcmart-Whittle procs with no cpu time*/
X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
X/*:08-01-1990-12:26-wht@n4hgf-2.11-try to support ISC 1.x.x */
X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
X/*:07-11-1990-03:45-root@n4hgf-faster proc table manipulation */
X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
X/*:01-05-1989-13:27-wht-creation */
X
X#include "config.h"
X#define M_TERMINFO
X#include <curses.h>
X#undef timeout /* conflict in curses.h and bootinfo.h per trb@ima.ima.isc.com */
X#undef reg     /* per nba@sysware.dk */
X#ifdef NATIVE_PANELS
X# include <panel.h>
X#else
X# include "libpanel.h"
X#endif
X#include <signal.h>
X#include <string.h>
X#include <fcntl.h>
X#include <nlist.h>
X#include <errno.h>
X#include <time.h>
X#include <pwd.h>
X#include <sys/types.h>
X#include <utmp.h>
X#include <sys/stat.h>
X#undef NGROUPS_MAX
X#undef NULL
X#include <sys/param.h>
X#include <sys/tuneable.h>
X#include <sys/sysinfo.h>
X#include <sys/sysmacros.h>
X#include <sys/immu.h>
X#include <sys/region.h>
X#if defined(mips)
X#define pg_pres pg_sv /* alias: MIPS pg_sv==page valid */
X#include <sys/sbd.h>
X#include <sys/pcb.h>
X#endif
X#include <sys/proc.h>
X#include <sys/fs/s5dir.h>
X#include <sys/user.h>
X#include <sys/var.h>
X#if defined(M_UNIX) && (defined(i386) || defined(i486)) && SYSI86_RDUBLK_WANTED
X/* maybe someday, but not now */
X# include <sys/sysi86.h>
X#endif
X
X#include "nlsym.h"
X#include "libkmem.h"
X#include "libmem.h"
X#include "libswap.h"
X#include "libnlsym.h"
X#include "u386mon.h"
X
Xextern int errno;
X
Xextern int nprocs;
Xextern struct var v;
Xextern struct proc *procs;
Xextern struct proc *oldprocs;
Xextern struct proc **pprocs;
Xextern struct proc **poldprocs;
X
Xint mypid;
Xint noldprocs = 0;
Xint nprocs = 0;
Xint max_procs_to_display;
X
Xstruct user user;
X
X#define min(a,b) (((a) > (b)) ? (b) : (a))
X
X#define MAX_UTMP 64
Xint nutmps = 0;
Xstruct utmp utmps[MAX_UTMP];
X
X/*+-------------------------------------------------------------------------
X	ppproc_pid_compare(ppp1,ppp2)
X--------------------------------------------------------------------------*/
Xppproc_pid_compare(ppp1,ppp2)
Xregister struct proc **ppp1;
Xregister struct proc **ppp2;
X{
X	return((*ppp1)->p_pid - (*ppp2)->p_pid);
X}	/* end of ppproc_pid_compare */
X
X/*+-------------------------------------------------------------------------
X	read_and_sort_procs(initial)
X--------------------------------------------------------------------------*/
Xvoid
Xread_and_sort_procs(initial)
Xint initial;
X{
Xint iproc;
Xregister char *cptr;
Xregister struct proc *tproc;
Xint omitted_one;
Xchar omitted[80];
X
X	omitted[0] = 0;
X	disp_msg(cpINFO,"");
X	if(!initial)
X	{
X		(void)memcpy((char *)oldprocs,(char *)procs,
X			v.v_proc * sizeof(struct proc));
X		noldprocs = nprocs;
X		(void)memcpy((char *)poldprocs,(char *)pprocs,
X			noldprocs * sizeof(struct proc *));
X	}
X
X/* read current procs */
X	grok_proc();
X
X/* if slot not in use, force to end when sorting */
X	nprocs = 0;
X	for(iproc = 0; iproc < v.v_proc; iproc++)
X	{
X		tproc = pprocs[iproc];
X		if(	(tproc->p_stat == 0) ||		/* if slot not in use, ... */
X			(tproc->p_pid == 1)  ||		/* ... or proc is init, ... */
X			(tproc->p_flag & SSYS))		/* ... or proc is system process */
X		{							/* eliminate from consideration */
X			tproc->p_pid = 32767;	/* force below selected procs in qsort */
X			continue;
X		}
X		nprocs++;
X	}
X
X/* if too many procs, whittle zombies */
X	if(nprocs > max_procs_to_display)
X	{
X		nprocs = 0;
X		omitted_one = 0;
X		for(iproc = 0; iproc < v.v_proc; iproc++)
X		{
X			tproc = pprocs[iproc];
X			if(tproc->p_pid == 32767)	/* previously eliminated? */
X				continue;
X			else if(tproc->p_stat == SZOMB)
X			{
X				tproc->p_pid = 32767;
X				omitted_one = 1;
X				continue;
X			}
X			nprocs++;
X		}
X		if(omitted_one)
X		{
X			if(omitted[0])
X				strcat(omitted,"/");
X			strcat(omitted,"zombie");
X		}
X	}
X
X/* if still too many procs, whittle shells and gettys */
SHAR_EOF
echo "End of  part 2"
echo "File det_proc.c is continued in part 3"
echo "3" > shar3_seq_.tmp
exit 0
Newsgroups: biz.sco.sources