tools/perf/bench/futex.c
Source file repositories/reference/linux-study-clean/tools/perf/bench/futex.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/bench/futex.c- Extension
.c- Size
- 1741 bytes
- Lines
- 65
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
err.herrno.hstdio.hstdlib.hsys/prctl.hfutex.h
Detected Declarations
function futex_set_nbuckets_paramfunction futex_print_nbuckets
Annotated Snippet
if (ret != params->nbuckets) {
if (ret < 0) {
printf("Can't query number of buckets: %m\n");
err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
}
printf("Requested number of hash buckets does not currently used.\n");
printf("Requested: %d in usage: %d\n", params->nbuckets, ret);
err(EXIT_FAILURE, "prctl(PR_FUTEX_HASH)");
}
if (params->nbuckets == 0)
ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");
else
ret = asprintf(&futex_hash_mode, "Futex hashing: %d hash buckets",
params->nbuckets);
} else {
if (ret <= 0) {
ret = asprintf(&futex_hash_mode, "Futex hashing: global hash");
} else {
ret = asprintf(&futex_hash_mode, "Futex hashing: auto resized to %d buckets",
ret);
}
}
if (ret < 0)
err(EXIT_FAILURE, "ENOMEM, futex_hash_mode");
printf("%s\n", futex_hash_mode);
free(futex_hash_mode);
}
Annotation
- Immediate include surface: `err.h`, `errno.h`, `stdio.h`, `stdlib.h`, `sys/prctl.h`, `futex.h`.
- Detected declarations: `function futex_set_nbuckets_param`, `function futex_print_nbuckets`.
- 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.