tools/testing/rbtree/interval_tree_test.c
Source file repositories/reference/linux-study-clean/tools/testing/rbtree/interval_tree_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/rbtree/interval_tree_test.c- Extension
.c- Size
- 1555 bytes
- Lines
- 59
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
linux/math64.hlinux/kern_levels.hshared.hmaple-shared.h../../../lib/interval_tree_test.c
Detected Declarations
function Copyrightfunction interval_tree_testsfunction main
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* interval_tree.c: Userspace Interval Tree test-suite
* Copyright (c) 2025 Wei Yang <richard.weiyang@gmail.com>
*/
#include <linux/math64.h>
#include <linux/kern_levels.h>
#include "shared.h"
#include "maple-shared.h"
#include "../../../lib/interval_tree_test.c"
int usage(void)
{
fprintf(stderr, "Userland interval tree test cases\n");
fprintf(stderr, " -n: Number of nodes in the interval tree\n");
fprintf(stderr, " -p: Number of iterations modifying the tree\n");
fprintf(stderr, " -q: Number of searches to the interval tree\n");
fprintf(stderr, " -s: Number of iterations searching the tree\n");
fprintf(stderr, " -a: Searches will iterate all nodes in the tree\n");
fprintf(stderr, " -m: Largest value for the interval's endpoint\n");
fprintf(stderr, " -r: Random seed\n");
exit(-1);
}
void interval_tree_tests(void)
{
interval_tree_test_init();
interval_tree_test_exit();
}
int main(int argc, char **argv)
{
int opt;
while ((opt = getopt(argc, argv, "n:p:q:s:am:r:")) != -1) {
if (opt == 'n')
nnodes = strtoul(optarg, NULL, 0);
else if (opt == 'p')
perf_loops = strtoul(optarg, NULL, 0);
else if (opt == 'q')
nsearches = strtoul(optarg, NULL, 0);
else if (opt == 's')
search_loops = strtoul(optarg, NULL, 0);
else if (opt == 'a')
search_all = true;
else if (opt == 'm')
max_endpoint = strtoul(optarg, NULL, 0);
else if (opt == 'r')
seed = strtoul(optarg, NULL, 0);
else
usage();
}
maple_tree_init();
interval_tree_tests();
return 0;
}
Annotation
- Immediate include surface: `linux/math64.h`, `linux/kern_levels.h`, `shared.h`, `maple-shared.h`, `../../../lib/interval_tree_test.c`.
- Detected declarations: `function Copyright`, `function interval_tree_tests`, `function main`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.