]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
test_maple_tree: Move benchmarking defines and encapsulate functions
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 24 Nov 2020 17:18:26 +0000 (12:18 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:31:27 +0000 (12:31 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/test_maple_tree.c

index 3a75e7848f2231061efacd7b433148ef78740b62..36a3cf7b3acfd96537850aebd123f170cc1eb64b 100644 (file)
@@ -10,6 +10,9 @@
 
 #define MTREE_ALLOC_MAX 0x2000000000000Ul
 #define CONFIG_DEBUG_MAPLE_TREE
+//#define BENCH_SLOT_STORE
+//#define BENCH_NODE_STORE
+//#define BENCH_FORK
 static
 int mtree_insert_index(struct maple_tree *mt, unsigned long index, gfp_t gfp)
 {
@@ -35279,6 +35282,7 @@ static void check_dfs_preorder(struct maple_tree *mt)
 
 }
 
+#if defined(BENCH_SLOT_STORE)
 static noinline void bench_slot_store(struct maple_tree *mt)
 {
        int i, brk = 105, max = 1040, brk_start = 100, count = 20000000;
@@ -35292,7 +35296,9 @@ static noinline void bench_slot_store(struct maple_tree *mt)
                                  GFP_KERNEL);
        }
 }
+#endif
 
+#if defined(BENCH_NODE_STORE)
 static noinline void bench_node_store(struct maple_tree *mt)
 {
        int i, overwrite = 76, max = 240, count = 20000000;
@@ -35309,6 +35315,7 @@ static noinline void bench_node_store(struct maple_tree *mt)
                        overwrite = 76;
        }
 }
+#endif
 
 static noinline void check_forking(struct maple_tree *mt)
 {
@@ -35345,6 +35352,7 @@ static noinline void check_forking(struct maple_tree *mt)
        mtree_destroy(&newmt);
 }
 
+#if defined(BENCH_FORK)
 static noinline void bench_forking(struct maple_tree *mt)
 {
 
@@ -35381,10 +35389,8 @@ static noinline void bench_forking(struct maple_tree *mt)
                mtree_destroy(&newmt);
        }
 }
+#endif
 
-//#define BENCH_SLOT_STORE
-//#define BENCH_NODE_STORE
-//#define BENCH_FORK
 static DEFINE_MTREE(tree);
 static int maple_tree_seed(void)
 {