From patchwork Wed Jun 4 12:59:35 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: 31354 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A33ED203AC for ; Wed, 4 Jun 2014 12:59:53 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id uq10sf3194222igb.5 for ; Wed, 04 Jun 2014 05:59:53 -0700 (PDT) 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=hnexXe5O9nHRdeBkqj7dSnjOGFgHp/fYBAthNqeyEHU=; b=BeDmeCaW8b9/tLZGgq89Kh7dqeN8Ldc06sqAyQ3VjVUeKsXzOFZWkJNm2I6c+FG47y 4YigqfkFUsIF1aKbbIxL/2bd4mx1h2c/8uYNSQu/yHL6dhbThqU1kQDdUolMLT0v/wdc L5rvPM6Yf9KwWl/Lvq/7P+t4OnjeuWh3stjv5EGG+jVvtJ7U+ooImEmVLUILAwtSESxJ xrmuH0rZrKPEyTB8qCMKPpi9Y+XHt+KWnOsciTtX2LWDvxF1bmWYhTZ860I6fpyndtcN xFjD9Qmso+Q+D0DueVmPk30xYsq8RoxvmstMtodCVQx+Skm8E2nmgM8IDtghyknu9I2e R8xQ== X-Gm-Message-State: ALoCoQllZa/ecjX/wigTXCW8VJ6TF6FUwoJcrOVI8/V194VfEgid/c85BeCC1OfqS6HKBEQmQcML X-Received: by 10.182.135.167 with SMTP id pt7mr22651593obb.14.1401886792837; Wed, 04 Jun 2014 05:59:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.147 with SMTP id 19ls3123739qgp.68.gmail; Wed, 04 Jun 2014 05:59:52 -0700 (PDT) X-Received: by 10.52.13.98 with SMTP id g2mr12156740vdc.46.1401886792720; Wed, 04 Jun 2014 05:59:52 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id xs6si1484165vdb.0.2014.06.04.05.59.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Jun 2014 05:59:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id id10so8557306vcb.34 for ; Wed, 04 Jun 2014 05:59:52 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr43341594vcg.16.1401886792618; Wed, 04 Jun 2014 05:59:52 -0700 (PDT) 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.221.54.6 with SMTP id vs6csp42888vcb; Wed, 4 Jun 2014 05:59:52 -0700 (PDT) X-Received: by 10.68.197.134 with SMTP id iu6mr27425642pbc.164.1401886791840; Wed, 04 Jun 2014 05:59:51 -0700 (PDT) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id hj1si5616056pbc.142.2014.06.04.05.59.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Jun 2014 05:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of sanjay.rawat@linaro.org designates 209.85.160.45 as permitted sender) client-ip=209.85.160.45; Received: by mail-pb0-f45.google.com with SMTP id um1so6976713pbc.32 for ; Wed, 04 Jun 2014 05:59:51 -0700 (PDT) X-Received: by 10.68.197.8 with SMTP id iq8mr63653779pbc.124.1401886790491; Wed, 04 Jun 2014 05:59:50 -0700 (PDT) Received: from srawat-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id fx5sm9835597pbb.62.2014.06.04.05.59.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Jun 2014 05:59:49 -0700 (PDT) From: Sanjay Singh Rawat To: linaro-dev@lists.linaro.org Cc: private-pmwg@linaro.org, Sanjay Singh Rawat Subject: [PATCH PMQA] nohz: check cpus are in nohz mode Date: Wed, 4 Jun 2014 18:29:35 +0530 Message-Id: <1401886775-32179-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) 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: , check for the timer interrupt raised on cpu for duration of 3 seconds and report the mode Signed-off-by: Sanjay Singh Rawat --- Makefile | 2 ++ nohz/Makefile | 25 +++++++++++++++++++++ nohz/nohz_01.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ nohz/nohz_01.txt | 1 + 4 files changed, 92 insertions(+) create mode 100644 nohz/Makefile create mode 100755 nohz/nohz_01.sh create mode 100644 nohz/nohz_01.txt diff --git a/Makefile b/Makefile index 731619d..896497c 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ check: @(cd thermal; $(MAKE) check) # @(cd powertop; $(MAKE) check) @(cd cputopology; $(MAKE) check) + @(cd nohz; $(MAKE) check) uncheck: @(cd cpufreq; $(MAKE) uncheck) @@ -41,6 +42,7 @@ uncheck: @(cd cpuidle; $(MAKE) uncheck) # @(cd suspend; $(MAKE) uncheck) @(cd thermal; $(MAKE) uncheck) + @(cd nohz; $(MAKE) uncheck) recheck: uncheck check diff --git a/nohz/Makefile b/nohz/Makefile new file mode 100644 index 0000000..315ff6f --- /dev/null +++ b/nohz/Makefile @@ -0,0 +1,25 @@ +# +# PM-QA validation test suite for the power management on Linux +# +# Copyright (C) 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Sanjay Singh Rawat (LG Electronics) +# - initial API and implementation +# + +include ../Test.mk diff --git a/nohz/nohz_01.sh b/nohz/nohz_01.sh new file mode 100755 index 0000000..2828188 --- /dev/null +++ b/nohz/nohz_01.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +# PM-QA validation test suite for the power management on Linux +# +# Copyright (C) 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributors: +# Sanjay Singh Rawat (LG Electronics) +# - initial API and implementation +# + +# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#nohz_01 + +source ../include/functions.sh + +check_cpu_nohz_interrupt() { + local cpu=$1 + local cpuid=${cpu:3} + local ints= + local inte= + local i= + local diff= + + i=$(cat /proc/interrupts | grep time | wc -l) + if [ $i -ne 1 ]; then + echo "warning: multiple entry for timer interrupt :" $i + exit 1 + fi + + if [ "$cpu" == "cpu0" ]; then + return 0 + fi + + cpuid=$((cpuid+2)) + ints=$(cat /proc/interrupts | grep time | awk -v c=$cpuid '{ print $c }') + sleep 3 + inte=$(cat /proc/interrupts | grep time | awk -v c=$cpuid '{ print $c }') + + #echo $cpu "interrupts before" $ints "after" $inte + diff=$((inte-ints)) + + if [ $diff -eq 0 ]; then + echo $cpu "in NOHZ" + else + echo $cpu "not in NOHZ" + fi +} + +for_each_cpu check_cpu_nohz_interrupt +test_status_show diff --git a/nohz/nohz_01.txt b/nohz/nohz_01.txt new file mode 100644 index 0000000..0c547f5 --- /dev/null +++ b/nohz/nohz_01.txt @@ -0,0 +1 @@ +check each cpu is in nohz mode (wait 3 seconds for timer interrupt)