mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 03:16:14 +01:00
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>
This commit is contained in:
parent
c1a6958957
commit
eb413daaf2
1 changed files with 6 additions and 0 deletions
|
|
@ -25,6 +25,11 @@ def to_dict(object, attr_name_converter):
|
|||
d[attr_name] = converter(getattr(object, attr_name))
|
||||
return d
|
||||
|
||||
def ops_to_dict(ops):
|
||||
return to_dict(ops, [
|
||||
['id', int],
|
||||
])
|
||||
|
||||
def intervals_goal_to_dict(goal):
|
||||
return to_dict(goal, [
|
||||
['access_bp', int],
|
||||
|
|
@ -148,6 +153,7 @@ def schemes_to_list(schemes):
|
|||
|
||||
def damon_ctx_to_dict(ctx):
|
||||
return to_dict(ctx, [
|
||||
['ops', ops_to_dict],
|
||||
['attrs', attrs_to_dict],
|
||||
['adaptive_targets', targets_to_list],
|
||||
['schemes', schemes_to_list],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue