Received: by 10.192.165.148 with SMTP id m20csp442498imm; Fri, 4 May 2018 12:50:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoKM9a7HJkVAS0kA3D6J4AfSA9iPbuiafglM4it5/N/NsbVYoR8JSYFEGlihFlkSrn9A/gR X-Received: by 2002:a65:4083:: with SMTP id t3-v6mr23329825pgp.129.1525463419367; Fri, 04 May 2018 12:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525463419; cv=none; d=google.com; s=arc-20160816; b=Y3WIZ15PQhLVX+6rB+kXezq7raBD0NgwkvdfcLIqLC6ZpU86xMy2/wtF1OdphC8FEq mn7bvB1LItIsT4iSYtvzYPccu8yZ/xSn+xnCnNLO3WBmO14rBJIgO7DO0Q65MEkt1puF O7zDKLrpBqTXf0BpFO2iV+HuQ8G03M8CfGq8CuQQEqXv/sh/ai9yjGTnj2E0NBHutBQf fY2AfDO0gAOWlQF8YXGicBKUh9Iw+93C74Dr0piHqp/yUwC9BAe5fvplcRlFLnYW17ic ++TKk4+xN69ZblwQckc2ZzTEOSDifetphyR7xqoII88+9WBxnET4aFIW4vnqzYktgjd0 HVQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=FuVoqYN8z6kCbqfdBr0GTUYil3FiMNzHifg8CkTSZNc=; b=sf+3wkwwQcw6UJg+jAgrq7fIPqpRURFbDxnpSZdsaJHFvZobEWUR9chViGyMQhrPbg OzlemaHCHQhdBajLEz5VagakPsMUjcjP04aWlfHepPoC4YJDPqu7SCZCJPowGh2dcejL DmEFJsGep1nN72ol+jhuEi8x6x33siNgJupRZL58UW+VJEYFAmP1SAoZUkIhM69B7XbS t55uwyuGGesIkVbltz2aAHXOenvVHKQH0jNqaEP3VBQoLTHjQb8vhEnslj/BJ8kW8UTW jewe8pktaW+AvtXWWKAnn8C5Sv82f9l6WnifBc3CqfH1RaQsjfKvqW+jDs1X+9gVoRLI xaaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24-v6si15441503plp.564.2018.05.04.12.50.05; Fri, 04 May 2018 12:50:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbeEDTsK (ORCPT + 99 others); Fri, 4 May 2018 15:48:10 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:38245 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910AbeEDTsJ (ORCPT ); Fri, 4 May 2018 15:48:09 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 868F721E44; Fri, 4 May 2018 19:48:08 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kk4xiLwrAiVb; Fri, 4 May 2018 19:48:08 +0000 (UTC) Received: from [192.168.1.87] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 4C22521DC9; Fri, 4 May 2018 19:47:54 +0000 (UTC) Subject: Re: [PATCH] selftests:intel_pstate: fixes typical crash of a testing script for Intel P-State driver To: Jeffrin Jose T , kstewart@linuxfoundation.org, daniel.diaz@linaro.org, pombredanne@nexb.com, gregkh@linuxfoundation.org, thomas@m3y3r.de Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jeffrin Jose T , Shuah Khan References: <20180429191226.14242-1-ahiliation@yahoo.co.in> From: Shuah Khan Message-ID: <62c2484a-b8fe-513c-a9c7-dff1f3f3979a@kernel.org> Date: Fri, 4 May 2018 13:47:54 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180429191226.14242-1-ahiliation@yahoo.co.in> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/29/2018 01:12 PM, Jeffrin Jose T wrote: > Testing script for Intel P-State driver crashes during > the run. this patch fixes that crash and produce typical results. > > Signed-off-by: Jeffrin Jose T > > --- > tools/testing/selftests/intel_pstate/run.sh | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh > index c670359becc6..cd32aca8806f 100755 > --- a/tools/testing/selftests/intel_pstate/run.sh > +++ b/tools/testing/selftests/intel_pstate/run.sh > @@ -27,6 +27,7 @@ > # and the test will error out in those cases. The result.X file can be checked > # for consistency and modified to remove the extra MHz values. The result.X > # files can be re-evaluated by setting EVALUATE_ONLY to 1 below. > +#set -xv > > EVALUATE_ONLY=0 > > @@ -101,12 +102,13 @@ cpupower frequency-set -g powersave --max=${max_freq}MHz >& /dev/null > echo "Target Actual Difference MSR(0x199) max_perf_pct" > for freq in `seq $max_freq -100 $min_freq` > do > - result_freq=$(cat /tmp/result.${freq} | grep "cpu MHz" | awk ' { print $4 } ' | awk -F "." ' { print $1 } ') > + result_freq=$(cat /tmp/result.${freq} | grep "cpu MHz" \ > | awk '{print $4}' | awk -F "." '{print $1}') > + result_freq=$(echo $result_freq | head -n1 | cut -d " " -f1) > msr=$(cat /tmp/result.${freq} | grep "msr" | awk ' { print $3 } ') > max_perf_pct=$(cat /tmp/result.${freq} | grep "max_perf_pct" | awk ' { print $2 } ' ) > - if [ $result_freq -eq $freq ]; then > + if (( "$result_freq" == "$freq" )) > + then > echo " $freq $result_freq 0 $msr $(($max_perf_pct*3300))" > else > echo " $freq $result_freq $(($result_freq-$freq)) $msr $(($max_perf_pct*$max_freq))" > Thanks. I will get this into 4.17-rc5 -- Shuah