Skip to content

Commit eb413da

Browse files
sjp38akpm00
authored andcommitted
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>
1 parent c1a6958 commit eb413da

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tools/testing/selftests/damon/drgn_dump_damon_status.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ def to_dict(object, attr_name_converter):
2525
d[attr_name] = converter(getattr(object, attr_name))
2626
return d
2727

28+
def ops_to_dict(ops):
29+
return to_dict(ops, [
30+
['id', int],
31+
])
32+
2833
def intervals_goal_to_dict(goal):
2934
return to_dict(goal, [
3035
['access_bp', int],
@@ -148,6 +153,7 @@ def schemes_to_list(schemes):
148153

149154
def damon_ctx_to_dict(ctx):
150155
return to_dict(ctx, [
156+
['ops', ops_to_dict],
151157
['attrs', attrs_to_dict],
152158
['adaptive_targets', targets_to_list],
153159
['schemes', schemes_to_list],

0 commit comments

Comments
 (0)