Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Jun 2010 14:49:10 +0200
From:      =?UTF-8?B?R3VzdGF1IFDDqXJleg==?= <gperez@entel.upc.edu>
To:        freebsd-current@freebsd.org
Subject:   Re: Patch for really fixing bsnmpd hrProcessorLoad values
Message-ID:  <4C0F8DC6.806@entel.upc.edu>
In-Reply-To: <20100609104857.GM39829@acme.spoerlein.net>
References:  <20100609104857.GM39829@acme.spoerlein.net>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C0F8DC6.806>