aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeongJae Park <[email protected]>2024-06-25 11:05:35 -0700
committerAndrew Morton <[email protected]>2024-07-03 19:30:28 -0700
commitf60636047a6cc2a3076cb202b462cff4347c07d6 (patch)
treef04fe02c0e9f5fca13fc1069b09c45da3528df93
parentc9a3003a358df357b1eba44b05a5bb164621d5f5 (diff)
selftests/damon/_damon_sysfs: implement kdamonds stop function
Implement DAMON stop function on the test-purpose DAMON sysfs interface wrapper Python module, _damon_sysfs.py. This feature will be used by future DAMON tests that need to start/stop DAMON multiple times. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: SeongJae Park <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--tools/testing/selftests/damon/_damon_sysfs.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py
index f975742f29b3..17352b9d204d 100644
--- a/tools/testing/selftests/damon/_damon_sysfs.py
+++ b/tools/testing/selftests/damon/_damon_sysfs.py
@@ -406,6 +406,10 @@ class Kdamond:
err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'on')
return err
+ def stop(self):
+ err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'off')
+ return err
+
def update_schemes_tried_regions(self):
err = write_file(os.path.join(self.sysfs_dir(), 'state'),
'update_schemes_tried_regions')
@@ -511,3 +515,10 @@ class Kdamonds:
if err is not None:
return err
return None
+
+ def stop(self):
+ for kdamond in self.kdamonds:
+ err = kdamond.stop()
+ if err is not None:
+ return err
+ return None