Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345629

Re: [PATCH 2/2] perf, tools, script: Add support for printing assembler

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] perf, tools, script: Add support for printing assembler
Date 2016-02-29 11:30 +0100
Message-ID <r7tfs-1JX-11@gated-at.bofh.it> (permalink)
References <r6B5n-32u-1@gated-at.bofh.it> <r6B5n-32u-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Feb 26, 2016 at 04:32:08PM -0800, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> When dumping PT traces with perf script it is very useful to see the
> assembler for each sample, so that it is easily possible to follow
> the control flow.
> 
> As using objdump is difficult and inefficient from perf script this
> patch uses the udis86 library to implement assembler output.
> The library can be downloaded from http://udis86.sourceforge.net/
> 
> The library is probed as an external dependency in the usual way. Then perf
> script calls into it when needed, and handles callbacks to resolve
> symbols.
> 
> % perf record -e intel_pt//u true
> % perf script -F sym,symoff,ip,asm --itrace=i0ns | head
>      7fc7188b4190 _start+0x0	mov %rsp, %rdi
>      7fc7188b4193 _start+0x3	call _dl_start
>      7fc7188b7710 _dl_start+0x0	push %rbp
>      7fc7188b7711 _dl_start+0x1	mov %rsp, %rbp
>      7fc7188b7714 _dl_start+0x4	push %r15
>      7fc7188b7716 _dl_start+0x6	push %r14
>      7fc7188b7718 _dl_start+0x8	push %r13
>      7fc7188b771a _dl_start+0xa	push %r12
>      7fc7188b771c _dl_start+0xc	mov %rdi, %r12
>      7fc7188b771f _dl_start+0xf	push %rbx
> 
> Current issues:
> - Some jump references do not get resolved to symbols.
> - udis86 release does not support STAC/CLAC, which are used in the kernel,
> but there is a pending patch for it.
> 
> Cc: adrian.hunter@intel.com
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  tools/build/Makefile.feature             |   6 +-
>  tools/build/feature/Makefile             |   8 ++-
>  tools/build/feature/test-all.c           |   5 ++
>  tools/build/feature/test-udis86.c        |   8 +++

hi,
could you please split the udis86 detection from the rest?

thanks,
jirka

>  tools/perf/Documentation/perf-script.txt |   4 +-
>  tools/perf/builtin-script.c              | 108 +++++++++++++++++++++++++++++--
>  tools/perf/config/Makefile               |   5 ++
>  7 files changed, 134 insertions(+), 10 deletions(-)
>  create mode 100644 tools/build/feature/test-udis86.c

SNIP

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] perf, tools: Add support for skipping itrace instructions Andi Kleen <andi@firstfloor.org> - 2016-02-27 01:40 +0100
  [PATCH 2/2] perf, tools, script: Add support for printing assembler Andi Kleen <andi@firstfloor.org> - 2016-02-27 01:40 +0100
    Re: [PATCH 2/2] perf, tools, script: Add support for printing  assembler Jiri Olsa <jolsa@redhat.com> - 2016-02-29 11:30 +0100
    Re: [PATCH 2/2] perf, tools, script: Add support for printing  assembler Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 16:00 +0100
      Re: [PATCH 2/2] perf, tools, script: Add support for printing  assembler Andi Kleen <andi@firstfloor.org> - 2016-02-29 18:40 +0100
        Re: [PATCH 2/2] perf, tools, script: Add support for printing  assembler Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 20:30 +0100
          Intel PT not work on 4.5-rc6 as well after suspend/resume assembler Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-01 16:40 +0100
            Re: Intel PT not work on 4.5-rc6 as well after suspend/resume  assembler Andi Kleen <ak@linux.intel.com> - 2016-03-02 01:00 +0100
              Re: Intel PT not work on 4.5-rc6 as well after suspend/resume  assembler Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-02 13:10 +0100

csiph-web