Snap for 9173498 from 7f2a1321a2
to tm-qpr2-release
Change-Id: I6b7595c4e71da91f30df89a1bcf74843c4e6d84d
This commit is contained in:
commit
2a2c8321c4
4 changed files with 103 additions and 22 deletions
|
@ -61,13 +61,31 @@ const struct MitigationConfig::Config cfg = {
|
|||
"voltage_now", "current_now",
|
||||
},
|
||||
.LogFilePath = "/data/vendor/mitigation/thismeal.txt",
|
||||
.TimestampFormat = "%Y-%m-%d %H:%M:%S",
|
||||
};
|
||||
|
||||
const char kReadyFilePath[] = "/sys/devices/virtual/pmic/mitigation/instruction/ready";
|
||||
const char kReadyProperty[] = "vendor.brownout.mitigation.ready";
|
||||
const char kLastMealPath[] = "/data/vendor/mitigation/lastmeal.txt";
|
||||
const char kBRRequestedProperty[] = "vendor.startup_bugreport_requested";
|
||||
const std::regex kTimestampRegex("^\\S+\\s[0-9]+:[0-9]+:[0-9]+\\S+$");
|
||||
|
||||
int main(int /*argc*/, char ** /*argv*/) {
|
||||
auto batteryMitigationStartTime = std::chrono::system_clock::now();
|
||||
bmSp = new BatteryMitigation(cfg);
|
||||
if (!bmSp) {
|
||||
return 0;
|
||||
}
|
||||
bool mitigationLogTimeValid = bmSp->isMitigationLogTimeValid(batteryMitigationStartTime,
|
||||
cfg.LogFilePath,
|
||||
cfg.TimestampFormat,
|
||||
kTimestampRegex);
|
||||
int startupBugreport = android::base::GetIntProperty(kBRRequestedProperty, 0);
|
||||
if (startupBugreport && mitigationLogTimeValid) {
|
||||
std::ifstream src(cfg.LogFilePath, std::ios::in);
|
||||
std::ofstream dst(kLastMealPath, std::ios::out);
|
||||
dst << src.rdbuf();
|
||||
}
|
||||
bool isBatteryMitigationReady = false;
|
||||
std::string ready_str;
|
||||
int val = 0;
|
||||
|
|
|
@ -1,24 +1,92 @@
|
|||
on property:sys.boot_completed=1 && property:ro.boot.bootreason=reboot,ocp,pmic,if
|
||||
copy data/vendor/mitigation/thismeal.txt data/vendor/mitigation/lastmeal.txt
|
||||
chown system system data/vendor/mitigation/lastmeal.txt
|
||||
|
||||
on property:sys.boot_completed=1 && property:ro.boot.bootreason=reboot,uvlo,pmic,if
|
||||
copy data/vendor/mitigation/thismeal.txt data/vendor/mitigation/lastmeal.txt
|
||||
chown system system data/vendor/mitigation/lastmeal.txt
|
||||
|
||||
on property:sys.boot_completed=1 && property:ro.boot.bootreason=reboot,uvlo,pmic,main
|
||||
copy data/vendor/mitigation/thismeal.txt data/vendor/mitigation/lastmeal.txt
|
||||
chown system system data/vendor/mitigation/lastmeal.txt
|
||||
|
||||
on property:sys.boot_completed=1 && property:ro.boot.bootreason=reboot,uvlo,pmic,sub
|
||||
copy data/vendor/mitigation/thismeal.txt data/vendor/mitigation/lastmeal.txt
|
||||
chown system system data/vendor/mitigation/lastmeal.txt
|
||||
|
||||
on property:vendor.thermal.link_ready=1
|
||||
mkdir /data/vendor/mitigation 0755 system system
|
||||
chown system system /data/vendor/mitigation
|
||||
start vendor.battery_mitigation
|
||||
|
||||
on property:ro.boot.bootreason=reboot,uvlo,pmic,if
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,pmic,if
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,uvlo,pmic,main
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,uvlo,pmic,sub
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck1m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck2m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck3m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck4m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck5m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck6m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck7m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck8m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck9m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck10m
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck1s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck2s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck3s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck4s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck5s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck6s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck7s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck8s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck9s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buck10s
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buckds
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buckas
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buckcs
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
on property:ro.boot.bootreason=reboot,ocp,buckbs
|
||||
setprop vendor.startup_bugreport_requested 1
|
||||
|
||||
service vendor.battery_mitigation /vendor/bin/hw/battery_mitigation
|
||||
user system
|
||||
group system
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>com.google.hardware.pixel.display</name>
|
||||
<version>6</version>
|
||||
<version>7</version>
|
||||
<interface>
|
||||
<name>IDisplay</name>
|
||||
<instance>default</instance>
|
||||
|
|
|
@ -318,7 +318,6 @@ void addGPU(std::shared_ptr<PowerStats> p) {
|
|||
|
||||
// TODO (b/197721618): Measuring the GPU power numbers
|
||||
stateCoeffs = {
|
||||
{"151000", 642},
|
||||
{"202000", 890},
|
||||
{"251000", 1102},
|
||||
{"302000", 1308},
|
||||
|
@ -614,10 +613,6 @@ void addCommonDataProviders(std::shared_ptr<PowerStats> p) {
|
|||
addPowerDomains(p);
|
||||
addDevfreq(p);
|
||||
addTPU(p);
|
||||
|
||||
// TODO (b/181070764) (b/182941084):
|
||||
// Remove this when Wifi/BT energy consumption models are available or revert before ship
|
||||
addPlaceholderEnergyConsumers(p);
|
||||
}
|
||||
|
||||
void addGs201CommonDataProviders(std::shared_ptr<PowerStats> p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue