+ mm-damon-add-user-space-selftests.patch added to -mm tree
Subsystems (3)
The patch titled
Subject: mm/damon: add user space selftests
has been added to the -mm tree. Its filename is
mm-damon-add-user-space-selftests.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-damon-add-user-space-selftests.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-damon-add-user-space-selftests.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: SeongJae Park <[email protected]>
Subject: mm/damon: add user space selftests
This commit adds a simple user space tests for DAMON. The tests are using kselftest framework.
---
tools/testing/selftests/damon/Makefile | 7 + tools/testing/selftests/damon/_chk_dependency.sh | 28 ++++ tools/testing/selftests/damon/debugfs_attrs.sh | 75 +++++++++++++ 3 files changed, 110 insertions(+)
tools/testing/selftests/damon/_chk_dependency.sh new file +28 -0
@@ -0,0 +1,28 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + +DBGFS=/sys/kernel/debug/damon + +if [ $EUID -ne 0 ]; +then + echo "Run as root" + exit $ksft_skip +fi + +if [ ! -d "$DBGFS" ] +then + echo "$DBGFS not found" + exit $ksft_skip +fi + +for f in attrs target_ids monitor_on +do + if [ ! -f "$DBGFS/$f" ] + then + echo "$f not found" + exit 1 + fi +done
tools/testing/selftests/damon/debugfs_attrs.sh new file +75 -0
75 lines not on this page · raw message
tools/testing/selftests/damon/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0 +# Makefile for damon selftests + +TEST_FILES = _chk_dependency.sh +TEST_PROGS = debugfs_attrs.sh + +include ../lib.mk
_
Patches currently in -mm which might be from [email protected] are
mm-introduce-data-access-monitor-damon.patch mm-damon-core-implement-region-based-sampling.patch mm-damon-adaptively-adjust-regions.patch mm-idle_page_tracking-make-pg_idle-reusable.patch mm-damon-implement-primitives-for-the-virtual-memory-address-spaces.patch mm-damon-add-a-tracepoint.patch mm-damon-implement-a-debugfs-based-user-space-interface.patch mm-damon-dbgfs-export-kdamond-pid-to-the-user-space.patch mm-damon-dbgfs-support-multiple-contexts.patch documentation-add-documents-for-damon.patch mm-damon-add-kunit-tests.patch mm-damon-add-user-space-selftests.patch maintainers-update-for-damon.patch
PATCH 1/1 selftests/damon/debugfs_attrs: Add missing execute permission
From: SeongJae Park <[email protected]>
Commit 04edafbc0c07 ("mm/damon: add user space selftests") of linux-mm[1] gives no execute permission to 'debugfs_attrs.sh' file. This results in a DAMON selftest failure as below:
$ make -C tools/testing/selftests/damon run_tests
make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon'
TAP version 13
1..1
# selftests: damon: debugfs_attrs.sh
# Warning: file debugfs_attrs.sh is not executable, correct this.
not ok 1 selftests: damon: debugfs_attrs.sh
make: Leaving directory '/home/sjpark/linux/tools/testing/selftests/damon'To solve the problem, this commit adds the execute permission for 'debugfs_attrs.sh' file.
[1] https://github.com/hnaz/linux-mm/commit/04edafbc0c07
--- tools/testing/selftests/damon/debugfs_attrs.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_attrs.sh
tools/testing/selftests/damon/debugfs_attrs.sh +0 -0
Signature · 1 line
2.17.1
Re: [PATCH] selftests/damon/debugfs_attrs: Add missing execute permission
Quoted 32 lines · SeongJae Park
From: SeongJae Park <[email protected]>
Commit
04edafbc0c07("mm/damon: add user space selftests") of linux-mm[1] gives no execute permission to 'debugfs_attrs.sh' file. This results in a DAMON selftest failure as below:$ make -C tools/testing/selftests/damon run_tests make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon' TAP version 13 1..1 # selftests: damon: debugfs_attrs.sh # Warning: file debugfs_attrs.sh is not executable, correct this. not ok 1 selftests: damon: debugfs_attrs.sh make: Leaving directory '/home/sjpark/linux/tools/testing/selftests/damon'To solve the problem, this commit adds the execute permission for '
debugfs_attrs.sh' file.[1] https://github.com/hnaz/linux-mm/commit/04edafbc0c07
Signed-off-by SeongJae Park <[email protected]>--- tools/testing/selftests/damon/debugfs_attrs.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_attrs.shtools/testing/selftests/damon/debugfs_attrs.sh +0
-0Signature · 1 line
2.17.1
Why not fix the tools to execute the file properly as changing the mode of a file does not work well with all tools that we use (i.e. patch files.)
thanks,
greg k-h
Re: [PATCH] selftests/damon/debugfs_attrs: Add missing execute permission
From: SeongJae Park <[email protected]>
Quoted 27 lines · On Tue, 10 Aug 2021 13:27:44 +0200 Greg KH <[email protected]> wrote:
Quoted 26 lines · SeongJae Park
From: SeongJae Park <[email protected]>
Commit
04edafbc0c07("mm/damon: add user space selftests") of linux-mm[1] gives no execute permission to 'debugfs_attrs.sh' file. This results in a DAMON selftest failure as below:$ make -C tools/testing/selftests/damon run_tests make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon' TAP version 13 1..1 # selftests: damon: debugfs_attrs.sh # Warning: file debugfs_attrs.sh is not executable, correct this. not ok 1 selftests: damon: debugfs_attrs.sh make: Leaving directory '/home/sjpark/linux/tools/testing/selftests/damon'To solve the problem, this commit adds the execute permission for '
debugfs_attrs.sh' file.[1] https://github.com/hnaz/linux-mm/commit/04edafbc0c07
Signed-off-by SeongJae Park <[email protected]>--- tools/testing/selftests/damon/debugfs_attrs.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_attrs.sh
Quoted 10 lines
Quoted 6 lines
tools/testing/selftests/damon/debugfs_attrs.sh +0
-0Signature · 1 line
2.17.1Why not fix the tools to execute the file properly as changing the mode of a file does not work well with all tools that we use (i.e. patch files.)
Ok, It sounds make some sense. Hence, I posted this patch:
https://lore.kernel.org/linux-kselftest/[email protected]/
Thanks,
SeongJae Park
[...]