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.

Dependency Surface

Detected Declarations

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

Implementation Notes