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
Please register or sign in to comment