Snap for 11967491 from a7d868694f to 24Q3-release

Change-Id: I3094e468403f2bc4e47135891064f89496b28aee
This commit is contained in:
Android Build Coastguard Worker 2024-06-13 23:03:30 +00:00
commit ced78afd78
2 changed files with 39 additions and 1 deletions

View file

@ -776,6 +776,11 @@ void dumpMitigationDirs() {
};
const int eraseCnt[] = {6, 6, 4, 0};
const bool useTitleRow[] = {true, true, true, false};
const char *vimon_name = "vimon_buff";
const char delimiter = '\n';
const int vimon_len = strlen(vimon_name);
const double VIMON_VMULT = 7.8122e-5;
const double VIMON_IMULT = 7.8125e-4;
std::vector<std::string> files;
std::string content;
@ -783,6 +788,9 @@ void dumpMitigationDirs() {
std::string source;
std::string subModuleName;
std::string readout;
char *endptr;
bool vimon_found = false;
for (int i = 0; i < paramCount; i++) {
printTitle(titles[i]);
@ -800,11 +808,40 @@ void dumpMitigationDirs() {
readout = android::base::Trim(content);
if (strncmp(file.c_str(), vimon_name, vimon_len) == 0)
vimon_found = true;
subModuleName = std::string(file);
subModuleName.erase(subModuleName.find(paramSuffix[i]), eraseCnt[i]);
if (useTitleRow[i]) {
printf("%s \t%s\n", subModuleName.c_str(), readout.c_str());
} else if (vimon_found) {
std::vector<std::string> tokens;
std::istringstream tokenStream(readout);
std::string token;
while (std::getline(tokenStream, token, delimiter)) {
tokens.push_back(token);
}
bool oddEntry = true;
for (auto &hexval : tokens) {
int val = strtol(hexval.c_str(), &endptr, 16);
if (*endptr != '\0') {
printf("invalid vimon readout\n");
break;
}
if (oddEntry) {
int vbatt = int(1000 * (val * VIMON_VMULT));
printf("vimon vbatt: %d ", vbatt);
} else {
int ibatt = int(1000 * (val * VIMON_IMULT));
printf("ibatt: %d\n", ibatt);
}
oddEntry = !oddEntry;
}
} else {
printf("%s=%s\n", subModuleName.c_str(), readout.c_str());
}

View file

@ -130,7 +130,8 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
"/sys/devices/platform/exynos-drm/primary-panel/error_count_unknown",
"/sys/devices/platform/exynos-drm/secondary-panel/error_count_te",
"/sys/devices/platform/exynos-drm/secondary-panel/error_count_unknown",
}
},
.SpeakerVersionPath = "/sys/devices/platform/audiometrics/speaker_version"
};
const struct UeventListener::UeventPaths ueventPaths = {