[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240827030336.7930-7-sj@kernel.org>
Date: Mon, 26 Aug 2024 20:03:33 -0700
From: SeongJae Park <sj@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: SeongJae Park <sj@...nel.org>,
Brendan Higgins <brendanhiggins@...gle.com>,
David Gow <davidgow@...gle.com>,
damon@...ts.linux.dev,
linux-mm@...ck.org,
linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com,
linux-kernel@...r.kernel.org
Subject: [PATCH 6/9] mm/damon/dbgfs-test: skip dbgfs_set_targets() 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.
Fixes: 999b9467974f ("mm/damon/dbgfs-test: fix is_target_id() change")
Signed-off-by: SeongJae Park <sj@...nel.org>
---
mm/damon/dbgfs-test.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mm/damon/dbgfs-test.h b/mm/damon/dbgfs-test.h
index 2d85217f5ba4..9bd5dca5d4ad 100644
--- a/mm/damon/dbgfs-test.h
+++ b/mm/damon/dbgfs-test.h
@@ -73,6 +73,11 @@ static void damon_dbgfs_test_set_targets(struct kunit *test)
struct damon_ctx *ctx = dbgfs_new_ctx();
char buf[64];
+ if (!damon_is_registered_ops(DAMON_OPS_PADDR)) {
+ dbgfs_destroy_ctx(ctx);
+ kunit_skip(test, "PADDR not registered");
+ }
+
/* Make DAMON consider target has no pid */
damon_select_ops(ctx, DAMON_OPS_PADDR);
--
2.39.2
Powered by blists - more mailing lists