Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1136431pxu; Thu, 8 Oct 2020 04:25:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVfDcRcZKCTf7m+x5fYUmFSMevi+BEUba6QfF+3nQdec+S+zWXkbhLQGi5qRdp0uGj3beV X-Received: by 2002:a05:6402:7d2:: with SMTP id u18mr8555344edy.69.1602156319909; Thu, 08 Oct 2020 04:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602156319; cv=none; d=google.com; s=arc-20160816; b=eQkh3wUktwZCjdcGf4kCrSFY6wKoDpokRFNF+fFsZ7Fd829IeFwZoFz+fY+CWro40z HjLtQXFAWDkp/OXnM7QUVILB+6RHmkYu5VlmzDDy4lJQaIPc2BhIOazpHSf5hkfWMD8y CdBmpo4g/nUWS9ghVjU0tkYFTN7FoLA7S76tNu9AG937zA6Z8nJHYAoBAbHbnVs0TUXy 0oIl1Q7DPu99QNRd/Kz7fZ1ksERKIw+o7zmT87LvUnZzq6i8mUESjWzH6tHnSRdZlCSY Tr398KgXAVaHFoVnG+Gs9NwO/LMrEFVQgUcSmjSrJw79BQm1CxBI9pPorR6FbuOT1+N+ eC/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=o6ZcoHgw7AxZwKJejsHfHQ+PKyTQzuV6ST0fVCIz8nQ=; b=mC21CoVF5Gs0aILuFZ1zggfloeaLVJgrtRqUGv9dGgj6ZekoJIVREJrvSVEdPQunwH kYMo2i+ZTYk5/d6nYQRPSdUIplMc5+rJuXl+b8HeruN6k+RYrPnxKX7CoyKbdpL6Qh8b 735tVJ72ExykT+UQQtHFxKXgR7WtMPrqyUEUX5JiY3mOArrOG6e7E4ALiWPot+Ye2rUz l3yF/cFLplmZJHJvTJT7NvcLNibzRemG8o18Cx1FKSn4ZexE00XoFZ/3F3o2fleMRpmb otsiWd5MImcj7a+rZp+5rQcxciVrr9/rY6fJEYLG63yfYrOjWeSq7gK8S0wZ9qNnDbNw 5QkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si3357494eje.580.2020.10.08.04.24.28; Thu, 08 Oct 2020 04:25:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729176AbgJHJiC convert rfc822-to-8bit (ORCPT + 99 others); Thu, 8 Oct 2020 05:38:02 -0400 Received: from wildebeest.demon.nl ([212.238.236.112]:43594 "EHLO gnu.wildebeest.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbgJHJiC (ORCPT ); Thu, 8 Oct 2020 05:38:02 -0400 X-Greylist: delayed 328 seconds by postgrey-1.27 at vger.kernel.org; Thu, 08 Oct 2020 05:38:02 EDT Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id E1828300160F; Thu, 8 Oct 2020 11:32:32 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 945F440007BE; Thu, 8 Oct 2020 11:32:32 +0200 (CEST) Message-ID: <50338de81b34031db8637337f08b89b588476211.camel@klomp.org> Subject: Re: Additional debug info to aid cacheline analysis From: Mark Wielaard To: Peter Zijlstra , Stephane Eranian Cc: linux-toolchains@vger.kernel.org, Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Ingo Molnar , Jiri Olsa , Namhyung Kim , Ian Rogers , "Phillips, Kim" , Mark Rutland , Andi Kleen , Masami Hiramatsu Date: Thu, 08 Oct 2020 11:32:32 +0200 In-Reply-To: <20201008070231.GS2628@hirez.programming.kicks-ass.net> References: <20201006131703.GR2628@hirez.programming.kicks-ass.net> <20201008070231.GS2628@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.28.5 (3.28.5-8.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on gnu.wildebeest.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, 2020-10-08 at 09:02 +0200, Peter Zijlstra wrote: > Some time ago, I had my intern pursue the other 2 approaches for > > symbolization. The one I see as most promising is by using the DWARF > > information (no BPF needed). The good news is that I believe we do not > > need more information than what is already there. We just need the > > compiler to generate valid DWARF at most optimization levels, which I > > believe is not the case for LLVM based compilers but maybe okay for > > GCC. > > Right, I think GCC improved a lot on this front over the past few years. > Also added Andi and Masami, who have worked on this or related topics. For GCC Alexandre Oliva did a really thorough write up of all the various optimization and their effect on debugging/DWARF: https://www.fsfla.org/~lxoliva/writeups/gOlogy/gOlogy.html GCC using -fvar-tracking and -fvar-tracking-assignments is pretty good at keeping track of where variables are held (in memory or registers) when in the program, even through various optimizations. -fvar-tracking-assignments is the default with -g -O2. Except for the upstream linux kernel code. Most distros enable it again, but you do want to enable it by hand when building from the upstream linux git repo. Basically you simply want to remove this line in the top-level Makefile: DEBUG_CFLAGS := $(call cc-option, -fno-var-tracking-assignments) Cheers, Mark