From owner-freebsd-current Mon Jan 15 14:23:31 2001 Delivered-To: freebsd-current@freebsd.org Received: from mimer.webgiro.com (unknown [213.162.128.50]) by hub.freebsd.org (Postfix) with ESMTP id 2FD3537B402; Mon, 15 Jan 2001 14:23:13 -0800 (PST) Received: by mimer.webgiro.com (Postfix, from userid 66) id 236582DC0E; Mon, 15 Jan 2001 23:26:56 +0100 (CET) Received: by mx.webgiro.com (Postfix, from userid 1001) id 523297817; Mon, 15 Jan 2001 23:24:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mx.webgiro.com (Postfix) with ESMTP id 4DCF010E1B; Mon, 15 Jan 2001 23:24:22 +0100 (CET) Date: Mon, 15 Jan 2001 23:24:22 +0100 (CET) From: Andrzej Bialecki To: Hajimu UMEMOTO Cc: current@freebsd.org Subject: Re: number of processes forked since boot In-Reply-To: <20010116.025742.74757685.ume@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 16 Jan 2001, Hajimu UMEMOTO wrote: > Hi, > > I wish to obtain number of processes forked since boot from userland. > So, I made a patch to intend to commit. > Any comment? > Index: sys/kern/kern_fork.c > diff -u sys/kern/kern_fork.c.orig sys/kern/kern_fork.c > --- sys/kern/kern_fork.c.orig Fri Jan 12 02:46:53 2001 > +++ sys/kern/kern_fork.c Tue Jan 16 02:30:26 2001 > @@ -146,6 +146,9 @@ > int nprocs = 1; /* process 0 */ > static int nextpid = 0; > > +static unsigned int nforks = 0; > +SYSCTL_UINT(_kern, KERN_NFORKS, nforks, CTLFLAG_RD, &nforks, 0, ""); If any, I think this should be long, otherwise on machines like web servers the counter will overflow in a short time. Andrzej Bialecki // WebGiro AB, Sweden (http://www.webgiro.com) // ------------------------------------------------------------------- // ------ FreeBSD: The Power to Serve. http://www.freebsd.org -------- // --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message