linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf unwind: Use addr_location::addr instead of ip for entries
@ 2016-08-16 15:39 Milian Wolff
  2016-08-16 15:49 ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Milian Wolff @ 2016-08-16 15:39 UTC (permalink / raw)
  To: linux-perf-users; +Cc: acme, Milian Wolff

This fixes the srcline translation for call chains of user space
applications.

Before we got:

    perf report --stdio --no-children -s sym,srcline -g address
     8.92%  [.] main                                 mandelbrot.h:41
            |
            |--3.70%--main +8390240
            |          __libc_start_main +139950056726769
            |          _start +8388650
            |
            |--2.74%--main +8390189
            |
             --2.08%--main +8390296
                       __libc_start_main +139950056726769
                       _start +8388650

     7.59%  [.] main                                 complex:1326
            |
            |--4.79%--main +8390203
            |          __libc_start_main +139950056726769
            |          _start +8388650
            |
             --2.80%--main +8390219

     7.12%  [.] __muldc3                             libgcc2.c:1945
            |
            |--3.76%--__muldc3 +139950060519490
            |          main +8390224
            |          __libc_start_main +139950056726769
            |          _start +8388650
            |
             --3.32%--__muldc3 +139950060519512
                       main +8390224

With this patch applied, we instead get:

    perf report --stdio --no-children -s sym,srcline -g address
     8.92%  [.] main                                 mandelbrot.h:41
            |
            |--3.70%--main mandelbrot.h:41
            |          __libc_start_main +241
            |          _start +4194346
            |
            |--2.74%--main mandelbrot.h:41
            |
             --2.08%--main mandelbrot.h:41
                       __libc_start_main +241
                       _start +4194346

     7.59%  [.] main                                 complex:1326
            |
            |--4.79%--main complex:1326
            |          __libc_start_main +241
            |          _start +4194346
            |
             --2.80%--main complex:1326

     7.12%  [.] __muldc3                             libgcc2.c:1945
            |
            |--3.76%--__muldc3 libgcc2.c:1945
            |          main mandelbrot.h:39
            |          __libc_start_main +241
            |          _start +4194346
            |
             --3.32%--__muldc3 libgcc2.c:1945
                       main mandelbrot.h:39

Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
Suggested-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/unwind-libdw.c           | 2 +-
 tools/perf/util/unwind-libunwind-local.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index cf5e250..783a53f 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -66,7 +66,7 @@ static int entry(u64 ip, struct unwind_info *ui)
 	if (__report_module(&al, ip, ui))
 		return -1;
 
