Merge changes from topic "kernel5_revision" into main

* changes:
  bcl: correct ocp threshold
  bcl: support thismeal binary
This commit is contained in:
Sam Ou 2024-08-23 10:58:35 +00:00 committed by Android (Google) Code Review
commit 5ba25e00d7
4 changed files with 26 additions and 0 deletions

View file

@ -21,7 +21,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/sysinfo.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <vector>
#include <android-base/file.h>
@ -629,10 +631,27 @@ void dumpGvoteables() {
void dumpMitigation() {
const char *mitigationList [][2] {
{"LastmealCSV" , "/data/vendor/mitigation/lastmeal.csv"},
{"Lastmeal" , "/data/vendor/mitigation/lastmeal.txt"},
{"Thismeal" , "/data/vendor/mitigation/thismeal.txt"},
};
/* parsing thismeal.bin */
int status;
int pid = fork();
if (pid < 0) {
printf("Fork failed for parsing thismeal.bin.\n");
exit(EXIT_FAILURE);
} else if (pid == 0) {
execl("/vendor/bin/hw/battery_mitigation", "battery_mitigation", "-d", nullptr);
exit(EXIT_SUCCESS);
}
waitpid(pid, &status, 0);
if (WIFSIGNALED(status)) {
printf("Failed to parse thismeal.bin.(killed by: %d)\n", WTERMSIG(status));
}
for (auto &row : mitigationList) {
if (!isValidFile(row[1]))
printTitle(row[0]);