]> www.infradead.org Git - users/willy/xarray.git/commitdiff
mm/damon/dbgfs-test: skip dbgfs_set_targets() test if PADDR is not registered
authorSeongJae Park <sj@kernel.org>
Tue, 27 Aug 2024 03:03:33 +0000 (20:03 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Sep 2024 04:15:57 +0000 (21:15 -0700)
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/20240827030336.7930-7-sj@kernel.org
Fixes: 999b9467974f ("mm/damon/dbgfs-test: fix is_target_id() change")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/dbgfs-test.h

index 2d85217f5ba465b7efa7b48d185b28ee36fe8f3d..9bd5dca5d4adb1936b01505c6b83a947e1cd11f2 100644 (file)
@@ -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);