From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87686C4363D for ; Tue, 6 Oct 2020 13:17:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D711F20782 for ; Tue, 6 Oct 2020 13:17:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uN7SsLxj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725939AbgJFNRN (ORCPT ); Tue, 6 Oct 2020 09:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgJFNRN (ORCPT ); Tue, 6 Oct 2020 09:17:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D8F7C061755 for ; Tue, 6 Oct 2020 06:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=rSKNWz3b/7/5EgmMTP1JWJ0db8STYH+xkYzYpdZr3v8=; b=uN7SsLxjRmTspj4Cv9dfVLtVIU /8g81JbeJjX+sjj6g0Bkiuavx49ooNugZG1RJGbxYnrOauWvCJ0ODSdkA7pOcYxGtfiPyU+TUb/8t FvvAp9FwVWQymZMiOLX/hNsaZ0jVOVsXNCmrH8TowJceGxCAeU0aWpB3+jHX2aAGMkMzekFHwcSQ9 3f3VnY+gQqoKZmZMXcI0S+JtS0JiC5mGLTESd9fmS2QdbK65S0hoZoKJm+RdNAAA/TlQqLCS4seJB bDpJl6CHbxwMlWtgNwZ9Nt0dK5CNYR3MpXd2myRusluay2USHog2wlglOf6S0xUxiwfGaid8b/jlb qNy9jLfA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPmq0-00014Z-G9; Tue, 06 Oct 2020 13:17:05 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5C7DB3011C6; Tue, 6 Oct 2020 15:17:03 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3323A2B8462E1; Tue, 6 Oct 2020 15:17:03 +0200 (CEST) Date: Tue, 6 Oct 2020 15:17:03 +0200 From: Peter Zijlstra To: linux-toolchains@vger.kernel.org, Stephane Eranian , Arnaldo Carvalho de Melo Cc: linux-kernel@ver.kernel.org, Ingo Molnar , Jiri Olsa , namhyung@kernel.org, irogers@google.com, kim.phillips@amd.com, Mark Rutland Subject: Additional debug info to aid cacheline analysis Message-ID: <20201006131703.GR2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org Hi all, I've been trying to float this idea for a fair number of years, and I think at least Stephane has been talking to tools people about it, but I'm not sure what, if anything, ever happened with it, so let me post it here :-) Basically, what I want is a (perf) tool for cacheline optimizations. Something very much like the excellent pahole tool, but with hit/miss information added. Now, some PMUs provide the data address for various relevant events, but that gets us the problem of mapping a 'random' address to a type and offset. And esp. for dynamic objects, that's a difficult problem. However, the compiler actually knows what type and offset (most) memory references are, so if perf can get us the exact IP (Intel PEBS / AMD IBS, as opposed to one with skid on) we could get the type from debug info. And therein lies the rub, existing debug info (DWARF) does contain type information, but in a way that is (I've been told) _very_ hard to use for this purpose. So could the compiler emit extra debug info for every instruction with a memory reference on to facilitate this? ~ Peter