From owner-freebsd-current Thu Nov 14 6:42:14 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81D5737B401 for ; Thu, 14 Nov 2002 06:42:12 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id D115243E4A for ; Thu, 14 Nov 2002 06:42:10 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id BAA20017; Fri, 15 Nov 2002 01:42:01 +1100 Date: Fri, 15 Nov 2002 01:54:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Borja Marcos Cc: freebsd-current@FreeBSD.ORG Subject: Re: Bug? vm.stats.sys.v_syscall not updated In-Reply-To: <200211140017.52416.borjamar@sarenet.es> Message-ID: <20021115014610.L10490-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 14 Nov 2002, Borja Marcos wrote: > There is a problem in -CURRENT. The vm.stats.sys.v_syscall from the system > MIB is not updated. This variable was used at least by the systat command, > and it happens to be used by an Orca (www.orcaware.com) data collector I am > writing for FreeBSD. > > Is this a bug? If it is not, is there another system call counter available? This is a bug in rev.1.62 of vm_meter.c and associated changes. I use the following fix: %%% Index: pcpu.h =================================================================== RCS file: /home/ncvs/src/sys/sys/pcpu.h,v retrieving revision 1.9 diff -u -2 -r1.9 pcpu.h --- pcpu.h 20 Aug 2002 19:50:30 -0000 1.9 +++ pcpu.h 21 Aug 2002 00:17:02 -0000 @@ -98,6 +100,10 @@ * support single-instruction memory increments. */ -#define PCPU_LAZY_INC(var) (++*PCPU_PTR(var)) - +#ifdef SMP +#define PCPU_LAZY_INC(var) (++*PCPU_PTR(var)) +#else +#define PCPU_LAZY_INC(var) (++(var)) +#endif + /* * Machine dependent callouts. cpu_pcpu_init() is responsible for %%% There are several related bugs. E.g., in the SMP case the stats aren't up to date in their usual place until you look at them, so programs that look at them using kvm will see stale values. There are too many such programs... jhb may have more complete fixes. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message