[RFC PATCH 2/6] selftests/damon/_damon_sysfs: set Kdamond.pid in start()

From: SeongJae Park
Date: Sun Jun 22 2025 - 17:04:05 EST


_damon_sysfs.py is a Python module for reading and writing DAMON sysfs
for testing. It is not reading resulting kdamond pids. Read and update
those when starting kdamonds.

Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
---
tools/testing/selftests/damon/_damon_sysfs.py | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py
index 5b1cb6b3ce4e..f587e117472e 100644
--- a/tools/testing/selftests/damon/_damon_sysfs.py
+++ b/tools/testing/selftests/damon/_damon_sysfs.py
@@ -408,6 +408,9 @@ class Kdamond:
if err is not None:
return err
err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'on')
+ if err is not None:
+ return err
+ self.pid, err = read_file(os.path.join(self.sysfs_dir(), 'pid'))
return err

def stop(self):
--
2.39.5