From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751629AbcC0LFL (ORCPT ); Sun, 27 Mar 2016 07:05:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57806 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750911AbcC0LFG (ORCPT ); Sun, 27 Mar 2016 07:05:06 -0400 Date: Sun, 27 Mar 2016 13:05:01 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen , adrian.hunter@intel.com Subject: Re: [PATCH 3/4] perf, tools, script: Add support for printing assembler Message-ID: <20160327110501.GA4015@krava.sund.root.ku.dk> References: <1458946958-27570-1-git-send-email-andi@firstfloor.org> <1458946958-27570-3-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458946958-27570-3-git-send-email-andi@firstfloor.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 25, 2016 at 04:02:37PM -0700, Andi Kleen wrote: > From: Andi Kleen > > 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. can't apply this on latest Arnaldo's tree: patching file Documentation/perf-script.txt patching file builtin-script.c Hunk #5 succeeded at 431 (offset -2 lines). Hunk #6 succeeded at 832 with fuzz 2 (offset -10 lines). Hunk #7 FAILED at 871. Hunk #8 succeeded at 890 with fuzz 2 (offset -10 lines). Hunk #9 succeeded at 899 (offset -10 lines). Hunk #10 FAILED at 1018. Hunk #11 succeeded at 2108 (offset -10 lines). 2 out of 11 hunks FAILED -- saving rejects to file builtin-script.c.rej jirka