Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp391369ybv; Wed, 19 Feb 2020 01:38:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzZbUm3LzqPAotpPfbDm701fUzHH4xt04XMAV/7cmj3N2SGcIfi8KGAfagvQAXQy2PGXUHW X-Received: by 2002:aca:c08b:: with SMTP id q133mr3851146oif.46.1582105125090; Wed, 19 Feb 2020 01:38:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582105125; cv=none; d=google.com; s=arc-20160816; b=z6DHvCflvPwCAblqPL8F2G5HdSv99fOpJLmpqtWwYsdbsWpfqWWnJWx1tj/Oaygyo2 SJjHZLJiJBzIW1fANd9sYKLH6YKsgnuyConEW2LCDpECoojepeCA9zOCkyhLZr+1/+HM eVT6cwic8s+Hpucc5+CPCx8JXh6/P+psW5wnJdffZP584Ha3YNxzKTR/4deGtTGTzZmO eXMJN1i9n6ja76ckyylzMHeu+28TsRfBbDoBT8kWrfNeo+/frDUmRbN6y5CXc43SquBa t9Htvl10y2UlgMWeffZZaTW4GYVITelT2nUcG2RD3RFHVpbU3Z3yXcG0iKjZtoNEymU6 791A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GhykKqJyDb1Rg15XSg/jmTOCOqKW+oHHr1gHq12e8aY=; b=xr96bo3G5nQvhsHpwkoD6K1Te9WvEtbOu46Ywg0kYa8Jllfa4X4TP+CsKxS4LUlogl 1OZNeYJF76bKHDjHW/MNccbjkp4dyUEYvZCb7DoQvz7ldDXCIKSW0VpIeggrjggZ+Rn2 V5EWyq3HQK0I2JB7EghWkqsX9QG6Pco2xFQmmYyVks9jXKQBmlBbCRjfKgVmbtk/dstn idENlp7rXlg3AZqGGVnT9j0ez5F1IlFNBSvyFf1GTySGVjnjl4LNdNOMDnnM+Vvzbc/2 d9GlLaJ5zYueeWs1rQ24lIq1y9HBsSuZA63EVKxJfQtLpaIs0G1sHFS5QV2HsTzg2o0v BlAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=zBJl5+of; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si1011884otm.88.2020.02.19.01.38.32; Wed, 19 Feb 2020 01:38:45 -0800 (PST) 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=@oracle.com header.s=corp-2020-01-29 header.b=zBJl5+of; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbgBSJiW (ORCPT + 99 others); Wed, 19 Feb 2020 04:38:22 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:52908 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgBSJiW (ORCPT ); Wed, 19 Feb 2020 04:38:22 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01J9XHMV006368; Wed, 19 Feb 2020 09:38:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2020-01-29; bh=GhykKqJyDb1Rg15XSg/jmTOCOqKW+oHHr1gHq12e8aY=; b=zBJl5+oftFaoxNfDOjl/d410bFhtW3AyjIVBmRew3AsEeFg1QE7LF8TimOUamRKjNA1U RuNP2mEv4ApGEU43JtnbEI792pdksc7rf7LkMUBix/SyFt5RESPoG07Mat4Y0oTSyd5c Do87+MADgtitkySecvfQ8PvnarjsuLFj9Q/5YkifSLbcqxH7POmi6+XS3iqyhYoRgWxP u3qRjlUsztpbTawyNKBbC5KO8mIGrg9UILB12q6SrHBT7n4jIZsSXaiKkUC8IIKNs++s gIhMHCuTDKngeCEbM5BuMPNQ1Z+p1wHnoHdZat6G3Ff9cr86c31ELXVabNpvXV+GGl1M iQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2y8udd1rpy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Feb 2020 09:38:00 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01J9X2h1034713; Wed, 19 Feb 2020 09:35:59 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2y8uda4ss0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Feb 2020 09:35:59 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01J9ZwVj005397; Wed, 19 Feb 2020 09:35:58 GMT Received: from dhcp-10-175-189-86.vpn.oracle.com (/10.175.189.86) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Feb 2020 01:33:59 -0800 From: Alan Maguire To: rostedt@goodmis.org, mhiramat@kernel.org Cc: mingo@redhat.com, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Alan Maguire Subject: [PATCH v2 1/2] ftrace/selftests: workaround cgroup RT scheduling issues Date: Wed, 19 Feb 2020 09:33:29 +0000 Message-Id: <1582104810-12983-2-git-send-email-alan.maguire@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582104810-12983-1-git-send-email-alan.maguire@oracle.com> References: <1582104810-12983-1-git-send-email-alan.maguire@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 suspectscore=4 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002190070 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=4 priorityscore=1501 bulkscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002190070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wakeup_rt.tc and wakeup.tc tests in tracers/ subdirectory fail due to the chrt command returning: chrt: failed to set pid 0's policy: Operation not permitted. To work around this, temporarily disable grout RT scheduling during ftracetest execution. Restore original value on test run completion. With these changes in place, both tests consistently pass. Fixes: c575dea2c1a5 ("selftests/ftrace: Add wakeup_rt tracer testcase") Fixes: c1edd060b413 ("selftests/ftrace: Add wakeup tracer testcase") Signed-off-by: Alan Maguire --- tools/testing/selftests/ftrace/ftracetest | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest index 063ecb2..144308a 100755 --- a/tools/testing/selftests/ftrace/ftracetest +++ b/tools/testing/selftests/ftrace/ftracetest @@ -29,8 +29,25 @@ err_ret=1 # kselftest skip code is 4 err_skip=4 +# cgroup RT scheduling prevents chrt commands from succeeding, which +# induces failures in test wakeup tests. Disable for the duration of +# the tests. + +readonly sched_rt_runtime=/proc/sys/kernel/sched_rt_runtime_us + +sched_rt_runtime_orig=$(cat $sched_rt_runtime) + +setup() { + echo -1 > $sched_rt_runtime +} + +cleanup() { + echo $sched_rt_runtime_orig > $sched_rt_runtime +} + errexit() { # message echo "Error: $1" 1>&2 + cleanup exit $err_ret } @@ -39,6 +56,8 @@ if [ `id -u` -ne 0 ]; then errexit "this must be run by root user" fi +setup + # Utilities absdir() { # file_path (cd `dirname $1`; pwd) @@ -235,6 +254,7 @@ TOTAL_RESULT=0 INSTANCE= CASENO=0 + testcase() { # testfile CASENO=$((CASENO+1)) desc=`grep "^#[ \t]*description:" $1 | cut -f2 -d:` @@ -406,5 +426,7 @@ prlog "# of unsupported: " `echo $UNSUPPORTED_CASES | wc -w` prlog "# of xfailed: " `echo $XFAILED_CASES | wc -w` prlog "# of undefined(test bug): " `echo $UNDEFINED_CASES | wc -w` +cleanup + # if no error, return 0 exit $TOTAL_RESULT -- 1.8.3.1