Hi Vladimir,

On Tue, 1 Apr 2014 23:15:14 +0400, Vladimir Nikulichev wrote:
> 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()
> ...

Tested-by: Namhyung Kim <namhy...@kernel.org>

Just one question below..

>
> ---------------------------------------------------------------------------------------------------------------------------
>
> perf tools: Adjust symbols in VDSO
>
> Signed-off-by: Vladimir Nikulichev <n...@tbricks.com>
>
> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> index 3b7dbf5..9c8b23b 100644
> --- a/tools/perf/util/symbol-elf.c
> +++ b/tools/perf/util/symbol-elf.c
> @@ -6,6 +6,7 @@
>  #include <inttypes.h>
>
>  #include "symbol.h"
> +#include "vdso.h"
>  #include <symbol/kallsyms.h>
>  #include "debug.h"
>
> @@ -618,6 +619,8 @@ 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 ||
> +                             (dso->symsrc_filename == NULL &&

Is this really needed?  Just checking is_vdso_map() seems to work well
for me.  Did you have a specific reason to add it?

Thanks,
Namhyung


> +                                     is_vdso_map(dso->short_name)) ||
>                               elf_section_by_name(elf, &ehdr, &shdr,
>                                                    ".gnu.prelink_undo",
>                                                    NULL) != NULL);--
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to