From c7845536383552f9575c7136874fe3b7e27c6f8b Mon Sep 17 00:00:00 2001 From: Valentin Schneider Date: Fri, 7 Dec 2018 14:16:15 +0000 Subject: [PATCH 1/2] tests: misfit: Fix sched domain flag check --- lisa/tests/kernel/scheduler/misfit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisa/tests/kernel/scheduler/misfit.py b/lisa/tests/kernel/scheduler/misfit.py index a10c3d873..3effb1b2d 100644 --- a/lisa/tests/kernel/scheduler/misfit.py +++ b/lisa/tests/kernel/scheduler/misfit.py @@ -17,7 +17,7 @@ import pandas as pd -from devlib.module.sched import SchedDomain +from devlib.module.sched import SchedDomain, SchedDomainFlag from lisa.utils import memoized, ArtifactPath from lisa.trace import Trace @@ -51,7 +51,7 @@ class MisfitMigrationBase(RTATestBundle): for cpu, domain_node in sd_info.cpus.items(): for domain in domain_node.domains.values(): - if domain.has_flags(SchedDomain.SD_ASYM_CPUCAPACITY): + if SchedDomainFlag.SD_ASYM_CPUCAPACITY in domain.flags: return True return False -- GitLab From b94729a3f8cfc00657bda70f85c2fac2a59f0f1f Mon Sep 17 00:00:00 2001 From: Valentin Schneider Date: Fri, 7 Dec 2018 14:51:17 +0000 Subject: [PATCH 2/2] tools: Add a sched domain flag reader Running this on my HiKey960 gives me the following result: ./tools/scripts/get_sd_flags.py --kind linux --host x.x.x.x --username xxx --password xxx Module devfreq is not supported by the target Module fastboot is not supported by the target Module gem5stats is not supported by the target Module gpufreq is not supported by the target Module odroidxu3-fan is not supported by the target Failed to initialized "devfreq" devlib Module Failed to initialized "fastboot" devlib Module Failed to initialized "gem5stats" devlib Module Failed to initialized "gpufreq" devlib Module Failed to initialized "mbed-fan" devlib Module Failed to initialized "odroidxu3-fan" devlib Module Couldn't read target energy model: Unable to probe for energy model on target. == CPU0 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup == CPU1 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup == CPU2 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup == CPU3 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup == CPU4 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup == CPU5 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup == CPU6 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup == CPU7 == MC level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_SHARE_PKG_RESOURCES - Domain members share cpu pkg resources SD_BALANCE_EXEC - Balance on exec SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup DIE level SD_WAKE_AFFINE - Wake task to waking CPU SD_LOAD_BALANCE - Do load balancing on this domain SD_BALANCE_NEWIDLE - Balance when about to become idle SD_ASYM_CPUCAPACITY - Groups have different max cpu capacities SD_BALANCE_EXEC - Balance on exec SD_PREFER_SIBLING - Prefer to place tasks in a sibling domain SD_BALANCE_FORK - Balance on fork, clone SD_BALANCE_WAKE - Balance on wakeup --- tools/scripts/get_sd_flags.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tools/scripts/get_sd_flags.py diff --git a/tools/scripts/get_sd_flags.py b/tools/scripts/get_sd_flags.py new file mode 100755 index 000000000..4a9576205 --- /dev/null +++ b/tools/scripts/get_sd_flags.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2018, Arm Limited and contributors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from lisa.env import TestEnv +from devlib.module.sched import SchedDomain + +te = TestEnv.from_cli() + +sd_info = te.target.sched.get_sd_info() + +for cpuid, cpu in sd_info.cpus.items(): + print("== CPU{} ==".format(cpuid)) + for domain in cpu.domains.values(): + print("\t{} level".format(domain.name)) + for flag in domain.flags: + print("\t\t{} - {}".format(flag.name, flag.__doc__)) -- GitLab