12target_percent =
float(sys.argv[2])
14log = subprocess.check_output([ADB,
'root']).
decode(
'utf-8')
18 raise Exception(
'adb root failed')
20root =
'/sys/devices/system/cpu/cpu%d/cpufreq' %cpu
23available_freqs = subprocess.check_output([ADB,
'shell',
24 'cat %s/scaling_available_frequencies' % root]).
decode(
'utf-8')
27if available_freqs
and '/system/bin/sh' not in available_freqs:
28 available_freqs = sorted(
29 int(i)
for i
in available_freqs.strip().split())
31 raise Exception(
'Could not get list of available frequencies: %s' %
34maxfreq = available_freqs[-1]
37for f
in reversed(available_freqs):
42print(
'Setting frequency to %d' % freq)
48subprocess.check_call([ADB,
'shell',
'echo 0 > '
49 '%s/scaling_min_freq' % root])
50subprocess.check_call([ADB,
'shell',
'echo %d > '
51 '%s/scaling_max_freq' % (freq, root)])
52subprocess.check_call([ADB,
'shell',
'echo %d > '
53 '%s/scaling_setspeed' % (freq, root)])
55actual_freq = subprocess.check_output([ADB,
'shell',
'cat '
56 '%s/scaling_cur_freq' % root]).
decode(
'utf-8').strip()
57if actual_freq != str(freq):
58 raise Exception(
'(actual, expected) (%s, %d)'
59 % (actual_freq, freq))
static void round(SkPoint *p)
def print(*args, **kwargs)
static DecodeResult decode(std::string path)