Patch for really fixing bsnmpd hrProcessorLoad values

From: Ulrich Spörlein <uqs_at_spoerlein.net>
Date: Wed, 9 Jun 2010 12:48:57 +0200
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


Received on Wed Jun 09 2010 - 08:48:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:04 UTC