From owner-freebsd-hackers Sun Nov 25 3:28:40 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from straylight.ringlet.net (discworld.nanolink.com [217.75.135.248]) by hub.freebsd.org (Postfix) with SMTP id 704AB37B417 for ; Sun, 25 Nov 2001 03:28:28 -0800 (PST) Received: (qmail 1377 invoked by uid 1000); 25 Nov 2001 11:27:49 -0000 Date: Sun, 25 Nov 2001 13:27:49 +0200 From: Peter Pentchev To: Dima Dorfman Cc: Peter Wemm , Bruce Evans , hackers@freebsd.org Subject: Re: Reducing syslogd output bloat (was: cvs commit: src/sys/conf Makefile.i386) Message-ID: <20011125132748.A522@straylight.oblivion.bg> Mail-Followup-To: Dima Dorfman , Peter Wemm , Bruce Evans , hackers@freebsd.org References: <20011021183958.24ABB3803@overcee.netplex.com.au> <20011125004921.93AD54020@bazooka.trit.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011125004921.93AD54020@bazooka.trit.org>; from dima@trit.org on Sun, Nov 25, 2001 at 12:49:16AM +0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Nov 25, 2001 at 12:49:16AM +0000, Dima Dorfman wrote: > The attached patch implements something like this: > > Make the default kernel prefix "kernel:" instead of the boot file, > with the old behavior available via the -o option (it might still be > useful if one has many kernels and cares which messages came from > which). If the boot file is not used as the prefix, it is still > logged once at startup. > > This change is prompted by the fact that the boot file is now much > longer ("/boot/kernel/kernel" vs. "/kernel"), which significanlty > bloats the syslogd output. > > Please review and comment. Nice work; just a couple of comments.. > @@ -181,6 +181,12 @@ > messages; the default is 20 minutes. > .It Fl n > Disable dns query for every request. > +.It Fl o > +Prefix kernel messages with the full kernel boot file as determined by > +.Xr getbootfile 3 . > +Without this, > +the kernel message prefix is always Do these two really need to be on separate lines? > Index: syslogd.c > =================================================================== > RCS file: /ref/cvsf/src/usr.sbin/syslogd/syslogd.c,v > retrieving revision 1.92 > diff -u -r1.92 syslogd.c > --- syslogd.c 2001/11/14 09:20:24 1.92 > +++ syslogd.c 2001/11/25 00:42:26 > @@ -273,6 +273,7 @@ > int family = PF_INET; /* protocol family (IPv4 only) */ > #endif > int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */ > +int use_bootfile = 0; /* log entire bootfile for every kern msg */ I think 'boot filename' would be more appropriate at least in the comment. > @@ -1525,6 +1531,16 @@ > oldLocalHostName, LocalHostName); > logmsg(LOG_SYSLOG|LOG_INFO, hostMsg, LocalHostName, ADDDATE); > dprintf("%s\n", hostMsg); > + } > + /* > + * Log the kernel boot file if we aren't going to use it as > + * the prefix, and if this is *not* a restart. > + */ > + if (signo == 0 && !use_bootfile) { > + (void)snprintf(bootfileMsg, sizeof(bootfileMsg), > + "syslogd: kernel boot file is %s", bootfile); Maybe something like 'boot(ed) kernel file name'? Other than those minor issues, I like this patch a lot. G'luck, Peter -- If I had finished this sentence, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message