Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2002 01:54:35 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Borja Marcos <borjamar@sarenet.es>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Bug? vm.stats.sys.v_syscall not updated
Message-ID:  <20021115014610.L10490-100000@gamplex.bde.org>
In-Reply-To: <200211140017.52416.borjamar@sarenet.es>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021115014610.L10490-100000>