Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <<<<<<< HEAD
- * Processor : ARMv7 Processor rev 2 (v7l)
- * BogoMIPS : 272.62
- * BogoMIPS : 272.62
- *
- * On kernel 3.10 this changed, it is now the last
- * line. So let's read the whole thing, search
- * specifically for "Processor" or "model name"
- * and retain the old
- * "first line" as fallback.
- * Also, use "processor : <id>" to count cores
- */
- BufferedReader ci = new BufferedReader(new FileReader(FILENAME_PROC_CPUINFO));
- String firstLine = ci.readLine();
- String latestLine = firstLine;
- while (latestLine != null) {
- if (latestLine.startsWith("Processor")
- || latestLine.startsWith("model name"))
- result = latestLine.split(":")[1].trim();
- if (latestLine.startsWith("processor"))
- coreCount++;
- latestLine = ci.readLine();
- }
- if (result == null && firstLine != null) {
- result = firstLine.split(":")[1].trim();
- }
- /* Don't do this. hotplug throws off the count
- if (coreCount > 1) {
- result = result + " (x" + coreCount + ")";
- }
- */
- ci.close();
- =======
- * Processor : ARMv7 Processor rev 2 (v7l)
- * BogoMIPS : 272.62
- *
- * This needs updating, since
- *
- * Hammerhead output :
- * Processor : ARMv7 Processor rev 0 (v7l)
- * processor : 0
- * BogoMIPS : xxx
- *
- * Shamu output :
- * processor : 0
- * model name : ARMv7 Processor rev 1 (v7l)
- * BogoMIPS : xxx
- *
- * Continue reading the file until running into a line starting
- * with either "model name" or "Processor" to meet both
- */
- BufferedReader reader = new BufferedReader(new FileReader(FILENAME_PROC_CPUINFO), 256);
- String Line = reader.readLine();
- while (Line != null) {
- if (Line.indexOf("model name") == -1 &&
- Line.indexOf("Processor" ) == -1 ) {
- Line = reader.readLine();
- } else {
- result = Line.split(":")[1].trim();
- break;
- }
- }
- reader.close();
- >>>>>>> slim/lp5.0
Advertisement
Add Comment
Please, Sign In to add comment