aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeongJae Park <[email protected]>2024-08-26 20:03:34 -0700
committerAndrew Morton <[email protected]>2024-09-03 21:15:58 -0700
commit61879eed1f180ff92c2324b24d06eeddcc9256bd (patch)
treed4cdda4f4ff86ad01a5d730066460ecfac364b4f
parent8e34bac5a268b2fb3a88231a9b94cada8adcc8c0 (diff)
mm/damon/dbgfs-test: skip dbgfs_set_init_regions() test if PADDR is not registered
The test depends on registration of DAMON_OPS_PADDR. It would be registered only when CONFIG_DAMON_PADDR is set. DAMON core kunit tests do fake ops registration for such case. However, the functions for such fake ops registration is not available to DAMON debugfs interface. Just skip the test in the case. Link: https://lkml.kernel.org/r/[email protected] Fixes: 999b9467974f ("mm/damon/dbgfs-test: fix is_target_id() change") Signed-off-by: SeongJae Park <[email protected]> Cc: Brendan Higgins <[email protected]> Cc: David Gow <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/damon/dbgfs-test.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/damon/dbgfs-test.h b/mm/damon/dbgfs-test.h
index 9bd5dca5d4ad..d2ecfcc8db86 100644
--- a/mm/damon/dbgfs-test.h
+++ b/mm/damon/dbgfs-test.h
@@ -116,6 +116,11 @@ static void damon_dbgfs_test_set_init_regions(struct kunit *test)
int i, rc;
char buf[256];
+ if (!damon_is_registered_ops(DAMON_OPS_PADDR)) {
+ damon_destroy_ctx(ctx);
+ kunit_skip(test, "PADDR not registered");
+ }
+
damon_select_ops(ctx, DAMON_OPS_PADDR);
dbgfs_set_targets(ctx, 3, NULL);