1
0
Fork 0
alistair23-linux/tools/perf
Arnaldo Carvalho de Melo 79406cd789 perf symbols: Allow lookups by symbol name too
Configurable via symbol_conf.sort_by_name, so that the cost of an
extra rb_node on all 'struct symbol' instances is not paid by tools
that only want to decode addresses.

How to use it:

	symbol_conf.sort_by_name = true;
	symbol_init(&symbol_conf);

	struct map *map = map_groups__find_by_name(kmaps, MAP__VARIABLE, "[kernel.kallsyms]");

	if (map == NULL) {
		pr_err("couldn't find map!\n");
		kernel_maps__fprintf(stdout);
	} else {
		struct symbol *sym = map__find_symbol_by_name(map, sym_filter, NULL);
		if (sym == NULL)
			pr_err("couldn't find symbol %s!\n", sym_filter);
		else
			pr_info("symbol %s: %#Lx-%#Lx \n", sym_filter, sym->start, sym->end);
	}

Looking over the vmlinux/kallsyms is common enough that I'll add a
variable to the upcoming struct perf_session to avoid the need to
use map_groups__find_by_name to get the main vmlinux/kallsyms map.

The above example looks on the 'variable' symtab, but it is just
like that for the functions one.

Also the sort operation is done when we first use
map__find_symbol_by_name, in a lazy way.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260564622-12392-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-12 07:42:11 +01:00
..
Documentation perf kmem: Show usage if no option is specified 2009-12-10 08:30:27 +01:00
bench perf tools: Introduce zalloc() for the common calloc(1, N) case 2009-11-24 16:37:02 +01:00
scripts/perl perf trace/scripting: Add Fedora libperl install note to doc 2009-11-30 09:04:01 +01:00
util perf symbols: Allow lookups by symbol name too 2009-12-12 07:42:11 +01:00
.gitignore perf tools: Add perf.data to .gitignore 2009-11-24 16:37:01 +01:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
Makefile perf tools: Allow cross compiling 2009-12-11 11:24:13 +01:00
builtin-annotate.c perf annotate: Fix perf data parsing 2009-12-01 08:14:08 +01:00
builtin-bench.c perf bench: Add memcpy() benchmark 2009-11-19 06:21:48 +01:00
builtin-buildid-list.c perf buildid-list: Fix copy'n'paste help message 2009-12-06 21:07:08 +01:00
builtin-help.c perf tools: Introduce zalloc() for the common calloc(1, N) case 2009-11-24 16:37:02 +01:00
builtin-kmem.c perf symbols: Rename kthreads to kmaps, using another abstraction for it 2009-12-12 07:42:09 +01:00
builtin-list.c perf list: Fix large list output by using the pager 2009-08-13 09:05:48 +02:00
builtin-probe.c perf probe: Support --del option 2009-12-09 07:26:53 +01:00
builtin-record.c perf record, x86: Print more intelligent error message when sampling fails 2009-11-23 09:40:13 +01:00
builtin-report.c perf: Make common SAMPLE_EVENT parser 2009-12-06 18:15:01 +01:00
builtin-sched.c perf sched: Add max delay time snapshot 2009-12-10 08:30:26 +01:00
builtin-stat.c perf stat: Do not print ratio when task-clock event is not counted 2009-11-15 15:25:50 +01:00
builtin-timechart.c perf: Make common SAMPLE_EVENT parser 2009-12-06 18:15:01 +01:00
builtin-top.c perf tools: Consolidate symbol resolving across all tools 2009-11-27 20:22:02 +01:00
builtin-trace.c perf: Make common SAMPLE_EVENT parser 2009-12-06 18:15:01 +01:00
builtin.h perf: Add 'perf kmem' tool 2009-11-20 09:51:41 +01:00
command-list.txt perf kmem: Add help file 2009-11-24 08:49:51 +01:00
design.txt perf_event: Add alignment-faults and emulation-faults software events 2009-10-28 16:13:03 +11:00
perf.c perf: Add 'perf kmem' tool 2009-11-20 09:51:41 +01:00
perf.h perf tools: Allow building for ARM 2009-12-11 13:50:21 +01:00