Received: by 10.192.165.148 with SMTP id m20csp235351imm; Wed, 9 May 2018 11:45:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqDKa5g1/T14nM0dxiiP7TKuJ0iIhgXQC/eXVWLtKC+y3Cy0mzMYfPUgcDkNeA9M7xlKdbW X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr42914757plo.357.1525891514939; Wed, 09 May 2018 11:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525891514; cv=none; d=google.com; s=arc-20160816; b=isygY6JrjFE7p6MEF+hQU3J3h9UN6lgn1y+Q9MJlqfOr0yMRCHsLjCSQcx6bnN5P9X oFyYcimCJsAQXdY0zlut9TlwaL6cpHz3N704g82eMAUy8YJl/R8IOC6WcaTsEZT45108 JtZvXXgJ2BI7Uhrxi+E+IDAN4ZE79eND8Q4ktIZriamIMiiMoiYqrdri2Vnppkg86pAl ch8T2AlSrgeXP7Iwrur1tw7z6TvQOCbtRrPnONUYktk14PPpqDZqrWIZfC4U8WB48zqd l850qklS2xD2/EJkK07O0vaz3WAYz9L1Kred4Ahnd6hoHequIffva8lkYHnTUF39MnU6 vLgA== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=mpYzojJd43rxZYE7wqu5kHoCuxipNUWEOdrtKRsLx+U=; b=unyo5sC7jxUJ+xaSqrn6f6zfQDcJs7jTolnkVwDzrRAX/8WkfSX48OXQJcsjRcaZtc vGUGeg2pJRN8lCwxW/QHd02V7sQcOMHxhUi0EetSKvQ89ixvlX4HukQ3+BBEYusvMYGr Uws4unrNMkY2a1Moc/440TZr24YtCPDpbhIasjUt9s1+VxYTdx4/bScKaDGGCpH50nua joFp34NULTtzqpkyxVuyJ+WhlPHEIAOqNBK36muLwMAg60dK57KTMosjIFmtbiIp4d/Y zqA8Y0LnGi4f8cj5vhZ7aO1+cvgAUuHubSZDNuaAewCQyrmD+26X/5pbV3qZdvBjmB95 rTjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rajagiritech-edu-in.20150623.gappssmtp.com header.s=20150623 header.b=uXXY+lfN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m64si2916893pfm.0.2018.05.09.11.44.58; Wed, 09 May 2018 11:45:14 -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; dkim=pass header.i=@rajagiritech-edu-in.20150623.gappssmtp.com header.s=20150623 header.b=uXXY+lfN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964890AbeEISoo (ORCPT + 99 others); Wed, 9 May 2018 14:44:44 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:46391 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934980AbeEISom (ORCPT ); Wed, 9 May 2018 14:44:42 -0400 Received: by mail-qt0-f195.google.com with SMTP id m16-v6so46947027qtg.13 for ; Wed, 09 May 2018 11:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rajagiritech-edu-in.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=mpYzojJd43rxZYE7wqu5kHoCuxipNUWEOdrtKRsLx+U=; b=uXXY+lfNHZQSNmgKQ77i2CVVbKLkFWyzDBnHsEvsa6Rn//Sp8AYHZTIlNrCNsYxX/g PoFDbBLcFPH+RqukFaCpoSwQHdoFDJE81M/Iw/WhRyBu7NE2aooELtdQGze2yM9vvYn8 G4BnbJnLB5Q5bWE5tUJkwAHiYi9tRSXxRYozs1nCQxWfA+IVAI4x9hwL0gCFA/MOebN5 5W1ErnT1lFnICL2ZxS772tUT9U+rCQxx0Q9lMEZQNoFUbhK+GKXvA4aAqirQrasEDcuT GK6+yEksrQVARPXIHfdo+NbfTaXbZSRsyu6M/wGMY5vaCHnEPhzMO9cvO6ISYWZrq02D oM2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=mpYzojJd43rxZYE7wqu5kHoCuxipNUWEOdrtKRsLx+U=; b=LYpNAR5ephyUL4sSefLtdrUjj/730DKH0g2stRLEE1tbPY1pn95zrkEagpI4f6GE4Q Kyenf6s4SYVbeLj5E91stmANC5l59u3mXEhUYmrWksP1jxUbVGKeic8xdbmzKOAFfqPc JwnPyFTqZji/MgJg9aBoIN96+WTUYXc85dU3Szc8JSs7aIicQ3blP3K1WUEYd9ISzL6C KyDIAmPMXms35fpcSLIR3izN1TdqoC26CNZydAsbu0p627+H0Kuu4nBaP8nkC5koj34d hAt8x0x9irIAE90o149SokozCE93TPTC09SoXHpuXS6w/cQd+f26RoaMHP586l5J/dcr mMjw== X-Gm-Message-State: ALQs6tD6RBD95N/X1QVmDWKuNHt695EXH0lOF+WhunjF7hPd47kSj6v7 4eyygwR7kmpSpONU0kRXoKw0qNftl31XIXpvwhCSHA== X-Received: by 2002:a0c:e88d:: with SMTP id b13-v6mr38287250qvo.34.1525891481373; Wed, 09 May 2018 11:44:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.170.2 with HTTP; Wed, 9 May 2018 11:44:40 -0700 (PDT) In-Reply-To: References: <20180509173819.8017-1-ahiliation@yahoo.co.in> From: Jeffrin Thalakkottoor Date: Thu, 10 May 2018 00:14:40 +0530 Message-ID: Subject: Re: [PATCH] selftests: intel_pstate: Fix a condition which does not notify user that root permission is useful To: =?UTF-8?B?RGFuaWVsIETDrWF6?= Cc: Jeffrin Jose T , Shuah Khan , Kate Stewart , Philippe Ombredanne , gregkh@linuxfoundation.org, thomas@m3y3r.de, linux-kselftest@vger.kernel.org, lkml Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org thanks. i will work on... On Wed, May 9, 2018 at 11:54 PM, Daniel D=C3=ADaz = wrote: > Hello! > > > On 05/09/2018 12:38 PM, Jeffrin Jose T wrote: >> aperf program uses /dev/cpu which is normally a root only >> access area. so in that case to successfully run thet test, >> root permissions are required.This patch is in the file run.sh. >> >> Signed-off-by: Jeffrin Jose T >> --- >> tools/testing/selftests/intel_pstate/run.sh | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing= /selftests/intel_pstate/run.sh >> index 23a2e4e9880e..05d35392dcfd 100755 >> --- a/tools/testing/selftests/intel_pstate/run.sh >> +++ b/tools/testing/selftests/intel_pstate/run.sh >> @@ -31,6 +31,14 @@ >> >> EVALUATE_ONLY=3D0 >> >> +uid=3D$(id -u) >> +if [ $uid -ne 0 ]; then >> + echo "-----------------------" >> + echo $msg please run this as root >&2 >> + echo "-----------------------" >> + exit 0 >> +fi >> + > > Other tests simply use $UID. See: > cpufreq/main.sh > cpu-hotplug/cpu-on-off-test.sh > efivarfs/efivarfs.sh > gpio/gpio-mockup.sh > memory-hotplug/mem-on-off-test.sh > > This doesn't take into account the conditions for EVALUATE_ONLY: When > it's set non-zero, neither aperf nor cpupower run at all. > > While this is under review, you might want to base your change on > Shuah's patch for skipping: > > https://lists.linaro.org/pipermail/linux-kselftest-mirror/2018-May/001074= .html > > >> if ! uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ | grep -q x86; then >> echo "$0 # Skipped: Test can only run on x86 architectures." >> exit 0 > > I'd leave this check at the forefront, as this "hurdle" is > insurmountable in other architectures, whereas becoming root is attainabl= e. > > Thanks and greetings! > > Daniel D=C3=ADaz > daniel.diaz@linaro.org --=20 software engineer rajagiri school of engineering and technology