Skip to content

Commit c1a6958

Browse files
sjp38akpm00
authored andcommitted
selftests/damon/drgn_dump_damon_status: dump damos->migrate_dests
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 damos->migrate_dests dumping for more tests. Link: https://lkml.kernel.org/r/20250720171652.92309-10-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 80d4e38 commit c1a6958

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tools/testing/selftests/damon/drgn_dump_damon_status.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ def damos_watermarks_to_dict(watermarks):
117117
['high', int], ['mid', int], ['low', int],
118118
])
119119

120+
def damos_migrate_dests_to_dict(dests):
121+
nr_dests = int(dests.nr_dests)
122+
node_id_arr = []
123+
weight_arr = []
124+
for i in range(nr_dests):
125+
node_id_arr.append(int(dests.node_id_arr[i]))
126+
weight_arr.append(int(dests.weight_arr[i]))
127+
return {
128+
'node_id_arr': node_id_arr,
129+
'weight_arr': weight_arr,
130+
'nr_dests': nr_dests,
131+
}
132+
120133
def scheme_to_dict(scheme):
121134
return to_dict(scheme, [
122135
['pattern', damos_access_pattern_to_dict],
@@ -125,6 +138,7 @@ def scheme_to_dict(scheme):
125138
['quota', damos_quota_to_dict],
126139
['wmarks', damos_watermarks_to_dict],
127140
['target_nid', int],
141+
['migrate_dests', damos_migrate_dests_to_dict],
128142
])
129143

130144
def schemes_to_list(schemes):

0 commit comments

Comments
 (0)