From f33d2e4d0cd74bfaaee310e44b5b3eda89a3e723 Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Tue, 10 Jul 2018 12:33:31 +0100 Subject: [PATCH 1/2] tests/preliminary: Check the ENERGY_AWARE sched feature When the ENERGY_AWARE sched_feature is present in the kernel, it should be set before starting EAS tests. Check if the configuration is correct in the 'preliminary.py' test. Signed-off-by: Quentin Perret --- tests/eas/preliminary.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/eas/preliminary.py b/tests/eas/preliminary.py index 2aa6d6099..058cbad87 100644 --- a/tests/eas/preliminary.py +++ b/tests/eas/preliminary.py @@ -323,3 +323,14 @@ class TestSchedDomainFlags(BasicCheckTest): finally: self.write_cpu_caps(old_caps) self._test_asym_cpucapacity(old_caps, old_caps_asym) + + def test_sched_feat(self): + """ + Check that ENERGY_AWARE is set if it is present. + """ + path = '/sys/kernel/debug/sched_features' + sf = self.target.read_value(path) + if 'ENERGY_AWARE' not in sf: + raise SkipTest('ENERGY_AWARE sched feature not present') + if 'NO_ENERGY_AWARE' in sf: + raise AssertionError('ENERGY_AWARE sched feature is not set') -- GitLab From e02a478da98bddd22fc2ede0534b2df61deab93d Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Tue, 10 Jul 2018 12:47:47 +0100 Subject: [PATCH 2/2] tests/preliminary: Fix the EM check with simplified model With the Simplified Energy Model, the location of the EM in sysfs has changed. Fix the test in preliminary.py to support both flavors by checking the two possible paths. Signed-off-by: Quentin Perret --- tests/eas/preliminary.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/eas/preliminary.py b/tests/eas/preliminary.py index 058cbad87..fee9ae692 100644 --- a/tests/eas/preliminary.py +++ b/tests/eas/preliminary.py @@ -181,8 +181,10 @@ class TestWorkThroughput(BasicCheckTest): class TestEnergyModelPresent(BasicCheckTest): def test_energy_model_present(self): """Test that we can see the energy model in sysctl""" - if not self.target.file_exists( - '/proc/sys/kernel/sched_domain/cpu0/domain0/group0/energy/'): + em_path = '/proc/sys/kernel/sched_domain/cpu0/domain0/group0/energy/' + sem_path = '/sys/devices/system/cpu/energy_model' + if not (self.target.file_exists(em_path) or + self.target.file_exists(sem_path)): raise AssertionError( 'No energy model visible in procfs. Possible causes: \n' '- Kernel built without (CONFIG_SCHED_DEBUG && CONFIG_SYSCTL)\n' -- GitLab