summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/damon
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/damon')
-rw-r--r--tools/testing/selftests/damon/_damon_sysfs.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py
index 6b99f87a5f1e..e98cf4b6a4b7 100644
--- a/tools/testing/selftests/damon/_damon_sysfs.py
+++ b/tools/testing/selftests/damon/_damon_sysfs.py
@@ -76,6 +76,7 @@ class Damos:
# todo: Support quotas, watermarks, stats, tried_regions
idx = None
context = None
+ tried_bytes = None
def __init__(self, action='stat', access_pattern=DamosAccessPattern()):
self.action = action
@@ -284,6 +285,19 @@ class Kdamond:
err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'on')
return err
+ def update_schemes_tried_bytes(self):
+ err = write_file(os.path.join(self.sysfs_dir(), 'state'),
+ 'update_schemes_tried_bytes')
+ if err != None:
+ return err
+ for context in self.contexts:
+ for scheme in context.schemes:
+ content, err = read_file(os.path.join(scheme.sysfs_dir(),
+ 'tried_regions', 'total_bytes'))
+ if err != None:
+ return err
+ scheme.tried_bytes = int(content)
+
class Kdamonds:
kdamonds = []