#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/interval_tree.h>
#include <linux/random.h>
#include <linux/slab.h>
#include <asm/timex.h>
#define __param(type, name, init, msg) …
__param(int, nnodes, 100, "Number of nodes in the interval tree");
__param(int, perf_loops, 1000, "Number of iterations modifying the tree");
__param(int, nsearches, 100, "Number of searches to the interval tree");
__param(int, search_loops, 1000, "Number of iterations searching the tree");
__param(bool, search_all, false, "Searches will iterate all nodes in the tree");
__param(uint, max_endpoint, ~0, "Largest value for the interval's endpoint");
static struct rb_root_cached root = …;
static struct interval_tree_node *nodes = …;
static u32 *queries = …;
static struct rnd_state rnd;
static inline unsigned long
search(struct rb_root_cached *root, unsigned long start, unsigned long last)
{ … }
static void init(void)
{ … }
static int interval_tree_test_init(void)
{ … }
static void interval_tree_test_exit(void)
{ … }
module_init(…) …
module_exit(…)
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;