13value =
int(sys.argv[3])
15log = subprocess.check_output([ADB,
'root']).
decode(
'utf-8')
19 raise Exception(
'adb root failed')
23prior_status = subprocess.check_output([ADB,
'shell',
'cat '
24 '/sys/devices/system/cpu/cpu%d/online' % cpu]).
decode(
'utf-8').strip()
25if prior_status == str(value):
26 print(
'CPU %d online already %d' % (cpu, value))
29subprocess.check_call([ADB,
'shell',
'echo %s > '
30 '/sys/devices/system/cpu/cpu%d/online' % (value, cpu)])
31actual_status = subprocess.check_output([ADB,
'shell',
'cat '
32 '/sys/devices/system/cpu/cpu%d/online' % cpu]).
decode(
'utf-8').strip()
33if actual_status != str(value):
34 raise Exception(
'(actual, expected) (%s, %d)' % (actual_status, value))
def print(*args, **kwargs)
static DecodeResult decode(std::string path)