Skip to content

Commit da5973a

Browse files
sjp38akpm00
authored andcommitted
selftests/damon/sysfs.py: test runtime reduction of DAMON parameters
sysfs.py is testing if non-default additional parameters can be committed. Add a test case for further reducing the parameters to the default set. 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]>
1 parent 62b7b1f commit da5973a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tools/testing/selftests/damon/sysfs.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,20 @@ def main():
252252

253253
assert_ctxs_committed(kdamonds.kdamonds[0].contexts, status['contexts'])
254254

255+
# test online commitment of minimum context.
256+
context = _damon_sysfs.DamonCtx()
257+
context.idx = 0
258+
context.kdamond = kdamonds.kdamonds[0]
259+
kdamonds.kdamonds[0].contexts = [context]
260+
kdamonds.kdamonds[0].commit()
261+
262+
status, err = dump_damon_status_dict(kdamonds.kdamonds[0].pid)
263+
if err is not None:
264+
print(err)
265+
exit(1)
266+
267+
assert_ctxs_committed(kdamonds.kdamonds[0].contexts, status['contexts'])
268+
255269
kdamonds.stop()
256270

257271
if __name__ == '__main__':

0 commit comments

Comments
 (0)