From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 3 18:09:38 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A24BF106566C for ; Thu, 3 Mar 2011 18:09:38 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (m209-73.dsl.rawbw.com [198.144.209.73]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6428FC14 for ; Thu, 3 Mar 2011 18:09:36 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.4/8.14.4) with ESMTP id p23HnmvP011858 for ; Thu, 3 Mar 2011 09:49:48 -0800 (PST) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.4/8.14.4/Submit) id p23HnmKn011857 for hackers@freebsd.org; Thu, 3 Mar 2011 09:49:48 -0800 (PST) (envelope-from david) Date: Thu, 3 Mar 2011 09:49:48 -0800 From: David Wolfskill To: hackers@freebsd.org Message-ID: <20110303174948.GF1471@albert.catwhisker.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/aVve/J9H4Wl5yVO" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: Puzzled about VFS sysctl OIDs -- signed vs. unsigned X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2011 18:09:38 -0000 --/aVve/J9H4Wl5yVO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'm using a little shell script to capture selected sysctl OID values periodically, in an attempt to get a better idea how the resources of a system are being used during a long-running (usually measured in hours), mission-critical workload. In the process of testing this, I've seen some of the VFS sysctl OIDs (in particular) report negative values ... when the description looks to me as if the OID in question is intended to be a monotonically increasing counter. For example: > sysctl -d vfs.getnewbufcalls vfs.getnewbufcalls: Number of calls to getnewbuf > sysctl vfs.getnewbufcalls vfs.getnewbufcalls: -348909432 Examining sys/kern/vfs_bio.c, the definition of vfs.getnewbufcalls appears to be: =2E.. static int getnewbufcalls; SYSCTL_INT(_vfs, OID_AUTO, getnewbufcalls, CTLFLAG_RW, &getnewbufcalls, 0, "Number of calls to getnewbuf"); =2E.. Many of the other OIDs defined nearby are also SYSCTL_INT (or SYSCTL_LONG), vs. SYSCTL_UINT (or SYSCTL_ULONG), and the corresponding variables are defined as static int (or static long) vs. static u_int (or static u_long). Is this both correct and reasonable? If so, how should I interpret such negative values? [GSoC project, anyone?] Thanks! Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --/aVve/J9H4Wl5yVO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk1v1LsACgkQmprOCmdXAD2RzgCfWovvxO4dXSqZWHB/4fgrZtap eMMAn0wbVs9/iNC0yepAiO5zSXYfG3zP =ttJq -----END PGP SIGNATURE----- --/aVve/J9H4Wl5yVO--