From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753204AbcJDAdK (ORCPT ); Mon, 3 Oct 2016 20:33:10 -0400 Received: from one.firstfloor.org ([193.170.194.197]:50684 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753608AbcJDAdI (ORCPT ); Mon, 3 Oct 2016 20:33:08 -0400 Date: Mon, 3 Oct 2016 17:33:05 -0700 From: Andi Kleen To: Adrian Hunter Cc: Andi Kleen , acme@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 1/2] perf intel-pt-decoder: Report instruction bytes and length in sample Message-ID: <20161004003305.GM5871@two.firstfloor.org> References: <1475207387-27726-1-git-send-email-andi@firstfloor.org> <52540e1e-1341-4c89-d683-050c30788335@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52540e1e-1341-4c89-d683-050c30788335@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 30, 2016 at 01:07:17PM +0300, Adrian Hunter wrote: > On 30/09/16 06:49, Andi Kleen wrote: > > From: Andi Kleen > > > > Change the Intel PT decoder to pass up the length and the instruction > > bytes of the decoded or sampled instruction in the perf sample. > > > > The decoder already knows this information, we just need to pass it > > up. Since it is only a couple of movs it is not very expensive. > > The decoder doesn't always fill the instruction buffer because it caches the > results from walking basic blocks. That means the bytes from the last > instruction in the basic block would need to be added to the cache. I fixed this and posted a new version. > > I wonder if we shouldn't look at something more sophisticated e.g. a python > script that can do full disassembly. I had an earlier version that used a disassembler library, but that wasn't appreciated, so now switched to this simpler method. Assembler output can be done with a sed + objdump hack now. -Andi