Skip to content
Commit 3fea9709 authored by Adriaan de Groot's avatar Adriaan de Groot 💬
Browse files

freebsd-cpu: fix CPU load data retrieval

- Calculate the sysctl prefix -- dev.cpu.<n> -- just once at creation,
  and while we're here allow CPU numbers greater than 1 digit.
- m_container->objects() contains all the CPU objects, but also others,
  loading to out-of-bounds accesses in the loop that assumes there are
  only CPU objects.  Fix that and factor it out so that the update-cpu-
  from-sysctl-data can be called from the constructor -- this means that
  there is "initial data" for the CPU load.
- If we've already called sysctl() to get the CPU data, we may
  as well update the CPU information because we have it, even
  if nobody is subscribed to it. So move the check for subscriptions
  to later in the update method.
- There are (now) only the two freq and temperature sensors
  that use sysctl; there's not much point in having an additional list.
- Add internal dox
parent b2031533
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment