tools/perf/util/parse-regs-options.c
Source file repositories/reference/linux-study-clean/tools/perf/util/parse-regs-options.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/parse-regs-options.c- Extension
.c- Size
- 2333 bytes
- Lines
- 125
- 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
stdbool.hstdlib.hstdint.hstring.hstdio.hutil/debug.hdwarf-regs.hsubcmd/parse-options.hutil/perf_regs.hutil/parse-regs-options.h
Detected Declarations
function list_perf_regsfunction name_to_perf_reg_maskfunction __parse_regsfunction parse_user_regsfunction parse_intr_regs
Annotated Snippet
if (!strcmp(s, "?")) {
list_perf_regs(stderr, mask);
goto error;
}
reg_mask = name_to_perf_reg_mask(s, mask);
if (reg_mask == 0) {
ui__warning("Unknown register \"%s\", check man page or run \"perf record %s?\"\n",
s, intr ? "-I" : "--user-regs=");
goto error;
}
*mode |= reg_mask;
if (!p)
break;
s = p + 1;
}
ret = 0;
error:
free(os);
return ret;
}
int
parse_user_regs(const struct option *opt, const char *str, int unset)
{
return __parse_regs(opt, str, unset, false);
}
int
parse_intr_regs(const struct option *opt, const char *str, int unset)
{
return __parse_regs(opt, str, unset, true);
}
Annotation
- Immediate include surface: `stdbool.h`, `stdlib.h`, `stdint.h`, `string.h`, `stdio.h`, `util/debug.h`, `dwarf-regs.h`, `subcmd/parse-options.h`.
- Detected declarations: `function list_perf_regs`, `function name_to_perf_reg_mask`, `function __parse_regs`, `function parse_user_regs`, `function parse_intr_regs`.
- 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.