From patchwork Fri Jan 24 13:05:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Singh Rawat X-Patchwork-Id: 23674 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BDAEF203C5 for ; Fri, 24 Jan 2014 13:06:16 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id ar20sf8152022iec.9 for ; Fri, 24 Jan 2014 05:06:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ofP372rzrFNglBUeHilhEhZlCC7ou/ijRA9EQwtRjdQ=; b=DIty8i4szJa0Czy/wYnfdz5T/8CCXmAD8wUnNkWUU95An8htjy6X49WocvW7OLPrbx emR/K5me72XFNw8wcR9z41JbPW06kvTGOahv3bvTcclYk3yckxrUTu60M0P4KSAxYj1T c6grq4okxU+x5CuirWFA2gGMmGeBX7LaULGeHYlw9CTzIa/jPwelxuyxBidEgAhRcRlV UKxU9TtgIinzR9/aNp15SUwFlHVqYCWMWvC2m+Nrj5OnSrpq0GSl+oinR8K6ozHYCOjh qOLoHgZnMvJYmoZFC62txLKDu8BHL2yrS90JzJXxfB4/5736UD4sj/o64/fh2Dr99/Aj cwCw== X-Gm-Message-State: ALoCoQleCOdKOAP0iMqC2FpdsWb2qzz54LLwI7ZouO8Utk6cBO4jvbR8Vz+GzvImW44V2V4Unl2e X-Received: by 10.43.100.129 with SMTP id cw1mr4337883icc.30.1390568776019; Fri, 24 Jan 2014 05:06:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.54 with SMTP id q51ls563240qgd.99.gmail; Fri, 24 Jan 2014 05:06:15 -0800 (PST) X-Received: by 10.58.80.103 with SMTP id q7mr7609543vex.33.1390568775900; Fri, 24 Jan 2014 05:06:15 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id x5si461069veb.149.2014.01.24.05.06.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 05:06:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so1950654veb.30 for ; Fri, 24 Jan 2014 05:06:15 -0800 (PST) X-Received: by 10.58.219.1 with SMTP id pk1mr4448vec.49.1390568775824; Fri, 24 Jan 2014 05:06:15 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp100893vcz; Fri, 24 Jan 2014 05:06:15 -0800 (PST) X-Received: by 10.66.227.200 with SMTP id sc8mr14234494pac.35.1390568774927; Fri, 24 Jan 2014 05:06:14 -0800 (PST) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id tq3si1128949pab.125.2014.01.24.05.06.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 05:06:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of sanjay.rawat@linaro.org) client-ip=209.85.160.53; Received: by mail-pb0-f53.google.com with SMTP id md12so3209534pbc.26 for ; Fri, 24 Jan 2014 05:06:14 -0800 (PST) X-Received: by 10.66.191.42 with SMTP id gv10mr14156114pac.125.1390568774512; Fri, 24 Jan 2014 05:06:14 -0800 (PST) Received: from srawat-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id ug2sm7080653pac.21.2014.01.24.05.06.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 05:06:13 -0800 (PST) From: Sanjay Singh Rawat To: private-pmwg@linaro.org Cc: Sanjay Singh Rawat Subject: [PATCH pmqa] cpuidle: check feature enabled before starting Date: Fri, 24 Jan 2014 18:35:59 +0530 Message-Id: <1390568759-21594-1-git-send-email-sanjay.rawat@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sanjay.rawat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Sanjay Singh Rawat --- As ubuntu and android have their own way of invoking the tests. Better to have a function call in each script, to check for the feature state. regards, sanjay --- cpuidle/cpuidle_01.sh | 6 ++++++ cpuidle/cpuidle_02.sh | 6 ++++++ cpuidle/cpuidle_03.sh | 6 ++++++ cpuidle/cpuidle_04.sh | 6 ++++++ include/functions.sh | 4 ++++ 5 files changed, 28 insertions(+) mode change 100644 => 100755 cpuidle/cpuidle_04.sh diff --git a/cpuidle/cpuidle_01.sh b/cpuidle/cpuidle_01.sh index 8aa62c2..b4260fa 100755 --- a/cpuidle/cpuidle_01.sh +++ b/cpuidle/cpuidle_01.sh @@ -30,6 +30,12 @@ source ../include/functions.sh STATES="desc latency name power time usage" FILES="current_driver current_governor_ro" +cpuidle_enabled +if [ $? -ne 0 ]; then + log_skip "cpuidle not supported" + exit 0 +fi + check_cpuidle_state_files() { local dirpath=$CPU_PATH/$1/cpuidle diff --git a/cpuidle/cpuidle_02.sh b/cpuidle/cpuidle_02.sh index 77261c4..670f3f5 100755 --- a/cpuidle/cpuidle_02.sh +++ b/cpuidle/cpuidle_02.sh @@ -29,6 +29,12 @@ source ../include/functions.sh CPUIDLE_KILLER=./cpuidle_killer +cpuidle_enabled +if [ $? -ne 0 ]; then + log_skip "cpuidle not supported" + exit 0 +fi + is_root if [ $? -ne 0 ]; then log_skip "user is not root" diff --git a/cpuidle/cpuidle_03.sh b/cpuidle/cpuidle_03.sh index 645a94d..5231d9d 100755 --- a/cpuidle/cpuidle_03.sh +++ b/cpuidle/cpuidle_03.sh @@ -29,6 +29,12 @@ source ../include/functions.sh CPUIDLE_KILLER=./cpuidle_killer +cpuidle_enabled +if [ $? -ne 0 ]; then + log_skip "cpuidle not supported" + exit 0 +fi + is_root if [ $? -ne 0 ]; then log_skip "user is not root" diff --git a/cpuidle/cpuidle_04.sh b/cpuidle/cpuidle_04.sh old mode 100644 new mode 100755 index 028b3ee..5814653 --- a/cpuidle/cpuidle_04.sh +++ b/cpuidle/cpuidle_04.sh @@ -27,6 +27,12 @@ source ../include/functions.sh CPUIDLE_STATS=./cpuidle_stats +cpuidle_enabled +if [ $? -ne 0 ]; then + log_skip "cpuidle not supported" + exit 0 +fi + is_root if [ $? -ne 0 ]; then log_skip "user is not root" diff --git a/include/functions.sh b/include/functions.sh index 728f186..2a9cf21 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -349,6 +349,10 @@ cpufreq_enabled() { test -d /sys/devices/system/cpu/cpufreq } +cpuidle_enabled() { + test -d /sys/devices/system/cpu/cpuidle +} + # currently we support ubuntu and android get_os() { lsb_release -a 2>&1 | grep -i ubuntu > /dev/null