Lines Matching refs:sensor

217 bool ParseOffsetThresholds(const std::string_view name, const Json::Value &sensor,  in ParseOffsetThresholds()  argument
220 Json::Value config_offset_thresholds = sensor["OffsetThresholds"]; in ParseOffsetThresholds()
221 Json::Value config_offset_values = sensor["OffsetValues"]; in ParseOffsetThresholds()
257 bool ParseVirtualSensorInfo(const std::string_view name, const Json::Value &sensor, in ParseVirtualSensorInfo() argument
259 if (sensor["VirtualSensor"].empty() || !sensor["VirtualSensor"].isBool()) { in ParseVirtualSensorInfo()
263 bool is_virtual_sensor = sensor["VirtualSensor"].asBool(); in ParseVirtualSensorInfo()
279 Json::Value values = sensor["Combination"]; in ParseVirtualSensorInfo()
291 if (sensor["Formula"].asString().compare("COUNT_THRESHOLD") == 0) { in ParseVirtualSensorInfo()
293 } else if (sensor["Formula"].asString().compare("WEIGHTED_AVG") == 0) { in ParseVirtualSensorInfo()
295 } else if (sensor["Formula"].asString().compare("MAXIMUM") == 0) { in ParseVirtualSensorInfo()
297 } else if (sensor["Formula"].asString().compare("MINIMUM") == 0) { in ParseVirtualSensorInfo()
299 } else if (sensor["Formula"].asString().compare("USE_ML_MODEL") == 0) { in ParseVirtualSensorInfo()
301 } else if (sensor["Formula"].asString().compare("USE_LINEAR_MODEL") == 0) { in ParseVirtualSensorInfo()
308 values = sensor["CombinationType"]; in ParseVirtualSensorInfo()
335 values = sensor["Coefficient"]; in ParseVirtualSensorInfo()
352 values = sensor["CoefficientType"]; in ParseVirtualSensorInfo()
385 if (!sensor["Offset"].empty()) { in ParseVirtualSensorInfo()
386 offset = sensor["Offset"].asFloat(); in ParseVirtualSensorInfo()
389 if (!sensor["BackupSensor"].empty()) { in ParseVirtualSensorInfo()
390 backup_sensor = sensor["BackupSensor"].asString(); in ParseVirtualSensorInfo()
393 values = sensor["TriggerSensor"]; in ParseVirtualSensorInfo()
417 if (sensor["ModelPath"].empty()) { in ParseVirtualSensorInfo()
435 vt_estimator_model_file = "vendor/etc/" + sensor["ModelPath"].asString(); in ParseVirtualSensorInfo()
438 if (!ParseOffsetThresholds(name, sensor, &init_data.ml_model_init_data.offset_thresholds, in ParseVirtualSensorInfo()
444 if (!sensor["PreviousSampleCount"].empty()) { in ParseVirtualSensorInfo()
446 init_data.ml_model_init_data.prev_samples_order = sensor["PreviousSampleCount"].asInt(); in ParseVirtualSensorInfo()
451 if (!sensor["OutputLabelCount"].empty()) { in ParseVirtualSensorInfo()
452 init_data.ml_model_init_data.output_label_count = sensor["OutputLabelCount"].asInt(); in ParseVirtualSensorInfo()
457 if (!sensor["PredictHotSpotCount"].empty()) { in ParseVirtualSensorInfo()
458 init_data.ml_model_init_data.num_hot_spots = sensor["PredictHotSpotCount"].asInt(); in ParseVirtualSensorInfo()
463 if (sensor["ValidateInput"].asBool()) { in ParseVirtualSensorInfo()
468 if (sensor["SupportUnderSampling"].asBool()) { in ParseVirtualSensorInfo()
507 if (!ParseOffsetThresholds(name, sensor, in ParseVirtualSensorInfo()
544 bool ParsePredictorInfo(const std::string_view name, const Json::Value &sensor, in ParsePredictorInfo() argument
546 Json::Value predictor = sensor["PredictorInfo"]; in ParsePredictorInfo()
829 const std::string_view name, const Json::Value &sensor, bool *support_throttling, in ParseSensorThrottlingInfo() argument
857 if (!sensor["PIDInfo"].empty()) { in ParseSensorThrottlingInfo()
860 if (sensor["PIDInfo"]["K_Po"].empty() || in ParseSensorThrottlingInfo()
861 !getFloatFromJsonValues(sensor["PIDInfo"]["K_Po"], &k_po, false, false)) { in ParseSensorThrottlingInfo()
867 if (sensor["PIDInfo"]["K_Pu"].empty() || in ParseSensorThrottlingInfo()
868 !getFloatFromJsonValues(sensor["PIDInfo"]["K_Pu"], &k_pu, false, false)) { in ParseSensorThrottlingInfo()
874 if (sensor["PIDInfo"]["K_I"].empty() || in ParseSensorThrottlingInfo()
875 !getFloatFromJsonValues(sensor["PIDInfo"]["K_I"], &k_i, false, false)) { in ParseSensorThrottlingInfo()
881 if (sensor["PIDInfo"]["K_D"].empty() || in ParseSensorThrottlingInfo()
882 !getFloatFromJsonValues(sensor["PIDInfo"]["K_D"], &k_d, false, false)) { in ParseSensorThrottlingInfo()
888 if (sensor["PIDInfo"]["I_Max"].empty() || in ParseSensorThrottlingInfo()
889 !getFloatFromJsonValues(sensor["PIDInfo"]["I_Max"], &i_max, false, false)) { in ParseSensorThrottlingInfo()
895 if (sensor["PIDInfo"]["MaxAllocPower"].empty() || in ParseSensorThrottlingInfo()
896 !getFloatFromJsonValues(sensor["PIDInfo"]["MaxAllocPower"], &max_alloc_power, false, in ParseSensorThrottlingInfo()
903 if (sensor["PIDInfo"]["MinAllocPower"].empty() || in ParseSensorThrottlingInfo()
904 !getFloatFromJsonValues(sensor["PIDInfo"]["MinAllocPower"], &min_alloc_power, false, in ParseSensorThrottlingInfo()
910 if (sensor["PIDInfo"]["S_Power"].empty() || in ParseSensorThrottlingInfo()
911 !getFloatFromJsonValues(sensor["PIDInfo"]["S_Power"], &s_power, false, true)) { in ParseSensorThrottlingInfo()
916 if (sensor["PIDInfo"]["I_Cutoff"].empty() || in ParseSensorThrottlingInfo()
917 !getFloatFromJsonValues(sensor["PIDInfo"]["I_Cutoff"], &i_cutoff, false, false)) { in ParseSensorThrottlingInfo()
922 if (!sensor["PIDInfo"]["I_Default"].empty() && in ParseSensorThrottlingInfo()
923 !sensor["PIDInfo"]["I_Default_Pct"].empty()) { in ParseSensorThrottlingInfo()
928 if (!sensor["PIDInfo"]["I_Default"].empty()) { in ParseSensorThrottlingInfo()
929 i_default = getFloatFromValue(sensor["PIDInfo"]["I_Default"]); in ParseSensorThrottlingInfo()
931 } else if (!sensor["PIDInfo"]["I_Default_Pct"].empty()) { in ParseSensorThrottlingInfo()
932 i_default_pct = getFloatFromValue(sensor["PIDInfo"]["I_Default_Pct"]); in ParseSensorThrottlingInfo()
935 tran_cycle = getFloatFromValue(sensor["PIDInfo"]["TranCycle"]); in ParseSensorThrottlingInfo()
962 if (!ParseBindedCdevInfo(sensor["BindedCdevInfo"], &binded_cdev_info_map, support_pid, in ParseSensorThrottlingInfo()
970 values = sensor["Profile"]; in ParseSensorThrottlingInfo()
1008 values = sensor["ExcludedPowerInfo"]; in ParseSensorThrottlingInfo()
1721 const std::string &sensor = values[j].asString(); in ParseSensorAbnormalStatsConfig() local
1722 if (!sensor_info_map_.count(sensor)) { in ParseSensorAbnormalStatsConfig()
1723 LOG(ERROR) << "Unknown sensor " << sensor; in ParseSensorAbnormalStatsConfig()
1726 auto result = sensors_parsed.insert(sensor); in ParseSensorAbnormalStatsConfig()
1728 LOG(ERROR) << "Duplicate Sensor Temp Range Config: " << sensor; in ParseSensorAbnormalStatsConfig()
1731 LOG(INFO) << "Monitored sensor [" << j << "]: " << sensor; in ParseSensorAbnormalStatsConfig()
1732 sensors_temp_range_info.sensors.push_back(sensor); in ParseSensorAbnormalStatsConfig()
1771 const std::string &sensor = values[j].asString(); in ParseSensorAbnormalStatsConfig() local
1772 if (!sensor_info_map_.count(sensor)) { in ParseSensorAbnormalStatsConfig()
1773 LOG(ERROR) << "Unknown sensor " << sensor; in ParseSensorAbnormalStatsConfig()
1776 auto result = sensors_parsed.insert(sensor); in ParseSensorAbnormalStatsConfig()
1778 LOG(ERROR) << "Duplicate Sensor Temp Stuck Config: " << sensor; in ParseSensorAbnormalStatsConfig()
1781 LOG(INFO) << "Monitored sensor [" << j << "]: " << sensor; in ParseSensorAbnormalStatsConfig()
1782 sensor_temp_stuck_info.sensors.push_back(sensor); in ParseSensorAbnormalStatsConfig()