Chromium Code Reviews| Index: build/android/pylib/cache_control.py |
| diff --git a/build/android/pylib/cache_control.py b/build/android/pylib/cache_control.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6deaae382eb42705f26f82c008d41890bcfa7f67 |
| --- /dev/null |
| +++ b/build/android/pylib/cache_control.py |
| @@ -0,0 +1,18 @@ |
| +# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
|
frankf
2013/09/16 18:09:23
Can we move all perf-specific modules to perf/ dir
dtu
2013/09/16 18:36:59
Feel free to put them in telemetry/core/platform/a
bulach
2013/09/16 19:51:10
good point, moved to build/android/pylib/perf
rea
|
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import android_commands |
| + |
| + |
| +class CacheControl(object): |
| + _DROP_CACHES = '/proc/sys/vm/drop_caches' |
| + |
| + def __init__(self, adb): |
| + self._adb = adb |
| + |
| + def DropRamCaches(self): |
| + """Drops the filesystem ram caches for performance testing.""" |
| + self._adb.RunShellCommand('su -c sync') |
|
frankf
2013/09/16 18:09:23
Can we add a RunShellCommandAsRoot('sync')?
It hel
bulach
2013/09/16 19:51:10
Done.
|
| + self._adb.SetProtectedFileContents(CacheControl._DROP_CACHES, '3') |
| + |