ncblocks daemon (a debugging tool for clist problem on UNIX pc/3B1)

Lenny Tropiano lenny at icus.islp.ny.us
Sun Apr 30 09:41:41 AEST 1989


This program is a diagnostic tool used to see if clist cblocks are being 
deallocated properly.  In the a few of the releases of the kernel there is 
a problem where clists aren't properly freed.  The problem is currently 
being researched by AT&T, and I would be interested in seeing if this 
happens on all releases of the kernel.  If you have a lot of I/O traffic       
through your machine (specifically if you use a TB+), run this daemon on 
your machine and mail the logfile to:

		clists-problem at icus.islp.ny.us -or-                 
		...uunet!hombre!icus!clists-problem                    

if you notice any decrease in cblocks over a period of uptime on your 3B1.  
Also mail the uptime, specific configuration of your machine (eg. OS version, 
3B1, 7300, memory, NCLIST tunable setting, EIA/ports and configuration, 
HDB or stock uucp, as well as, modem types, port speeds, amount of traffic 
you receive on those ports and any other pertinant information in debugging 
this problem.  This will hopefully expedite any new FIXDISKS (ie. FIXDISK 2.0) 
in the future.      

-- cut here -- -- cut here -- -- cut here -- -- cut here -- -- cut here --
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  Makefile README ncblocks.c
# Wrapped by lenny at icus on Sat Apr 29 19:39:55 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f Makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Makefile\"
else
echo shar: Extracting \"Makefile\" \(751 characters\)
sed "s/^X//" >Makefile <<'END_OF_Makefile'
X#
X# Makefile to compile ncblocks.c  (Number of cblocks daemon)
X# By Lenny Tropiano
X# (c)1989 ICUS Software Systems  UUCP: ...icus!lenny -or- lenny at icus.islp.ny.us
X#
XCFLAGS=-v -O -DLOGFILE=\"/usr/adm/cblocks.log\" -DSLEEPTIME=15
XLDFLAGS=-s
XLIBS=/lib/crt0s.o /lib/shlib.ifile
XDEST=/etc/daemons/
X#
Xncblocks:  ncblocks.o
X	@echo "Loading ..."
X	$(LD) $(LDFLAGS) -o ncblocks ncblocks.o $(LIBS) 
X#
Xncblocks.o:
X	$(CC) $(CFLAGS) -c ncblocks.c
X#
X# You need to be super-user to do this.
X#
X/etc/daemons:
X	mkdir /etc/daemons
X	chmod 755 /etc/daemons
X#
Xinstall: ncblocks /etc/daemons
X	cp ncblocks /etc/daemons/
X	chown root /etc/daemons/ncblocks
X	chgrp bin  /etc/daemons/ncblocks
X	chmod 4500 /etc/daemons/ncblocks
X	@echo "clist daemon started."
X	/etc/daemons/ncblocks
END_OF_Makefile
if test 751 -ne `wc -c <Makefile`; then
    echo shar: \"Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(1084 characters\)
sed "s/^X//" >README <<'END_OF_README'
XThis program is a diagnostic tool used to see if clist cblocks are being 
Xdeallocated properly.  In the a few of the releases of the kernel there is 
Xa problem where clists aren't properly freed.  The problem is currently 
Xbeing researched by AT&T, and I would be interested in seeing if this 
Xhappens on all releases of the kernel.  If you have a lot of I/O traffic       
Xthrough your machine (specifically if you use a TB+), run this daemon on 
Xyour machine and mail the logfile to:
X
X		clists-problem at icus.islp.ny.us -or-                 
X		...uunet!hombre!icus!clists-problem                    
X
Xif you notice any decrease in cblocks over a period of uptime on your 3B1.  
XAlso mail the uptime, specific configuration of your machine (eg. OS version, 
X3B1, 7300, memory, NCLIST tunable setting, EIA/ports and configuration, 
XHDB or stock uucp, as well as, modem types, port speeds, amount of traffic 
Xyou receive on those ports and any other pertinant information in debugging 
Xthis problem.  This will hopefully expedite any new FIXDISKS (ie. FIXDISK 2.0) 
Xin the future.      
END_OF_README
if test 1084 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f ncblocks.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"ncblocks.c\"
else
echo shar: Extracting \"ncblocks.c\" \(3763 characters\)
sed "s/^X//" >ncblocks.c <<'END_OF_ncblocks.c'
X/************************************************************************\
X**                                                                      **
X** Program name: ncblocks.c (Number of cblocks daemon)                  **
X** Programmer:   Lenny Tropiano            UUCP: ...icus!lenny          **
X** Organization: ICUS Software Systems     (c)1989                      **
X** Date:         April 3, 1989                                          **
X**                                                                      **
X**************************************************************************
X**                                                                      **
X** Program use:  This program is a diagnostic tool used to see if clist **
X**               cblocks are being deallocated properly.  In the        **
X**               a few of the releases of the kernel there is a problem **
X**               where clists aren't properly freed.  The problem is    **
X**               currently being researched by AT&T, and I would be     **
X**               interested in seeing if this happens on all releases   **
X**               of the kernel.  If you have a lot of I/O traffic       **
X**               through your machine (specifically if you use a TB+),  **
X**               run this daemon on your machine and mail the logfile   **
X**               to clists-problem at icus.islp.ny.us -or-                 **
X**               ...uunet!hombre!icus!clists-problem                    **
X**               if you notice any decrease in cblocks over a period    **
X**               of uptime on your 3B1.  Also mail the uptime, specific **
X**               configuration of your machine (eg. OS version, 3B1,    **
X**               7300, memory, NCLIST tunable setting, EIA/ports and    **
X**               configuration, HDB or stock uucp, as well as, modem    **
X**               types, port speeds, amount of traffic you receive on   **
X**               those ports and any other pertinant information in     **
X**               debugging this problem.  This will hopefully expedite  **
X**               any new FIXDISKS (ie. FIXDISK 2.0) in the future.      **
X**                                                                      **
X\************************************************************************/
X
X#include <stdio.h>
X#include <sys/types.h>
X#include <nlist.h>
X#include <fcntl.h>
X#include <signal.h>
X
X#ifndef TRUE
X#define TRUE	1
X#endif
X
X#define UNIX	"/unix"
X#define KMEM	"/dev/kmem"
X
X#ifndef SLEEPTIME
X#define	SLEEPTIME	15		/* sleep time in minutes */
X#endif
X
X#ifndef LOGFILE
X#define	LOGFILE	"/usr/adm/cblocks.log"
X#endif
X
Xint    kmemfd;
XFILE   *logfp;
Xlong   timeclock;
X
Xstruct nlist unixsym[] = {
X#define X_CFREELIST	0
X	{ "cfreelist" },
X	{ NULL }
X};
X
Xmain()
X{
X	ushort cblocks;
X	char   *ctime();
X	int    sigtrap();
X
X	if (fork() != 0)
X		exit(0);
X
X	signal(SIGHUP, SIG_IGN);	
X 	signal(SIGINT, SIG_IGN);
X	signal(SIGTERM, sigtrap);
X
X	close(0);	/* stdin */
X	close(1);	/* stdout */
X	close(2);	/* stderr */
X
X	setpgrp(0);
X
X	if (nlist(UNIX, unixsym) < 0) {
X		fprintf(stderr, "%s: no namelist.\n", UNIX);
X		exit(1);
X	}
X
X	if ((kmemfd = open(KMEM, O_RDONLY)) < 0) {
X		perror(KMEM);
X		exit(1);
X	}
X
X	if ((logfp = fopen(LOGFILE, "a")) == NULL) {
X		perror(LOGFILE);
X		exit(1);
X	}
X
X	time(&timeclock);
X	fprintf(logfp,"Started at %s", ctime(&timeclock));
X	while (TRUE) {
X		lseek(kmemfd, (long) unixsym[X_CFREELIST].n_value+0x6, 0);
X		read(kmemfd, (char *) &cblocks, sizeof(ushort));
X		time(&timeclock);
X		fprintf(logfp,"%-24.24s cblocks = %d\n", 
X			ctime(&timeclock),
X			cblocks);
X		fflush(logfp);
X		sleep(SLEEPTIME * 60);
X	}
X}
X
X
Xsigtrap()
X{
X	time(&timeclock);
X	fprintf(logfp,"Ended at %s", ctime(&timeclock));
X	fclose(logfp);
X	close(kmemfd);
X	exit(0);
X}
END_OF_ncblocks.c
if test 3763 -ne `wc -c <ncblocks.c`; then
    echo shar: \"ncblocks.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 582-5525
lenny at icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny  attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752



More information about the Comp.sys.att mailing list