Skip to contentSkip to conversation

perf tools: Adjust symbols in VDSO

PATCH New Vladimir Nikulichev 2 participants 2 messages Apr 11, 2014 – Apr 20, 2014 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: Adjust symbols in VDSO

perf tools: Adjust symbols in VDSO

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()
tools/perf/util/symbol-elf.c +0 -0
index 3b7dbf5..6864661 100644
@@ -6,6 +6,7 @@

#include <inttypes.h>

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

@@ -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);
#1 lore raw
perf tools: Adjust symbols in VDSO
Commit-ID:  922d0e4d9f042f68baea28e5b3bd7bb708875f2e
Gitweb:     http://git.kernel.org/tip/922d0e4d9f042f68baea28e5b3bd7bb708875f2e
Author:     Vladimir Nikulichev <[email protected]>
AuthorDate: Thu, 17 Apr 2014 08:27:01 -0700
Committer:  Jiri Olsa <[email protected]>
CommitDate: Sun, 20 Apr 2014 00:15:11 +0200

perf tools: Adjust symbols in VDSO

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()
---
 tools/perf/util/symbol-elf.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/symbol-elf.c +2 -0
index 3b7dbf5..6864661 100644
@@ -6,6 +6,7 @@
 #include <inttypes.h>
 
 #include "symbol.h"
+#include "vdso.h"
 #include <symbol/kallsyms.h>
 #include "debug.h"
 
@@ -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);