Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/damon/drgn_dump_damon_status: dump ctx->ops.id

drgn_dump_damon_status.py is a script for dumping DAMON internal status in
json format. It is being used for seeing if DAMON parameters that are set
using _damon_sysfs.py are actually passed to DAMON in the kernel space.
It is, however, not dumping full DAMON internal status, and it makes
increasing test coverage difficult. Add ctx->ops.id dumping for more
tests.

Link: https://lkml.kernel.org/r/20250720171652.92309-11-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>

authored by

SeongJae Park and committed by
Andrew Morton
eb413daa c1a69589

+6
+6
tools/testing/selftests/damon/drgn_dump_damon_status.py
··· 25 25 d[attr_name] = converter(getattr(object, attr_name)) 26 26 return d 27 27 28 + def ops_to_dict(ops): 29 + return to_dict(ops, [ 30 + ['id', int], 31 + ]) 32 + 28 33 def intervals_goal_to_dict(goal): 29 34 return to_dict(goal, [ 30 35 ['access_bp', int], ··· 153 148 154 149 def damon_ctx_to_dict(ctx): 155 150 return to_dict(ctx, [ 151 + ['ops', ops_to_dict], 156 152 ['attrs', attrs_to_dict], 157 153 ['adaptive_targets', targets_to_list], 158 154 ['schemes', schemes_to_list],