From cee685ca0d29b022e0665fccf58de006e7ffaef1 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 26 Apr 2016 13:18:13 +0300 Subject: oeqa.buildperf: functionality to drop kernel caches Add a new utility class for dropping Linux kernel caches. It uses sudo and tee to write to the drop_caches file. Checking if the user has the permissions to drop caches (without a password) is done by trying to writing an invalid value to the drop_caches file. This way, we will find if writing (with tee) is possible but not really dropping caches, yet. User can avoid giving the password by adding something like: ALL = NOPASSWD: /usr/bin/tee /proc/sys/vm/drop_caches to the system sudoers file. (From OE-Core rev: c9cb248429ced50c96d11ba5361c272d4c9b9323) Signed-off-by: Markus Lehtonen Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/oe-build-perf-test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/oe-build-perf-test') diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test index 9fb431045b..9589dee3ac 100755 --- a/scripts/oe-build-perf-test +++ b/scripts/oe-build-perf-test @@ -22,6 +22,7 @@ import sys sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib') import scriptpath scriptpath.add_oe_lib_path() +from oeqa.buildperf import KernelDropCaches from oeqa.utils.commands import runCmd @@ -71,6 +72,9 @@ def main(argv=None): if not pre_run_sanity_check(): return 1 + # Check our capability to drop caches and ask pass if needed + KernelDropCaches.check() + return 0 -- cgit v1.2.3-54-g00ecf