mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
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/20240625180538.73134-6-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>
This commit is contained in:
parent
c9a3003a35
commit
f60636047a
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user