Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b685ac22 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf symbols: Add front end cache for DSO symbol lookup



Acked-by: default avatarDavid 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 768dd3f3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
+6 −1
Original line number Diff line number Diff line
@@ -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)