aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
authorSeongJae Park <sj@kernel.org>2026-04-27 08:12:26 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-05-28 21:04:59 -0700
commit5d8585a1d7f689a6fee5a497d83017c5a8a4acfc (patch)
tree8765c6a77973323d777a0d2c1e2ff199f558e495 /tools
parenteb1ae61075f3c9e4e395f23993b5f3593a2e8ff1 (diff)
downloadlinux-next-history-5d8585a1d7f689a6fee5a497d83017c5a8a4acfc.tar.gz
selftests/damon/_damon_sysfs: support pause file staging
DAMON test-purpose sysfs interface control Python module, _damon_sysfs, is not supporting the newly added pause file. Add the support of the file, for future test and use of the feature. Link: https://lore.kernel.org/20260427151231.113429-8-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Brendan Higgins <brendan.higgins@linux.dev> Cc: David Hildenbrand <david@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/damon/_damon_sysfs.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py
index 0f13512fa5e6d..8b12cc0484405 100644
--- a/tools/testing/selftests/damon/_damon_sysfs.py
+++ b/tools/testing/selftests/damon/_damon_sysfs.py
@@ -621,10 +621,11 @@ class DamonCtx:
targets = None
schemes = None
kdamond = None
+ pause = None
idx = None
def __init__(self, ops='paddr', monitoring_attrs=DamonAttrs(), targets=[],
- schemes=[]):
+ schemes=[], pause=False):
self.ops = ops
self.monitoring_attrs = monitoring_attrs
self.monitoring_attrs.context = self
@@ -639,6 +640,8 @@ class DamonCtx:
scheme.idx = idx
scheme.context = self
+ self.pause=pause
+
def sysfs_dir(self):
return os.path.join(self.kdamond.sysfs_dir(), 'contexts',
'%d' % self.idx)
@@ -679,6 +682,11 @@ class DamonCtx:
err = scheme.stage()
if err is not None:
return err
+
+ err = write_file(os.path.join(self.sysfs_dir(), 'pause'), self.pause)
+ if err is not None:
+ return err
+
return None
class Kdamond: