From 6171900f8cf9e40c13bc50c55820c4a6382462dd Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 24 Nov 2020 12:18:26 -0500 Subject: [PATCH] test_maple_tree: Move benchmarking defines and encapsulate functions Signed-off-by: Liam R. Howlett --- lib/test_maple_tree.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 3a75e7848f22..36a3cf7b3acf 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -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) { -- 2.50.1