Skip to content

Commit

Permalink
perf tools: Adjust symbols in VDSO
Browse files Browse the repository at this point in the history
pert-report doesn't resolve function names in VDSO:

$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
            8.76%
               0x7fff6b1fe861
               __gettimeofday
               ACE_OS::gettimeofday()
...

In this case symbol values should be adjusted the same way as for executables,
relocatable objects and prelinked libraries.

After fix:

$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
            8.76%
               __vdso_gettimeofday
               __gettimeofday
               ACE_OS::gettimeofday()

Signed-off-by: Vladimir Nikulichev <[email protected]>
Tested-by: Namhyung Kim <[email protected]>
Reviewed-by: Adrian Hunter <[email protected]>
Link: http://lkml.kernel.org/r/969812.163009436-sendEmail@nvs
Signed-off-by: Jiri Olsa <[email protected]>
  • Loading branch information
Vladimir Nikulichev authored and Jiri Olsa committed Apr 19, 2014
1 parent acb61fc commit 922d0e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/perf/util/symbol-elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <inttypes.h>

#include "symbol.h"
#include "vdso.h"
#include <symbol/kallsyms.h>
#include "debug.h"

Expand Down Expand Up @@ -618,6 +619,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
GElf_Shdr shdr;
ss->adjust_symbols = (ehdr.e_type == ET_EXEC ||
ehdr.e_type == ET_REL ||
is_vdso_map(dso->short_name) ||
elf_section_by_name(elf, &ehdr, &shdr,
".gnu.prelink_undo",
NULL) != NULL);
Expand Down

0 comments on commit 922d0e4

Please sign in to comment.