Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbaBKLuX (ORCPT ); Tue, 11 Feb 2014 06:50:23 -0500 Received: from mail-yh0-f41.google.com ([209.85.213.41]:62987 "EHLO mail-yh0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbaBKLuT (ORCPT ); Tue, 11 Feb 2014 06:50:19 -0500 Date: Tue, 11 Feb 2014 08:50:13 -0300 From: Arnaldo Carvalho de Melo To: Peter Zijlstra Cc: Stephane Eranian , Don Zickus , LKML , Jiri Olsa , Joe Mario , Richard Fowles Subject: Re: [PATCH 00/21] perf, c2c: Add new tool to analyze cacheline contention on NUMA systems Message-ID: <20140211115013.GE28757@ghostprotocols.net> References: <20140210212955.GC5002@laptop.programming.kicks-ass.net> <20140211071401.GG27965@twins.programming.kicks-ass.net> <20140211105217.GS9987@twins.programming.kicks-ass.net> <20140211110242.GU9987@twins.programming.kicks-ass.net> <20140211111421.GN27965@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140211111421.GN27965@twins.programming.kicks-ass.net> X-Url: http://acmel.wordpress.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 Em Tue, Feb 11, 2014 at 12:14:21PM +0100, Peter Zijlstra escreveu: > On Tue, Feb 11, 2014 at 12:08:56PM +0100, Stephane Eranian wrote: > > Assuming you can decode and get the info about the base registers used, > > you'd have to do this for each arch with load/store sampling capabilities. > > this is painful compared to getting the portable info from dwarf directly. > But its useful now, as compared to whenever GCC gets around to > implementing more dwarves and that GCC getting used widely enough to > actually rely on it. > All you need for the decode is a disassembler, and every arch should > already have multiple of those. Should be easy to reuse one, right? Yeah, I never got around to actually try to implement this, but my feeling was that all the bits and pieces were there already: 1) the precise IP for the instruction, that disassembled would tell which registers were being operated on, or memory that we would "reverse map" to a register 2) DWARF expression locations that allows us to go from registers to a variable/parameter and thus to a type 3) PERF_SAMPLE_REGS_USER (from a quick look, why do we have "USER" in it? Jiri?) 4) libunwind have register maps for various arches, so probably something there could be reused here as well (Jiri?) Get that and generate a series of (type,offset) tuples for the samples and get pahole to highlight the members with different colours, just like 'annotate' does with source code/asm. That way we would reuse 'pahole' in much the same way as we reuse 'objdump'. Give some more time to revisit the libdwarves APIs and then we could use it directly on perf or perhaps extract just what is needed and merge into the kernel sources. - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/