From owner-freebsd-current@FreeBSD.ORG Wed Jun 9 12:49:20 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6CB21065670 for ; Wed, 9 Jun 2010 12:49:20 +0000 (UTC) (envelope-from gperez@entel.upc.edu) Received: from dash.upc.es (dash.upc.es [147.83.2.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5D5438FC20 for ; Wed, 9 Jun 2010 12:49:19 +0000 (UTC) Received: from ackerman2.upc.es (ackerman2.upc.es [147.83.2.244]) by dash.upc.es (8.14.1/8.13.1) with ESMTP id o59CnHHE030275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 9 Jun 2010 14:49:18 +0200 Received: from [147.83.40.234] ([147.83.40.234]) (authenticated bits=0) by ackerman2.upc.es (8.13.8/8.13.8) with ESMTP id o59CnA60014402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Jun 2010 14:49:17 +0200 Message-ID: <4C0F8DC6.806@entel.upc.edu> Date: Wed, 09 Jun 2010 14:49:10 +0200 From: =?UTF-8?B?R3VzdGF1IFDDqXJleg==?= User-Agent: Thunderbird 2.0.0.24 (X11/20100604) MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <20100609104857.GM39829@acme.spoerlein.net> In-Reply-To: <20100609104857.GM39829@acme.spoerlein.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.63 on 147.83.2.244 X-Mail-Scanned: Criba 2.0 + Clamd X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (dash.upc.es [147.83.2.50]); Wed, 09 Jun 2010 14:49:18 +0200 (CEST) Cc: Subject: Re: Patch for really fixing bsnmpd hrProcessorLoad values X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 12:49:20 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 En/na Ulrich Spörlein ha escrit: > Hi guys, > > I finally got fed up with bsnmpd no longer returning the right CPU load > values when running under ULE. After taking a look at how top(1) does > it, I came up with the following initial patch to bsnmpd, that seems to > DTRT. > > A few technical questions remain: > > - Is the idle state guaranteed to always be in the last cp_time column? > - Is handling overflow of kern.cp_times worth it? There's only a 60s > window of reporting wrong stats, better than what we have now anyway. > - Why is kern.cp_times often times *way* longer than hw.ncpu * > CPUSTATES? Is it guaranteed that the first n entries correspond to the > first n*CPUSTATES values in kern.cp_times? Can there be holes? > > Patch has been tested on 8-STABLE, 4xCPUs and SCHED_ULE. Other reports > would be very much appreciated. > > Regards, > Uli > Hi Uli, I've just recompiled a RELENG_8_0 kernel, with SCHED_ULE, 2xQuad Core and your patch applied to /usr/src. I get 0 values for all processors : ***************************************************************************** [root@host ~]# snmpwalk -v 2c -c host IP_HOST | grep hrProcessor HOST-RESOURCES-MIB::hrProcessorFrwID.6 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorFrwID.10 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorFrwID.14 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorFrwID.18 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorFrwID.22 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorFrwID.26 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorFrwID.30 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorFrwID.34 = OID: SNMPv2-SMI::zeroDotZero HOST-RESOURCES-MIB::hrProcessorLoad.6 = INTEGER: 0 HOST-RESOURCES-MIB::hrProcessorLoad.10 = INTEGER: 0 HOST-RESOURCES-MIB::hrProcessorLoad.14 = INTEGER: 0 HOST-RESOURCES-MIB::hrProcessorLoad.18 = INTEGER: 0 HOST-RESOURCES-MIB::hrProcessorLoad.22 = INTEGER: 0 HOST-RESOURCES-MIB::hrProcessorLoad.26 = INTEGER: 0 HOST-RESOURCES-MIB::hrProcessorLoad.30 = INTEGER: 0 HOST-RESOURCES-MIB::hrProcessorLoad.34 = INTEGER: 0 HOST-RESOURCES-MIB::hrSWRunParameters.3655 = STRING: "hrProcessor" [root@host ~]# uname -arn FreeBSD host 8.0-RELEASE-p3 FreeBSD 8.0-RELEASE-p3 #2: Wed Jun 9 14:23:16 CEST 2010 root@host:/usr/obj/usr/src/sys/CUSTOM i386 ***************************************************************************** If time permits I may try it in CURRENT. But I don't know when I'll be able ... Did I do anything wrong ? I applied the patch, recompiled and reinstalled $SRC/usr.sbin/bsnmpd, recompiled $PORTS/net-mngt/bsnmp-ucd (just in case) and then recompiled and reinstalled the kernel with ULE (I was keeping 4BSD, because hrProcessorLoad used to work only with 4BSD). Regards, Gustau > > ---------------------------------------------------------------------- > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" - -- PGP KEY : http://www-entel.upc.edu/gus/gus.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMD43FAAoJEH+VVM1WSYnPwcAP/0xdZGkNNVDqjLx55cfEX6wB drcig2BpkJyvkJhNwa48aAapDrblEuslGLUt0nq2HpCFkATMaITV0d9DjEkQnq9M S8onPv39EBV+BA0fg6m/8FETQ4VZGN557XnfdzohjXFCPE9RTLOPQfLd/dIZpjm4 39nriIhZdiSKclnYV+QPqfggPx3Kl2gTNn56HMHpEHo2Bt3ZtrTesSfOBDIjFD0E /vSzioiOyfQfdly+yTo6Pd+8eme//eCxUH8YD+h5FfysU6zcK8dSNWFpF5MCk+5X 3PTpxyqPCijiSNqNTxS0F+sfolQrp6sp/yIl3e7cm0oyMlEUNhIuv5aTO0Hj6rR3 5x3aRUCr8YyXNBsXNS0SA2CSM8+auc0A+xZElGLlH1oChpEmmUHiQkjMZ22r5yPu oZCS5B1WDoVcIUkAgE/DT8iqdWyBr7jPMavsQVZcmn1w0t6YHlN/jxX6AAwaYCjO 4vk4ijcpcONXR0KUYPCz2TZAWsAyRCVcigiVWqj3aRdHJi+eL2IdVkd0cJT0IahM hje/odSd7q286VpvKBcvF1P5OWLbQkp4Nnhykbu8hRHm3zccO7cLDzXMD3/GbVHx Xs05nA/fDlvg2S46zfIE8a+d9YuORfNjEvUuBg4wCmN5xgd4rOxP4bHc3AdLppwt bzvHo5/ExV5NpKoic03t =01Ia -----END PGP SIGNATURE-----