aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorGravatar Arnaldo Carvalho de Melo <acme@redhat.com> 2015-07-22 12:52:17 -0300
committerGravatar Arnaldo Carvalho de Melo <acme@redhat.com> 2015-07-23 11:28:35 -0300
commitb685ac22b436455db9c9c16b384d7aa4531cdd80 (patch)
tree8873e805f4c605c1d29c4595013bb294cd5de3c3 /tools/perf/util/symbol.c
parentperf header: Use argv style storage for cmdline feature data (diff)
downloadlinux-b685ac22b436455db9c9c16b384d7aa4531cdd80.tar.gz
linux-b685ac22b436455db9c9c16b384d7aa4531cdd80.tar.bz2
linux-b685ac22b436455db9c9c16b384d7aa4531cdd80.zip
perf symbols: Add front end cache for DSO symbol lookup
Acked-by: David Ahern <dsahern@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-voo94tow8wpkcc76mlkny6sc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 45c2e3a8316b..725640fd7cd8 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -444,7 +444,12 @@ static struct symbol *symbols__find_by_name(struct rb_root *symbols,
struct symbol *dso__find_symbol(struct dso *dso,
enum map_type type, u64 addr)
{
- return symbols__find(&dso->symbols[type], addr);
+ if (dso->last_find_result[type].addr != addr) {
+ dso->last_find_result[type].addr = addr;
+ dso->last_find_result[type].symbol = symbols__find(&dso->symbols[type], addr);
+ }
+
+ return dso->last_find_result[type].symbol;
}
struct symbol *dso__first_symbol(struct dso *dso, enum map_type type)