mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-20 00:50:02 +01:00
perf symbols: Add front end cache for DSO symbol lookup
Acked-by: David Ahern <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
1 parent
768dd3f3a6
commit
b685ac22b4
2 files changed
+10
-1
No files matched your search
@@ -137,6 +137,10 @@ struct dso {
|
||||
struct rb_node rb_node; /* rbtree node sorted by long name */
|
||||
struct rb_root symbols[MAP__NR_TYPES];
|
||||
struct rb_root symbol_names[MAP__NR_TYPES];
|
||||
struct {
|
||||
u64 addr;
|
||||
struct symbol *symbol;
|
||||
} last_find_result[MAP__NR_TYPES];
|
||||
void *a2l;
|
||||
char *symsrc_filename;
|
||||
unsigned int a2l_fails;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user