1 #include <linux/module.h>
3 #include <linux/random.h>
7 #define PERF_LOOPS 100000
9 #define SEARCH_LOOPS 10000
17 static inline unsigned long
21 unsigned long results = 0;
29 static void init(
void)
32 for (i = 0; i <
NODES; i++) {
46 static int interval_tree_test_init(
void)
49 unsigned long results;
54 prandom32_seed(&
rnd, 3141592653589793238ULL);
60 for (j = 0; j <
NODES; j++)
62 for (j = 0; j <
NODES; j++)
69 time = div_u64(time, PERF_LOOPS);
70 printk(
" -> %llu cycles\n", (
unsigned long long)time);
74 for (j = 0; j <
NODES; j++)
82 results +=
search(queries[j], &root);
87 time = div_u64(time, SEARCH_LOOPS);
88 results = div_u64(results, SEARCH_LOOPS);
89 printk(
" -> %llu cycles (%lu results)\n",
90 (
unsigned long long)time, results);
95 static void interval_tree_test_exit(
void)