James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | // Copyright (c) 2018 Intel Corporation |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <unistd.h> |
| 18 | |
Ed Tanous | 8a57ec0 | 2020-10-09 12:46:52 -0700 | [diff] [blame] | 19 | #include <CPUSensor.hpp> |
| 20 | #include <Utils.hpp> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 21 | #include <boost/algorithm/string/predicate.hpp> |
| 22 | #include <boost/algorithm/string/replace.hpp> |
James Feist | 8086aba | 2020-08-25 16:00:59 -0700 | [diff] [blame] | 23 | #include <boost/asio/read_until.hpp> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 24 | #include <boost/date_time/posix_time/posix_time.hpp> |
James Feist | 38fb598 | 2020-05-28 10:09:54 -0700 | [diff] [blame] | 25 | #include <sdbusplus/asio/connection.hpp> |
| 26 | #include <sdbusplus/asio/object_server.hpp> |
| 27 | |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 28 | #include <iostream> |
Patrick Venture | 96e97db | 2019-10-31 13:44:38 -0700 | [diff] [blame] | 29 | #include <istream> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 30 | #include <limits> |
Patrick Venture | 96e97db | 2019-10-31 13:44:38 -0700 | [diff] [blame] | 31 | #include <memory> |
Patrick Venture | 96e97db | 2019-10-31 13:44:38 -0700 | [diff] [blame] | 32 | #include <stdexcept> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 33 | #include <string> |
Patrick Venture | 96e97db | 2019-10-31 13:44:38 -0700 | [diff] [blame] | 34 | #include <vector> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 35 | |
James Feist | d870587 | 2019-02-08 13:26:09 -0800 | [diff] [blame] | 36 | CPUSensor::CPUSensor(const std::string& path, const std::string& objectType, |
| 37 | sdbusplus::asio::object_server& objectServer, |
| 38 | std::shared_ptr<sdbusplus::asio::connection>& conn, |
| 39 | boost::asio::io_service& io, const std::string& sensorName, |
Jeff Lin | 7b7a9de | 2021-02-22 11:16:27 +0800 | [diff] [blame] | 40 | std::vector<thresholds::Threshold>&& thresholdsIn, |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 41 | const std::string& sensorConfiguration, int cpuId, |
Vijay Khemka | 86dea2b | 2019-06-06 11:14:37 -0700 | [diff] [blame] | 42 | bool show, double dtsOffset) : |
Zhikui Ren | da98f09 | 2021-11-01 09:41:08 -0700 | [diff] [blame] | 43 | Sensor(escapeName(sensorName), std::move(thresholdsIn), sensorConfiguration, |
| 44 | objectType, false, false, 0, 0, conn, PowerState::on), |
Arun P. Mohanan | 04d0506 | 2021-10-29 20:30:26 +0530 | [diff] [blame] | 45 | std::enable_shared_from_this<CPUSensor>(), objServer(objectServer), |
| 46 | inputDev(io), waitTimer(io), path(path), |
Brad Bishop | fbb44ad | 2019-11-08 09:42:37 -0500 | [diff] [blame] | 47 | privTcontrol(std::numeric_limits<double>::quiet_NaN()), |
Zbigniew Kurzynski | 98be984 | 2020-09-07 18:49:15 +0200 | [diff] [blame] | 48 | dtsOffset(dtsOffset), show(show), pollTime(CPUSensor::sensorPollMs), |
| 49 | minMaxReadCounter(0) |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 50 | { |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 51 | nameTcontrol = labelTcontrol; |
| 52 | nameTcontrol += " CPU" + std::to_string(cpuId); |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 53 | if (show) |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 54 | { |
Zbigniew Kurzynski | 63f3866 | 2020-06-09 13:02:11 +0200 | [diff] [blame] | 55 | if (auto fileParts = splitFileName(path)) |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 56 | { |
Zbigniew Kurzynski | dbfd466 | 2020-09-28 18:06:00 +0200 | [diff] [blame] | 57 | auto& [type, nr, item] = *fileParts; |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 58 | std::string interfacePath; |
Zev Weiss | 6b6891c | 2021-04-22 02:46:21 -0500 | [diff] [blame] | 59 | const char* units; |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 60 | if (type.compare("power") == 0) |
| 61 | { |
| 62 | interfacePath = "/xyz/openbmc_project/sensors/power/" + name; |
Zev Weiss | 6b6891c | 2021-04-22 02:46:21 -0500 | [diff] [blame] | 63 | units = sensor_paths::unitWatts; |
Andrei Kartashev | 6736d4b | 2020-12-18 18:59:21 +0300 | [diff] [blame] | 64 | minValue = 0; |
| 65 | maxValue = 511; |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 66 | } |
| 67 | else |
| 68 | { |
| 69 | interfacePath = |
| 70 | "/xyz/openbmc_project/sensors/temperature/" + name; |
Zev Weiss | 6b6891c | 2021-04-22 02:46:21 -0500 | [diff] [blame] | 71 | units = sensor_paths::unitDegreesC; |
Andrei Kartashev | 6736d4b | 2020-12-18 18:59:21 +0300 | [diff] [blame] | 72 | minValue = -128; |
| 73 | maxValue = 127; |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 74 | } |
James Feist | 078f232 | 2019-03-08 11:09:05 -0800 | [diff] [blame] | 75 | |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 76 | sensorInterface = objectServer.add_interface( |
| 77 | interfacePath, "xyz.openbmc_project.Sensor.Value"); |
Jayashree Dhanapal | 5667808 | 2022-01-04 17:27:20 +0530 | [diff] [blame] | 78 | for (const auto& threshold : thresholds) |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 79 | { |
Jayashree Dhanapal | 5667808 | 2022-01-04 17:27:20 +0530 | [diff] [blame] | 80 | std::string interface = |
| 81 | thresholds::getInterface(threshold.level); |
| 82 | thresholdInterfaces[static_cast<size_t>(threshold.level)] = |
| 83 | objectServer.add_interface(interfacePath, interface); |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 84 | } |
| 85 | association = objectServer.add_interface(interfacePath, |
| 86 | association::interface); |
| 87 | |
Zev Weiss | 6b6891c | 2021-04-22 02:46:21 -0500 | [diff] [blame] | 88 | setInitialProperties(conn, units); |
Zbigniew Kurzynski | 0a4c480 | 2020-04-01 11:22:27 +0200 | [diff] [blame] | 89 | } |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 90 | } |
James Feist | 961bf09 | 2020-07-01 16:38:12 -0700 | [diff] [blame] | 91 | |
| 92 | // call setup always as not all sensors call setInitialProperties |
James Feist | 71d31b2 | 2019-01-02 16:57:54 -0800 | [diff] [blame] | 93 | setupPowerMatch(conn); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | CPUSensor::~CPUSensor() |
| 97 | { |
| 98 | // close the input dev to cancel async operations |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 99 | inputDev.close(); |
| 100 | waitTimer.cancel(); |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 101 | if (show) |
| 102 | { |
Jayashree Dhanapal | 5667808 | 2022-01-04 17:27:20 +0530 | [diff] [blame] | 103 | for (const auto& iface : thresholdInterfaces) |
| 104 | { |
| 105 | objServer.remove_interface(iface); |
| 106 | } |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 107 | objServer.remove_interface(sensorInterface); |
James Feist | 078f232 | 2019-03-08 11:09:05 -0800 | [diff] [blame] | 108 | objServer.remove_interface(association); |
Arun P. Mohanan | b782eec | 2021-10-18 16:22:09 +0530 | [diff] [blame] | 109 | objServer.remove_interface(availableInterface); |
| 110 | objServer.remove_interface(operationalInterface); |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 111 | } |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 112 | } |
| 113 | |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 114 | void CPUSensor::setupRead(void) |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 115 | { |
Arun P. Mohanan | 04d0506 | 2021-10-29 20:30:26 +0530 | [diff] [blame] | 116 | std::weak_ptr<CPUSensor> weakRef = weak_from_this(); |
| 117 | |
James Feist | c22b842 | 2020-07-07 14:40:39 -0700 | [diff] [blame] | 118 | if (readingStateGood()) |
| 119 | { |
| 120 | inputDev.close(); |
| 121 | int fd = open(path.c_str(), O_RDONLY); |
| 122 | if (fd >= 0) |
| 123 | { |
| 124 | inputDev.assign(fd); |
| 125 | |
| 126 | boost::asio::async_read_until( |
| 127 | inputDev, readBuf, '\n', |
Arun P. Mohanan | 04d0506 | 2021-10-29 20:30:26 +0530 | [diff] [blame] | 128 | [weakRef](const boost::system::error_code& ec, |
| 129 | std::size_t /*bytes_transfered*/) { |
| 130 | std::shared_ptr<CPUSensor> self = weakRef.lock(); |
| 131 | if (!self) |
| 132 | { |
| 133 | return; |
| 134 | } |
| 135 | self->handleResponse(ec); |
| 136 | }); |
James Feist | c22b842 | 2020-07-07 14:40:39 -0700 | [diff] [blame] | 137 | } |
| 138 | else |
| 139 | { |
| 140 | std::cerr << name << " unable to open fd!\n"; |
| 141 | pollTime = sensorFailedPollTimeMs; |
| 142 | } |
| 143 | } |
| 144 | else |
| 145 | { |
| 146 | pollTime = sensorFailedPollTimeMs; |
| 147 | markAvailable(false); |
| 148 | } |
| 149 | waitTimer.expires_from_now(boost::posix_time::milliseconds(pollTime)); |
Arun P. Mohanan | 04d0506 | 2021-10-29 20:30:26 +0530 | [diff] [blame] | 150 | waitTimer.async_wait([weakRef](const boost::system::error_code& ec) { |
James Feist | c22b842 | 2020-07-07 14:40:39 -0700 | [diff] [blame] | 151 | if (ec == boost::asio::error::operation_aborted) |
| 152 | { |
| 153 | return; // we're being canceled |
| 154 | } |
Arun P. Mohanan | 04d0506 | 2021-10-29 20:30:26 +0530 | [diff] [blame] | 155 | std::shared_ptr<CPUSensor> self = weakRef.lock(); |
| 156 | if (!self) |
| 157 | { |
| 158 | return; |
| 159 | } |
| 160 | self->setupRead(); |
James Feist | c22b842 | 2020-07-07 14:40:39 -0700 | [diff] [blame] | 161 | }); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 162 | } |
| 163 | |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 164 | void CPUSensor::updateMinMaxValues(void) |
| 165 | { |
| 166 | const boost::container::flat_map< |
| 167 | std::string, |
| 168 | std::vector<std::tuple<const char*, std::reference_wrapper<double>, |
| 169 | const char*>>> |
| 170 | map = { |
| 171 | { |
| 172 | "cap", |
| 173 | { |
| 174 | std::make_tuple("cap_max", std::ref(maxValue), "MaxValue"), |
| 175 | std::make_tuple("cap_min", std::ref(minValue), "MinValue"), |
| 176 | }, |
| 177 | }, |
| 178 | }; |
| 179 | |
Zbigniew Kurzynski | 63f3866 | 2020-06-09 13:02:11 +0200 | [diff] [blame] | 180 | if (auto fileParts = splitFileName(path)) |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 181 | { |
Zbigniew Kurzynski | dbfd466 | 2020-09-28 18:06:00 +0200 | [diff] [blame] | 182 | auto& [fileType, fileNr, fileItem] = *fileParts; |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 183 | const auto mapIt = map.find(fileItem); |
| 184 | if (mapIt != map.cend()) |
| 185 | { |
| 186 | for (const auto& vectorItem : mapIt->second) |
| 187 | { |
Zbigniew Kurzynski | dbfd466 | 2020-09-28 18:06:00 +0200 | [diff] [blame] | 188 | auto& [suffix, oldValue, dbusName] = vectorItem; |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 189 | auto attrPath = boost::replace_all_copy(path, fileItem, suffix); |
Zbigniew Kurzynski | 63f3866 | 2020-06-09 13:02:11 +0200 | [diff] [blame] | 190 | if (auto newVal = |
| 191 | readFile(attrPath, CPUSensor::sensorScaleFactor)) |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 192 | { |
Zbigniew Kurzynski | 4f45e42 | 2020-06-09 12:42:15 +0200 | [diff] [blame] | 193 | updateProperty(sensorInterface, oldValue, *newVal, |
| 194 | dbusName); |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 195 | } |
| 196 | else |
| 197 | { |
| 198 | if (isPowerOn()) |
| 199 | { |
Zbigniew Kurzynski | 4f45e42 | 2020-06-09 12:42:15 +0200 | [diff] [blame] | 200 | updateProperty(sensorInterface, oldValue, 0, dbusName); |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 201 | } |
| 202 | else |
| 203 | { |
Zbigniew Kurzynski | 4f45e42 | 2020-06-09 12:42:15 +0200 | [diff] [blame] | 204 | updateProperty(sensorInterface, oldValue, |
| 205 | std::numeric_limits<double>::quiet_NaN(), |
| 206 | dbusName); |
Zbigniew Kurzynski | 8d8d8d7 | 2020-05-29 19:21:24 +0200 | [diff] [blame] | 207 | } |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
James Feist | d870587 | 2019-02-08 13:26:09 -0800 | [diff] [blame] | 214 | void CPUSensor::handleResponse(const boost::system::error_code& err) |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 215 | { |
James Feist | 838529b | 2020-09-02 16:57:05 -0700 | [diff] [blame] | 216 | |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 217 | if (err == boost::system::errc::bad_file_descriptor) |
| 218 | { |
| 219 | return; // we're being destroyed |
| 220 | } |
Ed Tanous | 8a57ec0 | 2020-10-09 12:46:52 -0700 | [diff] [blame] | 221 | if (err == boost::system::errc::operation_canceled) |
James Feist | 838529b | 2020-09-02 16:57:05 -0700 | [diff] [blame] | 222 | { |
| 223 | if (readingStateGood()) |
| 224 | { |
| 225 | if (!loggedInterfaceDown) |
| 226 | { |
| 227 | std::cerr << name << " interface down!\n"; |
| 228 | loggedInterfaceDown = true; |
| 229 | } |
Ed Tanous | 8a57ec0 | 2020-10-09 12:46:52 -0700 | [diff] [blame] | 230 | pollTime = CPUSensor::sensorPollMs * 10u; |
James Feist | 838529b | 2020-09-02 16:57:05 -0700 | [diff] [blame] | 231 | markFunctional(false); |
| 232 | } |
| 233 | return; |
| 234 | } |
| 235 | loggedInterfaceDown = false; |
James Feist | c22b842 | 2020-07-07 14:40:39 -0700 | [diff] [blame] | 236 | pollTime = CPUSensor::sensorPollMs; |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 237 | std::istream responseStream(&readBuf); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 238 | if (!err) |
| 239 | { |
| 240 | std::string response; |
| 241 | try |
| 242 | { |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 243 | std::getline(responseStream, response); |
Zhikui Ren | d3da128 | 2020-09-11 17:02:01 -0700 | [diff] [blame] | 244 | rawValue = std::stod(response); |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 245 | responseStream.clear(); |
Zhikui Ren | d3da128 | 2020-09-11 17:02:01 -0700 | [diff] [blame] | 246 | double nvalue = rawValue / CPUSensor::sensorScaleFactor; |
Josh Lehan | 833661a | 2020-03-04 17:35:41 -0800 | [diff] [blame] | 247 | |
| 248 | if (show) |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 249 | { |
Josh Lehan | 833661a | 2020-03-04 17:35:41 -0800 | [diff] [blame] | 250 | updateValue(nvalue); |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 251 | } |
Josh Lehan | 833661a | 2020-03-04 17:35:41 -0800 | [diff] [blame] | 252 | else |
| 253 | { |
| 254 | value = nvalue; |
| 255 | } |
Zbigniew Kurzynski | 98be984 | 2020-09-07 18:49:15 +0200 | [diff] [blame] | 256 | if (minMaxReadCounter++ % 8 == 0) |
| 257 | { |
| 258 | updateMinMaxValues(); |
| 259 | } |
Josh Lehan | 833661a | 2020-03-04 17:35:41 -0800 | [diff] [blame] | 260 | |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 261 | double gTcontrol = gCpuSensors[nameTcontrol] |
| 262 | ? gCpuSensors[nameTcontrol]->value |
| 263 | : std::numeric_limits<double>::quiet_NaN(); |
| 264 | if (gTcontrol != privTcontrol) |
| 265 | { |
| 266 | privTcontrol = gTcontrol; |
| 267 | |
| 268 | if (!thresholds.empty()) |
| 269 | { |
| 270 | std::vector<thresholds::Threshold> newThresholds; |
| 271 | if (parseThresholdsFromAttr(newThresholds, path, |
Vijay Khemka | 86dea2b | 2019-06-06 11:14:37 -0700 | [diff] [blame] | 272 | CPUSensor::sensorScaleFactor, |
| 273 | dtsOffset)) |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 274 | { |
| 275 | if (!std::equal(thresholds.begin(), thresholds.end(), |
| 276 | newThresholds.begin(), |
| 277 | newThresholds.end())) |
| 278 | { |
| 279 | thresholds = newThresholds; |
| 280 | if (show) |
| 281 | { |
| 282 | thresholds::updateThresholds(this); |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | else |
| 287 | { |
| 288 | std::cerr << "Failure to update thresholds for " << name |
| 289 | << "\n"; |
| 290 | } |
Jae Hyun Yoo | 95b8a2d | 2019-02-25 20:15:09 -0800 | [diff] [blame] | 291 | } |
| 292 | } |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 293 | } |
James Feist | d870587 | 2019-02-08 13:26:09 -0800 | [diff] [blame] | 294 | catch (const std::invalid_argument&) |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 295 | { |
James Feist | 961bf09 | 2020-07-01 16:38:12 -0700 | [diff] [blame] | 296 | incrementError(); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 297 | } |
| 298 | } |
| 299 | else |
| 300 | { |
James Feist | 1169eb4 | 2018-10-31 10:08:47 -0700 | [diff] [blame] | 301 | pollTime = sensorFailedPollTimeMs; |
James Feist | 961bf09 | 2020-07-01 16:38:12 -0700 | [diff] [blame] | 302 | incrementError(); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 303 | } |
| 304 | |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 305 | responseStream.clear(); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 306 | } |
| 307 | |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 308 | void CPUSensor::checkThresholds(void) |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 309 | { |
Jae Hyun Yoo | 73ca551 | 2019-02-28 21:20:17 -0800 | [diff] [blame] | 310 | if (show) |
| 311 | { |
| 312 | thresholds::checkThresholds(this); |
| 313 | } |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 314 | } |