wht@gatech.edu@n4hgf.UUCP (Warren Tucker) (07/03/90)
Posting-number: Volume 13, Issue 99 Submitted-by: wht@gatech.edu@n4hgf.UUCP (Warren Tucker) Archive-name: u386mon/part01 This is u386mon, a "performance" monitor for SCO UNIX V/386. Thanks to peter@radig.de (Peter Radig), dug@kd4nc (Doug Drye) and jdc@uudell.dell.com (Jeremy Chatfield), it also works with ISC 386/ix. It may work with other UNIX systems with a little work. It requires terminfo style curses and will use color if you have it. It works best with a 43 line (or greater) screen, but will work with a 25 line screen with some limitations. It has been tested with 25 and 43 line screens on the multiscreen console and on a Wyse 60 (under SCO, using terminfo wy60, yielding interesting "color" mappings). This little light show has already helped me diagnose the traditional "stop-the-world-and-beat-disk-continually-for-15-seconds" problem as memory exhaustion. It has also been a good learning experience. It has been tested extensively on SCO Unix. I know of no bugs on ISC 386/ix, but I don't have root access on a 386/ix system, so have limited test experience there. Thanks for all the reports and suggestions, guys. Here is the latest and greatest. Check out the renice. #!/bin/sh # This is u386mon.1.10, a shell archive (shar 3.30) # made 06/27/1990 06:01 UTC by wht@n4hgf # Source directory /u1/src/u386mon # # existing files WILL be overwritten # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 13194 -rw-r--r-- README # 7573 -rw-r--r-- Makefile.sco # 7654 -rw-r--r-- Makefile.isc # 5036 -rw-r--r-- bootinfo.c # 7070 -rw-r--r-- detail.c # 16615 -rw-r--r-- det_proc.c # 12386 -rw-r--r-- det_sio.c # 4936 -rw-r--r-- disputil.c # 2780 -rw-r--r-- libkmem.c # 2778 -rw-r--r-- libmem.c # 1964 -rw-r--r-- libswap.c # 2706 -rw-r--r-- libnlsym.c # 2933 -rw-r--r-- nlsym.c # 3411 -rw-r--r-- proc.c # 1941 -rw-r--r-- tune.c # 28919 -rw-r--r-- u386mon.c # 2079 -rw-r--r-- var.c # 859 -rw-r--r-- libkmem.h # 855 -rw-r--r-- libmem.h # 780 -rw-r--r-- libswap.h # 826 -rw-r--r-- libnlsym.h # 6985 -rw-r--r-- lint_args.h # 5457 -rw-r--r-- nlsym.h # 3211 -rw-r--r-- u386mon.h # 1186 -rw-r--r-- renice/Makefile # 4189 -rw-r--r-- renice/renice.c # if touch 2>&1 | fgrep 'mmdd' > /dev/null then TOUCH=touch else TOUCH=true fi # ============= README ============== echo "x - extracting README (Text)" sed 's/^X//' << 'SHAR_EOF' > README && Xu386mon README - last updated Tue Jun 26 16:29:46 EDT 1990 X XThis is u386mon, a "performance" monitor for SCO UNIX V/386. Thanks to Xpeter@radig.de (Peter Radig), dug@kd4nc (Doug Drye) and jdc@uudell.dell.com X(Jeremy Chatfield), it also works with ISC 386/ix. It may work with other XUNIX systems with a little work. It requires terminfo style curses and will Xuse color if you have it. It works best with a 43 line (or greater) screen, Xbut will work with a 25 line screen with some limitations. It has been tested Xwith 25 and 43 line screens on the multiscreen console and on a Wyse 60 (under XSCO, using terminfo wy60, yielding interesting "color" mappings). X XThis little light show has already helped me diagnose the traditional X"stop-the-world-and-beat-disk-continually-for-15-seconds" problem as Xmemory exhaustion. It has also been a good learning experience. X XRead through this and you will finally reach "How to get going" below. X XSample output X============= X(with 43-line screen; a 25 line screen will be missing Var/Bootinfo/Tune/Proc Xon the 'main' display) X X u386mon 1.05 n4hgf - i386 3.2 18:24:15 wht@n4hgf X---- CPU --- tot usr ker brk --------------------------------------------------- X Instant % 24 12 12 0 uuuuuukkkkkk X 5 Sec Avg % 27 13 14 0 uuuuuukkkkkkk X10 Sec Avg % 22 12 10 0 uuuuuukkkkk X---- Wait -- tot io swp pio -- (% of real time) ------------------------------- X Instant % 0 0 0 0 X 5 Sec Avg % 0 0 0 0 X10 Sec Avg % 0 0 0 0 X---- Sysinfo/Minfo --- (last 1 second activity) -------------------------------- Xbread 0 rawch 1 pswitch 6 vfault 0 unmodsw 0 Xbwrite 0 canch 0 syscall 167 demand 0 unmodfl 0 Xlread 23 outch 1822 sysread 85 pfault 0 psoutok 0 Xlwrite 0 syswrit 6 cw 0 psinfai 0 Xswapin 0 msg 0 sysfork 0 steal 0 psinok 0 Xswapout 0 sema 0 sysexec 0 frdpgs 0 rsout 0 Xbswapin 0 vfpg 0 rsin 0 Xbswapout 0 maxmem 5716k runque 0 sfpg 0 Xiget 2 frmem 2260k runocc 0 vspg 0 pages on Xnamei 1 mem used 61% swpque 0 sspg 0 swap 0 Xdirblk 2 nswap 10000k swpocc 0 pnpfault 0 cache 0 Xreadch 34944 frswp 9912k wrtfault 0 file 0 Xwritch 2078 swp used 1% X X X X-- Var --------- -- Bootinfo ---------- -- Tune --------- -- Proc --- Xv_autoup 10 basemem 640k t_ageintvl 9 sleep 24 Xv_buf 600 extmem 6144k t_bdflushr 1 run 0 Xv_clist 200 bflags 00000000 t_gpgshi 40 zombie 3 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 28 Xv_mount 5 00000000 00004000 RSVD t_minarmem 25 in mem 28 Xv_pbuf 20 006b9000 00038000 KBSS t_minasmem 25 Xv_proc 100 006f1000 0000f000 KDTA Xv_region 210 00fa5000 0005b000 KTXT Xv_vhndfrac 16 X XThe main display X================ X XA brief description of reported information: X X1. The CPU utilization is shown with smoothing of 1 ("instant"), X 5 and 10 seconds. Total CPU usage is shown, with user, kernel X and "break" subdivided. Most performance utilities (vmstat) X lump kernel (CPU_KERNEL) and wait (CPU_WAIT) times together X as kernel time. u386mon considers CPU_WAIT time as idle (the X CPU could have been doing something if an otherwise ready process X 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 1 ("instant"), 5 and 10 second smoothed X percentages of real time no process could be run because otherwise X ready to run processes were waiting on logical, swap or physical I/O. X X On a color display, total wait time is displayed in green if it is X below 30%, yellow if utilization is between 30% and 49% and red if X 50% or above. X X3. Sysinfo/Minfo display shows, generally, the number of events for a X measured value since the last display update. For example, runque X shows the number of times a process was placed on the run queue. X An exception is the memory and swap space fields: These numbers X reflect absolute current utilization. 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 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 X values. Continued INEXACT indication suggests the 5 and 10 X second smoothed values are also wrong. X X An "INVALID" indication means u386mon was not scheduled for 4 X seconds or more; all dynamic values are suspect. X 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 X7. 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 X8. The ISC bootinfo field will have different information due to X different porting by ISC and SCO. X X9. The 'e' command accesses the Var/Bootinfo/Tune/Proc display, X overlaying the Sysinfo/Minfo display. 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. sleeping processes X X If there is still insufficient room, an indication to the effect X is displayed (tough cookies). X 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 Makefile.sco or Makefile.isc to Makefile, depending on X your system. 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 X3. make all. 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 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. 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 X8. If you are getting 4 as the size of most or all processes, X try adding -DUTIME_FIXED. SCO 3.2.0 had this info in the X struct user fields u_tsize, u_dsize, u_ssize wrong, IMHO, X and fixed it in ODT/3.2.1. See det_proc.c for more detail. X Your port may/WILL vary. X X9. The renice program by Ford Ditto, from which the kmem routines X came, with this release. 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 XComments are appreciated, especially bug fixes and information Xhelping to port the program to another 386 S5R3.2 system. X XWarren Tucker N4HGF Xemory!n4hgf!wht -or- wht%n4hgf.uucp@emory.mathcs.emory.edu SHAR_EOF $TOUCH -am 0626163190 README && chmod 0644 README || echo "restore of README failed" set `wc -c README`;Wc_c=$1 if test "$Wc_c" != "13194"; then echo original size 13194, current size $Wc_c fi # ============= Makefile.sco ============== echo "x - extracting Makefile.sco (Text)" sed 's/^X//' << 'SHAR_EOF' > Makefile.sco && X#+------------------------------------------------------------------- X# Makefile for u386mon for SCO UNIX V/386 X# ...!emory!n4hgf!wht X#-------------------------------------------------------------------- X#+:EDITS:*/ 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 XCFLAGS = -c -Octl -DLINT_ARGS X#CFLAGS = -c -O X X#------------> LIB XLIB = -lpanel -ltinfo -lx X#LIB = -lpanel -lcurses -lx X X#------------> KMEMGRP XKMEMGRP = mem X#KMEMGRP = sys X X#------------> BINDIR XBINDIR = /usr/local/bin X XLDFLAGS = -s X XVERSION = 1.10 X X#handle Sys V make "feature" of using SHELL XSHELL = /bin/sh X X#FCRC = fcrc -u $*.c ; X.c.o:; $(FCRC) $(CC) $(CFLAGS) $*.c X XSRC = \ X bootinfo.c\ X detail.c\ X det_proc.c\ X det_sio.c\ X disputil.c\ X libkmem.c\ X libmem.c\ X libswap.c\ X libnlsym.c\ X nlsym.c\ X proc.c\ X tune.c\ X u386mon.c\ X var.c X XHDR = \ X libkmem.h\ X libmem.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 bootinfo.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 Makefile.sco\ X Makefile.isc\ X $(SRC)\ X $(HDR)\ X renice/Makefile\ X renice/renice.c X Xall: nlsym u386mon X X#must run as root Xinstall: all X cp nlsym $(BINDIR) X chown bin $(BINDIR)/nlsym X chgrp bin $(BINDIR)/nlsym X chmod 711 $(BINDIR)/nlsym X mv u386mon $(BINDIR) X chown bin $(BINDIR)/u386mon X chgrp $(KMEMGRP) $(BINDIR)/u386mon X chmod 2711 $(BINDIR)/u386mon X 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 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.* 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 $(VERSION).sh $(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 '/^# 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 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 Makefile.bak X mv Makefile.new Makefile X X# DO NOT DELETE THIS LINE Xbootinfo.o: /usr/include/curses.h Xbootinfo.o: /usr/include/panel.h Xbootinfo.o: /usr/include/sys/types.h Xbootinfo.o: /usr/include/sys/bootinfo.h Xbootinfo.o: u386mon.h Xdetail.o: /usr/include/curses.h Xdetail.o: /usr/include/panel.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/ascii.h Xdetail.o: /usr/include/sys/param.h Xdetail.o: /usr/include/sys/bootinfo.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: /usr/include/curses.h Xdet_proc.o: /usr/include/panel.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/ascii.h Xdet_proc.o: /usr/include/sys/param.h Xdet_proc.o: /usr/include/sys/bootinfo.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 Xdisputil.o: /usr/include/curses.h Xdisputil.o: /usr/include/panel.h Xdisputil.o: /usr/include/sys/types.h Xdisputil.o: u386mon.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 Xlibswap.o: /usr/include/sys/types.h Xlibswap.o: /usr/include/fcntl.h Xlibswap.o: libswap.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: /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: /usr/include/curses.h Xproc.o: /usr/include/panel.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: /usr/include/curses.h Xtune.o: /usr/include/panel.h Xtune.o: /usr/include/sys/types.h Xtune.o: /usr/include/sys/tuneable.h Xtune.o: u386mon.h Xu386mon.o: /usr/include/curses.h Xu386mon.o: /usr/include/panel.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/ascii.h Xu386mon.o: /usr/include/sys/param.h Xu386mon.o: /usr/include/sys/bootinfo.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: nlsym.h Xu386mon.o: libkmem.h Xu386mon.o: libmem.h Xu386mon.o: libswap.h Xu386mon.o: libnlsym.h Xu386mon.o: u386mon.h Xvar.o: /usr/include/curses.h Xvar.o: /usr/include/panel.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 $TOUCH -am 0627015790 Makefile.sco && chmod 0644 Makefile.sco || echo "restore of Makefile.sco failed" set `wc -c Makefile.sco`;Wc_c=$1 if test "$Wc_c" != "7573"; then echo original size 7573, current size $Wc_c fi # ============= Makefile.isc ============== echo "x - extracting Makefile.isc (Text)" sed 's/^X//' << 'SHAR_EOF' > Makefile.isc && X#+------------------------------------------------------------------- X# Makefile for u386mon for ISC 386/ix X# ...!emory!n4hgf!wht X#-------------------------------------------------------------------- X#+:EDITS:*/ 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-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de 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 X#CFLAGS = -c -Octl -DLINT_ARGS XCFLAGS = -c -O X X#------------> LIB X#LIB = -lpanel -ltinfo -lx XLIB = -lpanel -lcurses -lx X X#------------> KMEMGRP X#KMEMGRP = mem XKMEMGRP = sys X X#------------> BINDIR XBINDIR = /usr/local/bin X XLDFLAGS = -s X XVERSION = 1.10 X X#handle Sys V make "feature" of using SHELL XSHELL = /bin/sh X X#FCRC = fcrc -u $*.c ; X.c.o:; $(FCRC) $(CC) $(CFLAGS) $*.c X XSRC = \ X bootinfo.c\ X detail.c\ X det_proc.c\ X det_sio.c\ X disputil.c\ X libkmem.c\ X libmem.c\ X libswap.c\ X libnlsym.c\ X nlsym.c\ X proc.c\ X tune.c\ X u386mon.c\ X var.c X XHDR = \ X libkmem.h\ X libmem.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 bootinfo.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 Makefile.sco\ X Makefile.isc\ X $(SRC)\ X $(HDR)\ X renice/Makefile\ X renice/renice.c X Xall: nlsym u386mon X X#must run as root Xinstall: all X cp nlsym $(BINDIR) X chown bin $(BINDIR)/nlsym X chgrp bin $(BINDIR)/nlsym X chmod 711 $(BINDIR)/nlsym X mv u386mon $(BINDIR) X chown bin $(BINDIR)/u386mon X chgrp $(KMEMGRP) $(BINDIR)/u386mon X chmod 2711 $(BINDIR)/u386mon X chmod g+r /dev/swap X 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 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.* 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 $(VERSION).sh $(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 '/^# 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 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 Makefile.bak X mv Makefile.new Makefile X X# DO NOT DELETE THIS LINE Xbootinfo.o: /usr/include/curses.h Xbootinfo.o: /usr/include/panel.h Xbootinfo.o: /usr/include/sys/types.h Xbootinfo.o: /usr/include/sys/bootinfo.h Xbootinfo.o: u386mon.h Xdetail.o: /usr/include/curses.h Xdetail.o: /usr/include/panel.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/ascii.h Xdetail.o: /usr/include/sys/param.h Xdetail.o: /usr/include/sys/bootinfo.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: /usr/include/curses.h Xdet_proc.o: /usr/include/panel.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/ascii.h Xdet_proc.o: /usr/include/sys/param.h Xdet_proc.o: /usr/include/sys/bootinfo.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 Xdisputil.o: /usr/include/curses.h Xdisputil.o: /usr/include/panel.h Xdisputil.o: /usr/include/sys/types.h Xdisputil.o: u386mon.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 Xlibswap.o: /usr/include/sys/types.h Xlibswap.o: /usr/include/fcntl.h Xlibswap.o: libswap.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: /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: /usr/include/curses.h Xproc.o: /usr/include/panel.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: /usr/include/curses.h Xtune.o: /usr/include/panel.h Xtune.o: /usr/include/sys/types.h Xtune.o: /usr/include/sys/tuneable.h Xtune.o: u386mon.h Xu386mon.o: /usr/include/curses.h Xu386mon.o: /usr/include/panel.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/ascii.h Xu386mon.o: /usr/include/sys/param.h Xu386mon.o: /usr/include/sys/bootinfo.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: nlsym.h Xu386mon.o: libkmem.h Xu386mon.o: libmem.h Xu386mon.o: libswap.h Xu386mon.o: libnlsym.h Xu386mon.o: u386mon.h Xvar.o: /usr/include/curses.h Xvar.o: /usr/include/panel.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 $TOUCH -am 0627015790 Makefile.isc && chmod 0644 Makefile.isc || echo "restore of Makefile.isc failed" set `wc -c Makefile.isc`;Wc_c=$1 if test "$Wc_c" != "7654"; then echo original size 7654, current size $Wc_c fi # ============= 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 X--------------------------------------------------------------------------*/ X/*+:EDITS:*/ 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#define M_TERMINFO X X#include <curses.h> X#include <panel.h> 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{ X#ifdef B_MEM_DOWN X flags &= ~B_MEM_DOWN; X#endif X if(!flags) X return(" "); X switch(flags) X { X#ifdef B_MEM_RSRVD X case B_MEM_RSRVD: return("RSVD"); X#endif X#ifdef B_MEM_KBSS X case B_MEM_KBSS: return("KBSS"); X#endif X#ifdef B_MEM_KTEXT X case B_MEM_KTEXT: return("KTXT"); X#endif X#ifdef B_MEM_KDATA X case B_MEM_KDATA: return("KDTA"); X#endif X#ifdef B_MEM_NODMA X case B_MEM_NODMA: return("NODM"); X#endif X#ifdef B_MEM_CANTDMA X case B_MEM_CANTDMA: return("NODM"); X#endif X } X return("????"); X} /* end of bmemf_text */ X X/*+------------------------------------------------------------------------- X ISC_machinetype_text(machine) X--------------------------------------------------------------------------*/ X#ifdef ME_COMPAQVGA /* ISC machdep.h */ Xchar * XISC_machinetype_text(machine) Xunsigned char machine; X{ X X switch(machine) X { X case M_UNKNOWN: X return(""); X break; X case M_COMPAQ: X return("Compaq"); X break; X case M_PS2: X return("PS/2"); X break; X case M_AT: X return("Generic 386"); X break; X case M_ATT: X case M_ATT5: X return("AT&T 6386"); X break; X case M_M380: X return("Olivetti M380"); X break; X case M_DELL: X return("Dell 386"); X break; X case M_D325: X return("Dell 325"); X break; X case M_ALR: X return("Adv Logic Res"); X break; X case M_ZDS: X return("Zenith Data"); X break; X } X return("??"); X} /* end of ISC_machinetype_text */ X#endif X X/*+------------------------------------------------------------------------- X ISC_displaytype_text(adapter) X--------------------------------------------------------------------------*/ X#ifdef 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"); 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 } 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#ifdef 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#ifdef 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#ifdef 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#ifdef 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/* vi: set tabstop=4 shiftwidth=4: */ X/* end of bootinfo.c */ SHAR_EOF $TOUCH -am 0627015790 bootinfo.c && chmod 0644 bootinfo.c || echo "restore of bootinfo.c failed" set `wc -c bootinfo.c`;Wc_c=$1 if test "$Wc_c" != "5036"; then echo original size 5036, current size $Wc_c fi # ============= detail.c ============== echo "x - extracting detail.c (Text)" sed 's/^X//' << 'SHAR_EOF' > detail.c && X/*+------------------------------------------------------------------------- X detail.c - UNIX 386 system monitor detail window X X Defined functions: X detail_init() X detail_panel_cmd(cmd) X detail_panel_update() X detpanel_destroy() X detpanel_extra_init() X detpanel_extra_update() X detpanel_ps_init(full43) X detpanel_ps_update() X X--------------------------------------------------------------------------*/ X/*+:EDITS:*/ X/*:06-27-1990-01:57-wht@n4hgf-1.10 - incorporate suggestions from alpha testers */ X/*:06-25-1990-17:34-wht@n4hgf-add detail extra for 25 line tubes */ 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/*:06-15-1990-18:32-wht@n4hgf-creation */ X X#define M_TERMINFO X X#include <curses.h> X#include <panel.h> 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/utsname.h> X#include <sys/stat.h> X#include <sys/ascii.h> X#undef NGROUPS_MAX X#undef NULL X#include <sys/param.h> X#include <sys/bootinfo.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#include <sys/proc.h> X#include <sys/var.h> X X#include "nlsym.h" X#include "libkmem.h" X#include "libnlsym.h" X#include "u386mon.h" X X#define DPT_NONE 0 X#define DPT_PS 1 X#define DPT_PS_LONG 2 X#define DPT_EXTRA 3 X#define DPT_SIO 4 X XPANEL *mkpanel(); X Xextern PANEL *pscr; Xextern WINDOW *wscr; X XPANEL *pdet; XWINDOW *wdet = (WINDOW *)0; Xu_char detpanel_type = DPT_NONE; Xint detpanel_length; Xint detpanel_cols; X X/*+------------------------------------------------------------------------- X detpanel_ps_init(full43) X--------------------------------------------------------------------------*/ Xvoid Xdetpanel_ps_init(full43) Xint full43; X{ X/* X#define DETAIL_PS_COLS ((LINES >= 43) ? EXTRA4_TLX - 1 : PER_SEC4_TLX) Xdetpanel_cols = DETAIL_PS_COLS; X*/ X X#define DETAIL_PS_TLY ((LINES >= 43) ? ((full43)?PER_SEC_TLY:PER_SEC_TLY+14)\ X : PER_SEC_TLY) X X#define DETAIL_PS_LENGTH (MSG_TLY - DETAIL_PS_TLY) X X detpanel_length = DETAIL_PS_LENGTH; X detpanel_cols = COLS; X if(!(pdet = mkpanel(detpanel_length,detpanel_cols,DETAIL_PS_TLY,0))) X { X leave_text("cannot make detail panel",1); X } X show_panel(pdet); X top_panel(pdet); X wdet = panel_window(pdet); X display_proc_stats(wdet,1); X X} /* end of detpanel_ps_init */ X X/*+------------------------------------------------------------------------- X detpanel_ps_update() X--------------------------------------------------------------------------*/ Xvoid Xdetpanel_ps_update() X{ X display_proc_stats(wdet,0); X} /* end of detpanel_ps_update */ X X/*+------------------------------------------------------------------------- X detpanel_extra_init() X--------------------------------------------------------------------------*/ Xvoid Xdetpanel_extra_init() X{ X#define DETAIL_EXTRA_TLY PER_SEC_TLY X#define DETAIL_EXTRA_LENGTH (MSG_TLY - DETAIL_EXTRA_TLY) X X detpanel_length = DETAIL_EXTRA_LENGTH; X detpanel_cols = COLS; X if(!(pdet = mkpanel(detpanel_length,detpanel_cols,DETAIL_EXTRA_TLY,0))) X { X leave_text("cannot make detail panel",1); X } X show_panel(pdet); X top_panel(pdet); X wdet = panel_window(pdet); X display_var(wdet,0,EXTRA1_TLX); X display_bootinfo(wdet,0,EXTRA2_TLX); X display_tune(wdet,0,EXTRA3_TLX); X display_proc(wdet,0,EXTRA4_TLX); X X} /* end of detpanel_extra_init */ X X/*+------------------------------------------------------------------------- X detpanel_extra_update() X--------------------------------------------------------------------------*/ Xvoid Xdetpanel_extra_update() X{ X display_proc(wdet,0,EXTRA4_TLX); X} /* end of detpanel_extra_update */ X X/*+------------------------------------------------------------------------- X detpanel_sio_init() X--------------------------------------------------------------------------*/ X#ifdef M_UNIX Xvoid Xdetpanel_sio_init() X{ X#define DETAIL_SIO_TLY ((LINES >= 43) ? (PER_SEC_TLY+14) : PER_SEC_TLY) X#define DETAIL_SIO_LENGTH (MSG_TLY - DETAIL_SIO_TLY) X X detpanel_length = DETAIL_SIO_LENGTH; X detpanel_cols = COLS; X if(!(pdet = mkpanel(detpanel_length,detpanel_cols,DETAIL_SIO_TLY,0))) X { X leave_text("cannot make detail panel",1); X } X show_panel(pdet); X top_panel(pdet); X wdet = panel_window(pdet); X display_sio_summary(wdet,1); X} /* end of detpanel_sio_init */ X#endif X X/*+------------------------------------------------------------------------- X detpanel_sio_update() X--------------------------------------------------------------------------*/ X#ifdef M_UNIX Xvoid Xdetpanel_sio_update() X{ X display_sio_summary(wdet,0); X} /* end of detpanel_sio_update */ X#endif X X/*+------------------------------------------------------------------------- X detpanel_destroy() X--------------------------------------------------------------------------*/ Xvoid Xdetpanel_destroy() X{ X hide_panel(pdet); X delwin(wdet); X wdet = (WINDOW *)0; X del_panel(pdet); X top_panel(pscr); X disp_msg(cpINFO,""); X detpanel_type = DPT_NONE; X} /* end of detpanel_destroy */ X X/*+------------------------------------------------------------------------- X detail_panel_cmd(cmd) X X command: m main screen X p proc status X--------------------------------------------------------------------------*/ Xvoid Xdetail_panel_cmd(cmd) Xchtype cmd; X{ X switch(cmd) X { X case 'm': X if(detpanel_type != DPT_NONE) X detpanel_destroy(); X break; X X case 'P': X if(detpanel_type == DPT_PS_LONG) X break; X if(detpanel_type != DPT_NONE) X detpanel_destroy(); X detpanel_ps_init(1); X detpanel_type = DPT_PS_LONG; X break; X X case 'p': X if(detpanel_type == DPT_PS) X break; X if(detpanel_type != DPT_NONE) X detpanel_destroy(); X detpanel_ps_init(0); X detpanel_type = DPT_PS; X break; X X case 'e': X if(LINES >= 43) X break; X if(detpanel_type == DPT_EXTRA) X break; X if(detpanel_type != DPT_NONE) X detpanel_destroy(); X detpanel_extra_init(); X detpanel_type = DPT_EXTRA; X break; X X#ifdef M_UNIX X case 's': X if(detpanel_type == DPT_SIO) X break; X if(detpanel_type != DPT_NONE) X detpanel_destroy(); X detpanel_sio_init(); X detpanel_type = DPT_SIO; X break; X#endif X X } X} /* end of detail_panel_cmd */ X X/*+------------------------------------------------------------------------- X detail_panel_update() X--------------------------------------------------------------------------*/ Xvoid Xdetail_panel_update() X{ X switch(detpanel_type) X { X case DPT_PS: X case DPT_PS_LONG: X detpanel_ps_update(); X break; X case DPT_EXTRA: X detpanel_extra_update(); X break; X#ifdef M_UNIX X case DPT_SIO: X detpanel_sio_update(); X break; X#endif X } X} /* end of detail_panel_update */ X X/*+------------------------------------------------------------------------- X detail_init() X--------------------------------------------------------------------------*/ Xvoid Xdetail_init() X{ X} /* end of detail_init */ X X/* vi: set tabstop=4 shiftwidth=4: */ X/* end of detail.c */ SHAR_EOF $TOUCH -am 0627015790 detail.c && chmod 0644 detail.c || echo "restore of detail.c failed" set `wc -c detail.c`;Wc_c=$1 if test "$Wc_c" != "7070"; then echo original size 7070, current size $Wc_c fi echo "End of part 1, continue with part 2" exit 0