tools/perf/builtin-version.c
Source file repositories/reference/linux-study-clean/tools/perf/builtin-version.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/builtin-version.c- Extension
.c- Size
- 977 bytes
- Lines
- 47
- 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
builtin.hcolor.hutil/debug.hutil/header.htools/config.hstdbool.hstdio.hstring.hsubcmd/parse-options.h
Detected Declarations
struct versionfunction library_statusfunction cmd_version
Annotated Snippet
struct version {
bool build_options;
};
static struct version version;
static struct option version_options[] = {
OPT_BOOLEAN(0, "build-options", &version.build_options,
"display the build options"),
OPT_END(),
};
static const char * const version_usage[] = {
"perf version [<options>]",
NULL
};
static void library_status(void)
{
for (int i = 0; supported_features[i].name; ++i)
feature_status__printf(&supported_features[i]);
}
int cmd_version(int argc, const char **argv)
{
argc = parse_options(argc, argv, version_options, version_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
printf("perf version %s\n", perf_version_string);
if (version.build_options || verbose > 0)
library_status();
return 0;
}
Annotation
- Immediate include surface: `builtin.h`, `color.h`, `util/debug.h`, `util/header.h`, `tools/config.h`, `stdbool.h`, `stdio.h`, `string.h`.
- Detected declarations: `struct version`, `function library_status`, `function cmd_version`.
- 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.