Lines Matching refs:sensor_info
466 const SensorInfo &sensor_info = sensor_info_map_.at(sensor_name.data()); in readTemperature() local
468 (static_cast<int>(sensor_info.type) > static_cast<int>(TemperatureType_1_0::SKIN)) in readTemperature()
470 : static_cast<TemperatureType_1_0>(sensor_info.type); in readTemperature()
473 out->currentValue = std::stof(temp) * sensor_info.multiplier; in readTemperature()
475 sensor_info.hot_thresholds[static_cast<size_t>(ThrottlingSeverity::SEVERE)]; in readTemperature()
477 sensor_info.hot_thresholds[static_cast<size_t>(ThrottlingSeverity::SHUTDOWN)]; in readTemperature()
478 out->vrThrottlingThreshold = sensor_info.vr_threshold; in readTemperature()
507 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in readTemperature() local
508 out->type = sensor_info.type; in readTemperature()
510 out->value = std::stof(temp) * sensor_info.multiplier; in readTemperature()
515 if (sensor_info.is_monitor) { in readTemperature()
523 status = getSeverityFromThresholds(sensor_info.hot_thresholds, sensor_info.cold_thresholds, in readTemperature()
524 sensor_info.hot_hysteresis, sensor_info.cold_hysteresis, in readTemperature()
549 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in readTemperatureThreshold() local
551 out->type = sensor_info.type; in readTemperatureThreshold()
553 out->hotThrottlingThresholds = sensor_info.hot_thresholds; in readTemperatureThreshold()
554 out->coldThrottlingThresholds = sensor_info.cold_thresholds; in readTemperatureThreshold()
555 out->vrThrottlingThreshold = sensor_info.vr_threshold; in readTemperatureThreshold()
560 size_t ThermalHelper::getTargetStateOfPID(const SensorInfo &sensor_info, in getTargetStateOfPID() argument
566 if (std::isnan(sensor_info.throttling_info->s_power[state])) { in getTargetStateOfPID()
578 float ThermalHelper::pidPowerCalculator(const Temperature_2_0 &temp, const SensorInfo &sensor_info, in pidPowerCalculator() argument
593 float err = sensor_info.hot_thresholds[target_state] - temp.value; in pidPowerCalculator()
594 p = err * (err < 0 ? sensor_info.throttling_info->k_po[target_state] in pidPowerCalculator()
595 : sensor_info.throttling_info->k_pu[target_state]); in pidPowerCalculator()
596 i = sensor_status->err_integral * sensor_info.throttling_info->k_i[target_state]; in pidPowerCalculator()
597 if (err < sensor_info.throttling_info->i_cutoff[target_state]) { in pidPowerCalculator()
598 float i_next = i + err * sensor_info.throttling_info->k_i[target_state]; in pidPowerCalculator()
599 if (abs(i_next) < sensor_info.throttling_info->i_max[target_state]) { in pidPowerCalculator()
607 d = sensor_info.throttling_info->k_d[target_state] * (err - sensor_status->prev_err) / in pidPowerCalculator()
613 power_budget = sensor_info.throttling_info->s_power[target_state] + p + i + d; in pidPowerCalculator()
614 if (power_budget < sensor_info.throttling_info->min_alloc_power[target_state]) { in pidPowerCalculator()
615 power_budget = sensor_info.throttling_info->min_alloc_power[target_state]; in pidPowerCalculator()
617 if (power_budget > sensor_info.throttling_info->max_alloc_power[target_state]) { in pidPowerCalculator()
618 power_budget = sensor_info.throttling_info->max_alloc_power[target_state]; in pidPowerCalculator()
623 << " s_power=" << sensor_info.throttling_info->s_power[target_state] in pidPowerCalculator()
631 const SensorInfo &sensor_info, float total_power_budget, in requestCdevByPower() argument
636 for (const auto &binded_cdev_info_pair : sensor_info.throttling_info->binded_cdev_info_map) { in requestCdevByPower()
648 for (const auto &binded_cdev_info_pair : sensor_info.throttling_info->binded_cdev_info_map) { in requestCdevByPower()
670 const SensorInfo &sensor_info) { in requestCdevBySeverity() argument
671 for (auto const &binded_cdev_info_pair : sensor_info.throttling_info->binded_cdev_info_map) { in requestCdevBySeverity()
682 std::string_view sensor_name, const SensorInfo &sensor_info, in computeCoolingDevicesRequest() argument
694 sensor_info.throttling_info->binded_cdev_info_map.at(cdev_request_pair.first); in computeCoolingDevicesRequest()
920 void ThermalHelper::setMinTimeout(SensorInfo *sensor_info) { in setMinTimeout() argument
921 sensor_info->polling_delay = kMinPollIntervalMs; in setMinTimeout()
922 sensor_info->passive_delay = kMinPollIntervalMs; in setMinTimeout()
928 for (auto &sensor_info : sensor_info_map_) { in initializeTrip() local
929 if (!sensor_info.second.is_monitor || (sensor_info.second.virtual_sensor_info != nullptr)) { in initializeTrip()
934 std::string_view sensor_name = sensor_info.first; in initializeTrip()
958 if (!std::isnan(sensor_info.second.hot_thresholds[i]) && in initializeTrip()
959 !std::isnan(sensor_info.second.hot_hysteresis[i])) { in initializeTrip()
962 sensor_info.second.hot_thresholds[i] / sensor_info.second.multiplier)); in initializeTrip()
973 sensor_info.second.hot_hysteresis[i] / sensor_info.second.multiplier)); in initializeTrip()
989 monitored_sensors->insert(sensor_info.first); in initializeTrip()
993 LOG(INFO) << "config Sensor: " << sensor_info.first in initializeTrip()
995 setMinTimeout(&sensor_info.second); in initializeTrip()
1097 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in checkVirtualSensor() local
1098 float offset = sensor_info.virtual_sensor_info->offset; in checkVirtualSensor()
1099 for (size_t i = 0; i < sensor_info.virtual_sensor_info->linked_sensors.size(); i++) { in checkVirtualSensor()
1102 sensor_info_map_.at(sensor_info.virtual_sensor_info->linked_sensors[i].data()); in checkVirtualSensor()
1105 sensor_info.virtual_sensor_info->linked_sensors[i], &data)) { in checkVirtualSensor()
1108 } else if (!checkVirtualSensor(sensor_info.virtual_sensor_info->linked_sensors[i], &data)) { in checkVirtualSensor()
1113 << sensor_info.virtual_sensor_info->linked_sensors[i] << ": temp = " << data; in checkVirtualSensor()
1116 if (std::isnan(sensor_info.virtual_sensor_info->coefficients[i])) { in checkVirtualSensor()
1119 float coefficient = sensor_info.virtual_sensor_info->coefficients[i]; in checkVirtualSensor()
1120 switch (sensor_info.virtual_sensor_info->formula) { in checkVirtualSensor()
1165 const SensorInfo &sensor_info = sensor_info_map_.at(name_status_pair.first); in thermalWatcherCallbackFunc() local
1168 if (!sensor_info.is_monitor) { in thermalWatcherCallbackFunc()
1174 ? sensor_info.passive_delay in thermalWatcherCallbackFunc()
1175 : sensor_info.polling_delay; in thermalWatcherCallbackFunc()
1189 uevent_sensors.find((sensor_info.virtual_sensor_info != nullptr) in thermalWatcherCallbackFunc()
1190 ? sensor_info.virtual_sensor_info->trigger_sensor in thermalWatcherCallbackFunc()
1195 } else if (sensor_info.virtual_sensor_info != nullptr) { in thermalWatcherCallbackFunc()
1198 sensor_status_map_.at(sensor_info.virtual_sensor_info->trigger_sensor); in thermalWatcherCallbackFunc()
1221 (sensor_info.virtual_sensor_info != nullptr))) { in thermalWatcherCallbackFunc()
1246 ? sensor_info.passive_delay in thermalWatcherCallbackFunc()
1247 : sensor_info.polling_delay; in thermalWatcherCallbackFunc()
1259 size_t target_state = getTargetStateOfPID(sensor_info, sensor_status); in thermalWatcherCallbackFunc()
1260 float power_budget = pidPowerCalculator(temp, sensor_info, &sensor_status, in thermalWatcherCallbackFunc()
1262 if (!requestCdevByPower(name_status_pair.first, &sensor_status, sensor_info, in thermalWatcherCallbackFunc()
1270 requestCdevBySeverity(name_status_pair.first, &sensor_status, sensor_info); in thermalWatcherCallbackFunc()
1279 sensor_info.throttling_info->binded_cdev_info_map) { in thermalWatcherCallbackFunc()
1296 computeCoolingDevicesRequest(name_status_pair.first, sensor_info, sensor_status, in thermalWatcherCallbackFunc()