tools/perf/builtin-kallsyms.c
Source file repositories/reference/linux-study-clean/tools/perf/builtin-kallsyms.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/builtin-kallsyms.c- Extension
.c- Size
- 1967 bytes
- Lines
- 82
- 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
inttypes.hbuiltin.hlinux/compiler.hsubcmd/parse-options.hdebug.hdso.henv.hmachine.hmap.hsymbol.h
Detected Declarations
function Copyrightfunction cmd_kallsyms
Annotated Snippet
if (symbol == NULL) {
printf("%s: not found\n", argv[i]);
continue;
}
dso = map__dso(map);
printf("%s: %s %s %#" PRIx64 "-%#" PRIx64 " (%#" PRIx64 "-%#" PRIx64")\n",
symbol->name, dso__short_name(dso), dso__long_name(dso),
map__unmap_ip(map, symbol->start), map__unmap_ip(map, symbol->end),
symbol->start, symbol->end);
}
out:
machine__delete(machine);
perf_env__exit(&host_env);
return err;
}
int cmd_kallsyms(int argc, const char **argv)
{
const struct option options[] = {
OPT_INCR('v', "verbose", &verbose, "be more verbose (show counter open errors, etc)"),
OPT_END()
};
const char * const kallsyms_usage[] = {
"perf kallsyms [<options>] symbol_name",
NULL
};
argc = parse_options(argc, argv, options, kallsyms_usage, 0);
if (argc < 1)
usage_with_options(kallsyms_usage, options);
symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
if (symbol__init(NULL) < 0)
return -1;
return __cmd_kallsyms(argc, argv);
}
Annotation
- Immediate include surface: `inttypes.h`, `builtin.h`, `linux/compiler.h`, `subcmd/parse-options.h`, `debug.h`, `dso.h`, `env.h`, `machine.h`.
- Detected declarations: `function Copyright`, `function cmd_kallsyms`.
- 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.