f1dfa0b1c1
Example: { u64 addr = strtoull(sym_filter, NULL, 16); struct map *map = map_groups__find(kmaps, MAP__VARIABLE, addr); if (map == NULL) pr_err("couldn't find map!\n"); else { struct symbol *sym = map__find_symbol(map, addr, NULL); if (sym == NULL) pr_err("couldn't find addr!\n"); else pr_info("addr %#Lx is in %s global var\n", addr, sym->name); } exit(0); } Added just after symbol__init() call in 'perf top', then: { u64 addr = strtoull(sym_filter, NULL, 16); struct map *map = map_groups__find(kmaps, MAP__VARIABLE, addr); if (map == NULL) pr_err("couldn't find map!\n"); else { struct symbol *sym = map__find_symbol(map, addr, NULL); if (sym == NULL) pr_err("couldn't find addr!\n"); else pr_info("addr %#Lx is in %s global var\n", addr, sym->name); } exit(0); } [root@doppio linux-2.6-tip]# grep ' [dD] ' /proc/kallsyms | grep ' sched' ffffffff817827d8 d sched_nr_latency ffffffff81782ce0 d sched_domains_mutex ffffffff8178c070 d schedstr.22423 ffffffff817909a0 d sched_register_mutex ffffffff81823490 d sched_feat_names ffffffff81823558 d scheduler_running ffffffff818235b8 d sched_clock_running ffffffff818235bc D sched_clock_stable ffffffff81824f00 d sched_switch_trace [root@doppio linux-2.6-tip]# perf top -s 0xffffffff817827d9 addr 0xffffffff817827d9 is in sched_nr_latency global var [root@doppio linux-2.6-tip]# perf top -s ffffffff81782ce0 addr 0xffffffff81782ce0 is in sched_domains_mutex global var [root@doppio linux-2.6-tip]# [root@doppio linux-2.6-tip]# perf top -s ffffffff81782ce0 --vmlinux OFF The file OFF cannot be used, trying to use /proc/kallsyms...addr 0xffffffff81782ce0 is in sched_domains_mutex global var [root@doppio linux-2.6-tip]# perf top -s ffffffff818235bc --vmlinux OFF The file OFF cannot be used, trying to use /proc/kallsyms...addr 0xffffffff818235bc is in sched_clock_stable global var [root@doppio linux-2.6-tip]# So it works with both /proc/kallsyms and with ELF symtabs, either the one on the vmlinux explicitely passed via --vmlinux or in one in the vmlinux_path that matches the buildid for the running kernel or the one found in the buildid header section in a perf.data file. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1260550239-5372-4-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> |
||
---|---|---|
.. | ||
include | ||
abspath.c | ||
alias.c | ||
cache.h | ||
callchain.c | ||
callchain.h | ||
color.c | ||
color.h | ||
config.c | ||
ctype.c | ||
data_map.c | ||
data_map.h | ||
debug.c | ||
debug.h | ||
debugfs.c | ||
debugfs.h | ||
environment.c | ||
event.c | ||
event.h | ||
exec_cmd.c | ||
exec_cmd.h | ||
generate-cmdlist.sh | ||
header.c | ||
header.h | ||
help.c | ||
help.h | ||
hist.c | ||
hist.h | ||
levenshtein.c | ||
levenshtein.h | ||
map.c | ||
pager.c | ||
parse-events.c | ||
parse-events.h | ||
parse-options.c | ||
parse-options.h | ||
path.c | ||
PERF-VERSION-GEN | ||
probe-event.c | ||
probe-event.h | ||
probe-finder.c | ||
probe-finder.h | ||
quote.c | ||
quote.h | ||
run-command.c | ||
run-command.h | ||
sigchain.c | ||
sigchain.h | ||
sort.c | ||
sort.h | ||
strbuf.c | ||
strbuf.h | ||
string.c | ||
string.h | ||
strlist.c | ||
strlist.h | ||
svghelper.c | ||
svghelper.h | ||
symbol.c | ||
symbol.h | ||
thread.c | ||
thread.h | ||
trace-event-info.c | ||
trace-event-parse.c | ||
trace-event-perl.c | ||
trace-event-perl.h | ||
trace-event-read.c | ||
trace-event.h | ||
types.h | ||
usage.c | ||
util.h | ||
values.c | ||
values.h | ||
wrapper.c |