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.

Dependency Surface

Detected Declarations

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

Implementation Notes