From patchwork Tue Jan 30 01:35:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13536663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D011C47DB3 for ; Tue, 30 Jan 2024 01:36:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07FED6B00A0; Mon, 29 Jan 2024 20:36:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 02DEF6B00A1; Mon, 29 Jan 2024 20:36:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC5766B00A2; Mon, 29 Jan 2024 20:36:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C3EE46B00A0 for ; Mon, 29 Jan 2024 20:36:06 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 952AC1C0AF1 for ; Tue, 30 Jan 2024 01:36:06 +0000 (UTC) X-FDA: 81734261532.21.3DAC718 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf22.hostedemail.com (Postfix) with ESMTP id 79B60C001A for ; Tue, 30 Jan 2024 01:36:04 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FFP5NFEw; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706578565; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ePn71CF+5khVDS2ZdjmxVHfkUk7BTWUPIbvLbDcmGSk=; b=YRBxfHrdT8OpJXZQW3IY+YLFwEJ36+skPxBxYcS7OIEcSCFbdwRXCRIcnfx9kOhhxX5reb nLujR8daKEXw3xZXP91JJEydsrmULkYzSD0KZ66nwBErT0bPYgzLxZVhW7Upi+PKuvqtHL a7iU4VbMppOJwjsqPk/467vknhtssA0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706578565; a=rsa-sha256; cv=none; b=EhNsiaIboiPVruUqj1jdm5KrrhhzvwHMVaDdRwHhcwQMv/vHrVhTWR9Qibm0lX4A3mqJRR XxXjNCTLUzI4QixO/frbqzMjF9cninT1H4N8/B5BzFOnoF07jZiHrh0pGNKXONk80/fBOU 7GandZNRBM7uf6YKeHjS8VyW2DX9FZ8= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FFP5NFEw; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8BA98CE1787; Tue, 30 Jan 2024 01:36:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EFE5C43390; Tue, 30 Jan 2024 01:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706578560; bh=TappCEs1QiYT505+DhU0zSdNYL81quzZAEnLH6jY5LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FFP5NFEwwozb08uVo+7nRDp7jigTnADRzHoD+Dy+L61NqdYWr+6phTtrauODwooAb 24tlphXSd5ldl6GdqunuS3hAvvajyCkKiYqyMAUnafFNPGzD8RpSmmKEEpedkpMaKb rk95qqTgwffbKqfnE2aiupjub6g61Ew5jAJrhlWW1e19S9dEhv27qrVbFiSO0IHNvc eTR/lirtG9EvJbGftZc5q6DTflhxF/CmWvc9YokRAgPTvwpvkT3YI4gVashAmj7BdP iboBri8jUHSZ9GFXgaMQWViP3epe2I6gYgm35prRmu9psnS7Kar+u0Vnil+VIFEnDI 3z4WulC2vtuRQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] selftets/damon: prepare for monitor_on file renaming Date: Mon, 29 Jan 2024 17:35:45 -0800 Message-Id: <20240130013549.89538-7-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130013549.89538-1-sj@kernel.org> References: <20240130013549.89538-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 79B60C001A X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 516mizfoeqz833kaud7donp15g6hmcdc X-HE-Tag: 1706578564-399932 X-HE-Meta: U2FsdGVkX1881nFgLjp6meoto5u+dtXxW0JrVXl43ZbTEMuLuhdbtzhY8xzprFE9PlzDSD02MTItiS4LJl/KYnkq7kyq5wPRZ1YyLxIzXT9GTISpc3Z3XCVLpi6Cq/TEpNB0QODgdTNoXd9gFz6Hq14qmw5Rfc+J4BQrbIexYqy7y/Qm2RmPell+knz0TPTZMUWnm76bOTqwdDPDM133FbYmPHpcqAy6/xiz0Tp18CwrfC/1GVRXWDcJKF6vekyaQBUhAoHN/GE0LEEIqDRwTWIxK0hY75mnzOAzuueeHDRbwxL6rZUZ87wJOy1fBbM6FUSS40DyrnzRsnBu35Zz63lDCjm/js3jCvZLHRIXlf6OJVusXlX+KZ9EZc90cu1CrKnzcVT0tjsJrhYYw7jzOomSrp4AtPKGXIHuBzYTQua/PHklri4rQZ6knHsom56a6o5LSvGy843QdRX++SYi4aW4wdwBFwxNyz9Md59+LGV+5tc0V38u2620Gy1Baycp8nWRPD0N+ZpOtwBSQjcpNld1xtErXdL/pB69q24xPnbIIGOhvwqYh14pDg7V29E1DRYr8HTXJztpm7/GkgCHG/PvhW1DctXcAr7ToeIda8z6G1IP+is06NL174bhiyGGpn7fTZBY/R4tHJpRa7Lg60ySpdWm5TbheqprO7Gyxd89Ponj9axudt2LhMf4G/p4elceaEOZj1sSrxOQTGqeClqaYsgZx304s/7O26bV27srEiu1LgOtFpeJLVAG1Yxu6nC5m1v2333i1jPxeyuN9pFTlwwfuRYVELH4tg2hkMvolX8t5bduZ8fy3y64oefFrqy5nbUS/NomdNNBwbew/Y+AnLc0l3Aas/kn3NRiEAK4zQInJQ/8rMrYMHW1fOBzM/sKEaqh5GidunRJDC+QUeRdbqALU5jNVdGbnJ2SmW1FI3K7QGSNIs8iGZUZKk3eGhFzctYWBc2baR22d29 RNB/VsYt +Y5IX X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Following change will rename 'monitor_on' DAMON debugfs file to 'monitor_on_DEPRECATED', to make the deprecation unignorable in runtime. Since it could make DAMON selftests fail and disturb future bisects, update DAMON selftests to support the change. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_chk_dependency.sh | 11 +++++++++-- tools/testing/selftests/damon/_debugfs_common.sh | 7 +++++++ .../testing/selftests/damon/debugfs_empty_targets.sh | 12 ++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/damon/_chk_dependency.sh b/tools/testing/selftests/damon/_chk_dependency.sh index 0328ac0b5a5e..350f8c2b071d 100644 --- a/tools/testing/selftests/damon/_chk_dependency.sh +++ b/tools/testing/selftests/damon/_chk_dependency.sh @@ -18,7 +18,14 @@ then exit $ksft_skip fi -for f in attrs target_ids monitor_on +if [ -f "$DBGFS/monitor_on_DEPRECATED" ] +then + monitor_on_file="monitor_on_DEPRECATED" +else + monitor_on_file="monitor_on" +fi + +for f in attrs target_ids "$monitor_on_file" do if [ ! -f "$DBGFS/$f" ] then @@ -28,7 +35,7 @@ do done permission_error="Operation not permitted" -for f in attrs target_ids monitor_on +for f in attrs target_ids "$monitor_on_file" do status=$( cat "$DBGFS/$f" 2>&1 ) if [ "${status#*$permission_error}" != "$status" ]; then diff --git a/tools/testing/selftests/damon/_debugfs_common.sh b/tools/testing/selftests/damon/_debugfs_common.sh index 48989d4813ae..aa995516870b 100644 --- a/tools/testing/selftests/damon/_debugfs_common.sh +++ b/tools/testing/selftests/damon/_debugfs_common.sh @@ -45,6 +45,13 @@ test_content() { source ./_chk_dependency.sh damon_onoff="$DBGFS/monitor_on" +if [ -f "$DBGFS/monitor_on_DEPRECATED" ] +then + damon_onoff="$DBGFS/monitor_on_DEPRECATED" +else + damon_onoff="$DBGFS/monitor_on" +fi + if [ $(cat "$damon_onoff") = "on" ] then echo "monitoring is on" diff --git a/tools/testing/selftests/damon/debugfs_empty_targets.sh b/tools/testing/selftests/damon/debugfs_empty_targets.sh index 87aff8083822..effbea33dc16 100755 --- a/tools/testing/selftests/damon/debugfs_empty_targets.sh +++ b/tools/testing/selftests/damon/debugfs_empty_targets.sh @@ -8,6 +8,14 @@ source _debugfs_common.sh orig_target_ids=$(cat "$DBGFS/target_ids") echo "" > "$DBGFS/target_ids" -orig_monitor_on=$(cat "$DBGFS/monitor_on") -test_write_fail "$DBGFS/monitor_on" "on" "orig_monitor_on" "empty target ids" + +if [ -f "$DBGFS/monitor_on_DEPRECATED" ] +then + monitor_on_file="$DBGFS/monitor_on_DEPRECATED" +else + monitor_on_file="$DBGFS/monitor_on" +fi + +orig_monitor_on=$(cat "$monitor_on_file") +test_write_fail "$monitor_on_file" "on" "orig_monitor_on" "empty target ids" echo "$orig_target_ids" > "$DBGFS/target_ids"