replace popen in detect_cpu with file parsing approach