Xref: utzoo unix-pc.sources:301 comp.sys.att:6275 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!indri!nic.MR.NET!shamash!sialis!icus!lenny From: lenny@icus.islp.ny.us (Lenny Tropiano) Newsgroups: unix-pc.sources,comp.sys.att Subject: ncblocks daemon (a debugging tool for clist problem on UNIX pc/3B1) Keywords: clists, free, bug, debugging, daemon Message-ID: <691@icus.islp.ny.us> Date: 29 Apr 89 23:41:41 GMT Organization: ICUS Software Systems, Islip, New York Lines: 238 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@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 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@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 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@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 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@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 X#include X#include X#include X#include 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