damon.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>, Shuah Khan <shuah@kernel.org>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 8/8] selftests/damon/_chk_dependency: get debugfs mount point from /proc/mounts
Date: Wed,  7 Feb 2024 12:31:34 -0800	[thread overview]
Message-ID: <20240207203134.69976-9-sj@kernel.org> (raw)
In-Reply-To: <20240207203134.69976-1-sj@kernel.org>

DAMON debugfs selftests dependency checker assumes debugfs would be
mounted at /sys/kernel/debug.  That would be ok for many cases, but some
systems might mounted the file system on some different places.  Parse
the real mount point using /proc/mounts file.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 tools/testing/selftests/damon/_chk_dependency.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/damon/_chk_dependency.sh b/tools/testing/selftests/damon/_chk_dependency.sh
index 350f8c2b071d..dda3a87dc00a 100644
--- a/tools/testing/selftests/damon/_chk_dependency.sh
+++ b/tools/testing/selftests/damon/_chk_dependency.sh
@@ -4,7 +4,14 @@
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
 
-DBGFS=/sys/kernel/debug/damon
+DBGFS=$(grep debugfs /proc/mounts --max-count 1 | awk '{print $2}')
+if [ "$DBGFS" = "" ]
+then
+	echo "debugfs not mounted"
+	exit $ksft_skip
+fi
+
+DBGFS+="/damon"
 
 if [ $EUID -ne 0 ];
 then
-- 
2.39.2


      parent reply	other threads:[~2024-02-07 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 20:31 [PATCH 0/8] selftests/damon: add more tests for core functionalities and corner cases SeongJae Park
2024-02-07 20:31 ` [PATCH 1/8] selftests/damon/_damon_sysfs: support DAMOS quota SeongJae Park
2024-02-07 20:31 ` [PATCH 2/8] selftests/damon/_damon_sysfs: support DAMOS stats SeongJae Park
2024-02-07 20:31 ` [PATCH 3/8] selftests/damon/_damon_sysfs: support DAMOS apply interval SeongJae Park
2024-02-07 20:31 ` [PATCH 4/8] selftests/damon: add a test for DAMOS quota SeongJae Park
2024-02-07 20:31 ` [PATCH 5/8] selftests/damon: add a test for DAMOS apply intervals SeongJae Park
2024-02-07 20:31 ` [PATCH 6/8] selftests/damon: add a test for a race between target_ids_read() and dbgfs_before_terminate() SeongJae Park
2024-02-07 20:31 ` [PATCH 7/8] selftests/damon: add a test for the pid leak of dbgfs_target_ids_write() SeongJae Park
2024-02-07 20:31 ` SeongJae Park [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240207203134.69976-9-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).