From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933398AbcI3KMG (ORCPT ); Fri, 30 Sep 2016 06:12:06 -0400 Received: from mga03.intel.com ([134.134.136.65]:43398 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932413AbcI3KMD (ORCPT ); Fri, 30 Sep 2016 06:12:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,271,1473145200"; d="scan'208";a="767507370" Subject: Re: [PATCH 1/2] perf intel-pt-decoder: Report instruction bytes and length in sample To: Andi Kleen , acme@kernel.org References: <1475207387-27726-1-git-send-email-andi@firstfloor.org> Cc: linux-kernel@vger.kernel.org, Andi Kleen From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <52540e1e-1341-4c89-d683-050c30788335@intel.com> Date: Fri, 30 Sep 2016 13:07:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1475207387-27726-1-git-send-email-andi@firstfloor.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wonder if we shouldn't look at something more sophisticated e.g. a python script that can do full disassembly.