perf tools: Introduce struct map_symbol

That will be in both struct hist_entry and struct
callchain_list, so that the TUI can store a pointer to the pair
(map, symbol) in the trees where hist_entries and
callchain_lists are present, to allow precise annotation instead
of looking for the first symbol with the selected name.

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: <1269459619-982-4-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Arnaldo Carvalho de Melo
2010-03-24 16:40:17 -03:00
committed by Ingo Molnar
parent ac73c5a9c1
commit 59fd53062f
6 changed files with 41 additions and 35 deletions

View File

@ -131,8 +131,8 @@ sort__comm_print(FILE *fp, struct hist_entry *self, unsigned int width)
int64_t
sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
{
struct dso *dso_l = left->map ? left->map->dso : NULL;
struct dso *dso_r = right->map ? right->map->dso : NULL;
struct dso *dso_l = left->ms.map ? left->ms.map->dso : NULL;
struct dso *dso_r = right->ms.map ? right->ms.map->dso : NULL;
const char *dso_name_l, *dso_name_r;
if (!dso_l || !dso_r)
@ -152,9 +152,9 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
size_t
sort__dso_print(FILE *fp, struct hist_entry *self, unsigned int width)
{
if (self->map && self->map->dso) {
const char *dso_name = !verbose ? self->map->dso->short_name :
self->map->dso->long_name;
if (self->ms.map && self->ms.map->dso) {
const char *dso_name = !verbose ? self->ms.map->dso->short_name :
self->ms.map->dso->long_name;
return repsep_fprintf(fp, "%-*s", width, dso_name);
}
@ -168,11 +168,11 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
{
u64 ip_l, ip_r;
if (left->sym == right->sym)
if (left->ms.sym == right->ms.sym)
return 0;
ip_l = left->sym ? left->sym->start : left->ip;
ip_r = right->sym ? right->sym->start : right->ip;
ip_l = left->ms.sym ? left->ms.sym->start : left->ip;
ip_r = right->ms.sym ? right->ms.sym->start : right->ip;
return (int64_t)(ip_r - ip_l);
}
@ -184,13 +184,13 @@ sort__sym_print(FILE *fp, struct hist_entry *self, unsigned int width __used)
size_t ret = 0;
if (verbose) {
char o = self->map ? dso__symtab_origin(self->map->dso) : '!';
char o = self->ms.map ? dso__symtab_origin(self->ms.map->dso) : '!';
ret += repsep_fprintf(fp, "%#018llx %c ", (u64)self->ip, o);
}
ret += repsep_fprintf(fp, "[%c] ", self->level);
if (self->sym)
ret += repsep_fprintf(fp, "%s", self->sym->name);
if (self->ms.sym)
ret += repsep_fprintf(fp, "%s", self->ms.sym->name);
else
ret += repsep_fprintf(fp, "%#016llx", (u64)self->ip);