Bug 613367: Log relevant data when computing JIT-brokenness. r=dvander a=2.0

This commit is contained in:
Chris Jones 2010-11-18 20:27:44 -06:00
Родитель 4cecd77666
Коммит a4fe52e73f
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -46,6 +46,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef ANDROID
# include <android/log.h>
# include <fstream>
# include <string>
#endif // ANDROID
@ -2221,12 +2222,17 @@ ComputeIsJITBroken()
// Check for the known-bad kernel version (2.6.29).
std::ifstream osrelease("/proc/sys/kernel/osrelease");
std::getline(osrelease, line);
__android_log_print(ANDROID_LOG_INFO, "Gecko", "Detected osrelease `%s'",
line.c_str());
if (line.npos == line.find("2.6.29")) {
// We're using something other than 2.6.29, so the JITs should work.
__android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are not broken");
return false;
}
// We're using 2.6.29, and this causes trouble with the JITs on i9000.
line = "";
bool broken = false;
std::ifstream cpuinfo("/proc/cpuinfo");
do {
@ -2241,6 +2247,8 @@ ComputeIsJITBroken()
};
for (const char** hw = &blacklist[0]; *hw; ++hw) {
if (line.npos != line.find(*hw)) {
__android_log_print(ANDROID_LOG_INFO, "Gecko",
"Blacklisted device `%s'", *hw);
broken = true;
break;
}
@ -2249,6 +2257,10 @@ ComputeIsJITBroken()
}
std::getline(cpuinfo, line);
} while(!cpuinfo.fail() && !cpuinfo.eof());
__android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are %sbroken",
broken ? "" : "not ");
return broken;
#endif // ifndef ANDROID
}