diff options
author | SeongJae Park <sj@kernel.org> | 2024-02-07 12:31:34 -0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-02-22 10:24:57 -0800 |
commit | 501e3dc505f7c8ce8da0532db81e99fae6688074 (patch) | |
tree | b71053a14faa72abe05ec969fd741c8b980a9160 /tools | |
parent | selftests/damon: add a test for the pid leak of dbgfs_target_ids_write() (diff) | |
download | linux-501e3dc505f7c8ce8da0532db81e99fae6688074.tar.gz linux-501e3dc505f7c8ce8da0532db81e99fae6688074.tar.bz2 linux-501e3dc505f7c8ce8da0532db81e99fae6688074.zip |
selftests/damon/_chk_dependency: get debugfs mount point from /proc/mounts
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.
Link: https://lkml.kernel.org/r/20240207203134.69976-9-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/damon/_chk_dependency.sh | 9 |
1 files changed, 8 insertions, 1 deletions
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 |