-	e->ip  = ip;
+	e->ip  = al.addr;
 	e->map = al.map;
 	e->sym = al.sym;
 
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 97c0f8f..20c2e57 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -542,7 +542,7 @@ static int entry(u64 ip, struct thread *thread,
 	thread__find_addr_location(thread, PERF_RECORD_MISC_USER,
 				   MAP__FUNCTION, ip, &al);
 
-	e.ip = ip;
+	e.ip = al.addr;
 	e.map = al.map;
 	e.sym = al.sym;
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf unwind: Use addr_location::addr instead of ip for entries
  2016-08-16 15:39 [PATCH] perf unwind: Use addr_location::addr instead of ip for entries Milian Wolff
@ 2016-08-16 15:49 ` Namhyung Kim
  2016-08-16 15:56   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2016-08-16 15:49 UTC (permalink / raw)
  To: Milian Wolff; +Cc: linux-perf-users, acme

On Tue, Aug 16, 2016 at 05:39:26PM +0200, Milian Wolff wrote:
> This fixes the srcline translation for call chains of user space
> applications.
> 
> Before we got:
> 
>     perf report --stdio --no-children -s sym,srcline -g address
>      8.92%  [.] main                                 mandelbrot.h:41
>             |
>             |--3.70%--main +8390240
>             |          __libc_start_main +139950056726769
>             |          _start +8388650
>             |
>             |--2.74%--main +8390189
>             |
>              --2.08%--main +8390296
>                        __libc_start_main +139950056726769
>                        _start +8388650
> 
>      7.59%  [.] main                                 complex:1326
>             |
>             |--4.79%--main +8390203
>             |          __libc_start_main +139950056726769
>             |          _start +8388650
>             |
>              --2.80%--main +8390219
> 
>      7.12%  [.] __muldc3                             libgcc2.c:1945
>             |
>             |--3.76%--__muldc3 +139950060519490
>             |          main +8390224
>             |          __libc_start_main +139950056726769
>             |          _start +8388650
>             |
>              --3.32%--__muldc3 +139950060519512
>                        main +8390224
> 
> With this patch applied, we instead get:
> 
>     perf report --stdio --no-children -s sym,srcline -g address
>      8.92%  [.] main                                 mandelbrot.h:41
>             |
>             |--3.70%--main mandelbrot.h:41
>             |          __libc_start_main +241
>             |          _start +4194346
>             |
>             |--2.74%--main mandelbrot.h:41
>             |
>              --2.08%--main mandelbrot.h:41
>                        __libc_start_main +241
>                        _start +4194346
> 
>      7.59%  [.] main                                 complex:1326
>             |
>             |--4.79%--main complex:1326
>             |          __libc_start_main +241
>             |          _start +4194346
>             |
>              --2.80%--main complex:1326
> 
>      7.12%  [.] __muldc3                             libgcc2.c:1945
>             |
>             |--3.76%--__muldc3 libgcc2.c:1945
>             |          main mandelbrot.h:39
>             |          __libc_start_main +241
>             |          _start +4194346
>             |
>              --3.32%--__muldc3 libgcc2.c:1945
>                        main mandelbrot.h:39
> 
> Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
> Suggested-by: Namhyung Kim <namhyung@kernel.org>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/util/unwind-libdw.c           | 2 +-
>  tools/perf/util/unwind-libunwind-local.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
> index cf5e250..783a53f 100644
> --- a/tools/perf/util/unwind-libdw.c
> +++ b/tools/perf/util/unwind-libdw.c
> @@ -66,7 +66,7 @@ static int entry(u64 ip, struct unwind_info *ui)
>  	if (__report_module(&al, ip, ui))
>  		return -1;
>  
> -	e->ip  = ip;
> +	e->ip  = al.addr;
>  	e->map = al.map;
>  	e->sym = al.sym;
>  
> diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
> index 97c0f8f..20c2e57 100644
> --- a/tools/perf/util/unwind-libunwind-local.c
> +++ b/tools/perf/util/unwind-libunwind-local.c
> @@ -542,7 +542,7 @@ static int entry(u64 ip, struct thread *thread,
>  	thread__find_addr_location(thread, PERF_RECORD_MISC_USER,
>  				   MAP__FUNCTION, ip, &al);
>  
> -	e.ip = ip;
> +	e.ip = al.addr;
>  	e.map = al.map;
>  	e.sym = al.sym;
>  
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf unwind: Use addr_location::addr instead of ip for entries
  2016-08-16 15:49 ` Namhyung Kim
@ 2016-08-16 15:56   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-08-16 15:56 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Milian Wolff, linux-perf-users

Em Wed, Aug 17, 2016 at 12:49:39AM +0900, Namhyung Kim escreveu:
> On Tue, Aug 16, 2016 at 05:39:26PM +0200, Milian Wolff wrote:
> > This fixes the srcline translation for call chains of user space
> > applications.
> > 
> > Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
> > Suggested-by: Namhyung Kim <namhyung@kernel.org>
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, I'll get this in my perf/urgent branch,

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-16 16:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 15:39 [PATCH] perf unwind: Use addr_location::addr instead of ip for entries Milian Wolff
2016-08-16 15:49 ` Namhyung Kim
2016-08-16 15:56   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).