tools/perf/util/demangle-ocaml.c
Source file repositories/reference/linux-study-clean/tools/perf/util/demangle-ocaml.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/demangle-ocaml.c- Extension
.c- Size
- 1460 bytes
- Lines
- 69
- 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
string.hstdlib.hutil/string2.hdemangle-ocaml.hlinux/ctype.h
Detected Declarations
function ocaml_is_mangledfunction ocaml_demangle_sym
Annotated Snippet
if (sym[i] == '_' && sym[i + 1] == '_') {
/* "__" -> "." */
result[j++] = '.';
i += 2;
}
else if (sym[i] == '$' && isxdigit(sym[i + 1]) && isxdigit(sym[i + 2])) {
/* "$xx" is a hex-encoded character */
result[j++] = (hex(sym[i + 1]) << 4) | hex(sym[i + 2]);
i += 3;
}
else {
result[j++] = sym[i++];
}
}
result[j] = '\0';
return result;
}
Annotation
- Immediate include surface: `string.h`, `stdlib.h`, `util/string2.h`, `demangle-ocaml.h`, `linux/ctype.h`.
- Detected declarations: `function ocaml_is_mangled`, `function ocaml_demangle_sym`.
- 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.