Lines Matching refs:sensor_name
96 void ThermalHelperImpl::dumpTraces(std::string_view sensor_name) { in dumpTraces() argument
97 if (!(sensor_info_map_.count(sensor_name.data()) && in dumpTraces()
98 sensor_status_map_.count(sensor_name.data()))) { in dumpTraces()
99 LOG(ERROR) << sensor_name << " not part of sensor_info_map_ or sensor_status_map_"; in dumpTraces()
104 const auto &sensor_status = sensor_status_map_.at(sensor_name.data()); in dumpTraces()
105 ATRACE_INT((sensor_name.data() + std::string("-cached")).c_str(), in dumpTraces()
108 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in dumpTraces()
380 for (auto &[sensor_name, sensor_info] : sensor_info_map_) { in checkUpdateSensorForEmul()
391 auto &sensor_status = sensor_status_map_.at(sensor_name.data()); in checkUpdateSensorForEmul()
395 checkUpdateSensorForEmul(sensor_name, max_throttling); in checkUpdateSensorForEmul()
463 for (auto &[sensor_name, sensor_status] : sensor_status_map_) { in emulClear()
466 checkUpdateSensorForEmul(sensor_name, false); in emulClear()
503 std::string_view sensor_name, Temperature *out, in readTemperature() argument
509 auto &sensor_status = sensor_status_map_.at(sensor_name.data()); in readTemperature()
511 if (!readThermalSensor(sensor_name, &temp, force_no_cache, &sensor_log_map)) { in readTemperature()
512 LOG(ERROR) << "Failed to read thermal sensor " << sensor_name.data(); in readTemperature()
514 ThermalSensorAbnormalityDetected::TEMP_READ_FAIL, sensor_name, std::nullopt); in readTemperature()
519 LOG(INFO) << "Sensor " << sensor_name.data() << " temperature is nan."; in readTemperature()
523 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in readTemperature()
525 out->name = sensor_name.data(); in readTemperature()
565 thermal_stats_helper_.updateSensorTempStatsBySeverity(sensor_name, out->throttlingStatus); in readTemperature()
566 LOG(INFO) << sensor_name.data() << ":" << out->value << " raw data: " << sensor_log.str(); in readTemperature()
572 bool ThermalHelperImpl::readTemperatureThreshold(std::string_view sensor_name, in readTemperatureThreshold() argument
578 if (!sensor_info_map_.count(sensor_name.data())) { in readTemperatureThreshold()
579 LOG(ERROR) << __func__ << ": sensor not found: " << sensor_name; in readTemperatureThreshold()
583 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in readTemperatureThreshold()
586 out->name = sensor_name.data(); in readTemperatureThreshold()
705 std::string_view sensor_name = sensor_info_pair.first; in initializeSensorMap() local
709 if (!path_map.count(sensor_name.data())) { in initializeSensorMap()
710 LOG(ERROR) << "Could not find " << sensor_name << " in sysfs"; in initializeSensorMap()
716 path = ::android::base::StringPrintf("%s/%s", path_map.at(sensor_name.data()).c_str(), in initializeSensorMap()
722 if (!thermal_sensors_.addThermalFile(sensor_name, path)) { in initializeSensorMap()
723 LOG(ERROR) << "Could not add " << sensor_name << "to sensors map"; in initializeSensorMap()
832 std::string_view sensor_name = sensor_info.first; in initializeTrip() local
833 std::string_view tz_path = path_map.at(sensor_name.data()); in initializeTrip()
843 LOG(ERROR) << sensor_name << " could not open tz policy file:" << path; in initializeTrip()
847 LOG(ERROR) << sensor_name << " does not support uevent notify"; in initializeTrip()
864 LOG(ERROR) << "fail to update " << sensor_name << " trip point: " << path in initializeTrip()
875 LOG(ERROR) << "fail to update " << sensor_name << "trip hyst" << threshold in initializeTrip()
882 LOG(ERROR) << sensor_name << ":all thresholds are NAN"; in initializeTrip()
995 bool ThermalHelperImpl::runVirtualTempEstimator(std::string_view sensor_name, in runVirtualTempEstimator() argument
1002 ATRACE_NAME(StringPrintf("ThermalHelper::runVirtualTempEstimator - %s", sensor_name.data()) in runVirtualTempEstimator()
1004 if (!(sensor_info_map_.count(sensor_name.data()) && in runVirtualTempEstimator()
1005 sensor_status_map_.count(sensor_name.data()))) { in runVirtualTempEstimator()
1006 LOG(ERROR) << sensor_name << " not part of sensor_info_map_ or sensor_status_map_"; in runVirtualTempEstimator()
1010 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in runVirtualTempEstimator()
1013 LOG(ERROR) << "vt_estimator not valid for " << sensor_name; in runVirtualTempEstimator()
1047 LOG(ERROR) << "Failed to run estimator (ret: " << ret << ") for " << sensor_name in runVirtualTempEstimator()
1051 LOG(INFO) << "VT Estimator returned (ret: " << ret << ") for " << sensor_name in runVirtualTempEstimator()
1055 LOG(ERROR) << "Failed to read " << sensor_name.data() << "'s backup sensor " in runVirtualTempEstimator()
1065 LOG(ERROR) << "Failed to run estimator (ret: " << ret << ") for " << sensor_name; in runVirtualTempEstimator()
1069 void ThermalHelperImpl::dumpVtEstimatorStatus(std::string_view sensor_name, in dumpVtEstimatorStatus() argument
1071 if (!(sensor_info_map_.count(sensor_name.data()) && in dumpVtEstimatorStatus()
1072 sensor_status_map_.count(sensor_name.data()))) { in dumpVtEstimatorStatus()
1073 LOG(ERROR) << sensor_name << " not part of sensor_info_map_ or sensor_status_map_"; in dumpVtEstimatorStatus()
1077 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in dumpVtEstimatorStatus()
1083 sensor_info.virtual_sensor_info->vt_estimator->DumpStatus(sensor_name, dump_buf); in dumpVtEstimatorStatus()
1086 size_t ThermalHelperImpl::getPredictionMaxWindowMs(std::string_view sensor_name) { in getPredictionMaxWindowMs() argument
1089 ATRACE_NAME(StringPrintf("ThermalHelper::getPredictionMaxWindowMs - %s", sensor_name.data()) in getPredictionMaxWindowMs()
1092 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in getPredictionMaxWindowMs()
1094 LOG(ERROR) << "No predictor info found for sensor: " << sensor_name; in getPredictionMaxWindowMs()
1106 << " for sensor " << sensor_name; in getPredictionMaxWindowMs()
1113 float ThermalHelperImpl::readPredictionAfterTimeMs(std::string_view sensor_name, in readPredictionAfterTimeMs() argument
1118 StringPrintf("ThermalHelper::readPredictAfterTimeMs - %s", sensor_name.data()).c_str()); in readPredictionAfterTimeMs()
1120 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in readPredictionAfterTimeMs()
1122 LOG(ERROR) << "No predictor info found for sensor: " << sensor_name; in readPredictionAfterTimeMs()
1135 LOG(INFO) << predict_sensor_name << " cannot provide prediction for sensor " << sensor_name in readPredictionAfterTimeMs()
1139 << " for sensor " << sensor_name; in readPredictionAfterTimeMs()
1142 << " for sensor " << sensor_name; in readPredictionAfterTimeMs()
1148 bool ThermalHelperImpl::readTemperaturePredictions(std::string_view sensor_name, in readTemperaturePredictions() argument
1150 ATRACE_NAME(StringPrintf("ThermalHelper::readTemperaturePredictions - %s", sensor_name.data()) in readTemperaturePredictions()
1158 if (!sensor_info_map_.count(sensor_name.data())) { in readTemperaturePredictions()
1159 LOG(ERROR) << sensor_name << " not part of sensor_info_map_"; in readTemperaturePredictions()
1163 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in readTemperaturePredictions()
1165 LOG(ERROR) << "No predictor info found for sensor: " << sensor_name; in readTemperaturePredictions()
1176 << " for sensor " << sensor_name; in readTemperaturePredictions()
1185 bool ThermalHelperImpl::readThermalSensor(std::string_view sensor_name, float *temp, in readThermalSensor() argument
1191 ATRACE_NAME(StringPrintf("ThermalHelper::readThermalSensor - %s", sensor_name.data()).c_str()); in readThermalSensor()
1192 if (!(sensor_info_map_.count(sensor_name.data()) && in readThermalSensor()
1193 sensor_status_map_.count(sensor_name.data()))) { in readThermalSensor()
1197 const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); in readThermalSensor()
1198 auto &sensor_status = sensor_status_map_.at(sensor_name.data()); in readThermalSensor()
1204 (*sensor_log_map)[sensor_name.data()] = *temp; in readThermalSensor()
1218 (*sensor_log_map)[sensor_name.data()] = *temp; in readThermalSensor()
1219 ATRACE_INT((sensor_name.data() + std::string("-cached")).c_str(), static_cast<int>(*temp)); in readThermalSensor()
1225 if (!thermal_sensors_.readThermalFile(sensor_name.data(), &file_reading) || in readThermalSensor()
1227 LOG(ERROR) << "failed to read sensor: " << sensor_name; in readThermalSensor()
1241 LOG(ERROR) << "Failed to read " << sensor_name.data() << "'s linked sensor " in readThermalSensor()
1246 LOG(INFO) << sensor_name << " data is under collecting"; in readThermalSensor()
1254 if (!runVirtualTempEstimator(sensor_name, sensor_log_map, force_no_cache, in readThermalSensor()
1256 LOG(ERROR) << "Failed running VirtualEstimator for " << sensor_name; in readThermalSensor()
1267 LOG(ERROR) << "Failed to read " << sensor_name.data() << "'s coefficient " in readThermalSensor()
1272 LOG(INFO) << sensor_name << " data is under collecting"; in readThermalSensor()
1297 LOG(ERROR) << "Unknown formula type for sensor " << sensor_name.data(); in readThermalSensor()
1311 (*sensor_log_map)[sensor_name.data()] = *temp; in readThermalSensor()
1312 ATRACE_INT(sensor_name.data(), static_cast<int>(*temp)); in readThermalSensor()
1320 thermal_stats_helper_.updateSensorTempStatsByThreshold(sensor_name, real_temp); in readThermalSensor()