Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2519200imu; Sat, 10 Nov 2018 17:08:10 -0800 (PST) X-Google-Smtp-Source: AJdET5dGOOrGniqo16VnlubotFBK4OKENFDlhyGLTwWT3ma6svoW0GmIAUDv+wgCMv4L2WEbjki0 X-Received: by 2002:a63:790e:: with SMTP id u14mr12568363pgc.452.1541898490357; Sat, 10 Nov 2018 17:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541898490; cv=none; d=google.com; s=arc-20160816; b=RJd+BZ+jwKHQt6iBBv6816vJTN5FombDn1JTbU83+/4DtBReg8GFN/neBdSX8Va+I3 LYCLdNS1b6InEgvAL6xCKLT7YsyOExrmMOPsH9qGYvVeZp0+x6JIZlsq9ZhfODs6Ek6K eiZH12+Hf9UVukVfAOTsQ0Rdd0vO8dWvuk1STxehdxikcZdafwkNty9mwZWNti2RVi/Z urSGO8g8T+6CgPWYzgtGnV4yYTfJX1E7Sz0060j4MB09mJ6WPP0xyqs9+aHtAL4312ty 9WO6FKOIQnPeGpOB3F0r6jvi8TiLzjP2+PmX6f49OoJ9l0yCWqn6iZ8XNn1rHnWK47H4 WElA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LXmGCNQluGxYLrE9ChGRg+fTb1lDo3RR3fl5joStMoE=; b=q/hnw5YoYtq7zcdIqtIB1fXbws63kQjYdqcbhhN56J2pXOcRSbyE59eLk6lkf+D8xU T3Wc58jL6bFQKJD07CkzAL/xb6zojACBJ1o6QJyC+HvmQJD03lyTGfVpVIiYt2yTmVQX XwHw4/u4wNhu9DY9dA0YqvZx7XPw4EHThjZmoRoSAfOBXBVgqVAAzDgEGnBJWehZ+qNx AlC1qNrCDpvd0oT7SGdY/rHqJlTQxo4LNILEYKtj9vV7vz8M5y3pTcuuqPgLxQ0oVDvk 2OqA1kGRWlqhjKTpt6pUXyureJQJOxTo0xeKf5Hb4Qs6/7I8vLuJmz0wt0F+PkegU1fR y16Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si5667935pll.275.2018.11.10.17.07.37; Sat, 10 Nov 2018 17:08:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727200AbeKKKx5 (ORCPT + 99 others); Sun, 11 Nov 2018 05:53:57 -0500 Received: from mga17.intel.com ([192.55.52.151]:40441 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727037AbeKKKx5 (ORCPT ); Sun, 11 Nov 2018 05:53:57 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2018 17:07:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,489,1534834800"; d="scan'208";a="99271532" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by orsmga003.jf.intel.com with ESMTP; 10 Nov 2018 17:07:01 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id 9075D30235B; Sat, 10 Nov 2018 17:07:02 -0800 (PST) Date: Sat, 10 Nov 2018 17:07:02 -0800 From: Andi Kleen To: Travis Downs Cc: milian.wolff@kdab.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, namhyung@kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org Subject: Re: PEBS level 2/3 breaks dwarf unwinding! [WAS: Re: Broken dwarf unwinding - wrong stack pointer register value?] Message-ID: <20181111010702.GC6218@tassilo.jf.intel.com> References: <2335309.gnWok9HYb4@agathebauer> <3227038.olIWmsCzzY@agathebauer> <20181105205119.GC25674@krava> <3799078.YBnU1OB0PF@agathebauer> <20181106001037.GQ6218@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 10, 2018 at 04:42:48PM -0500, Travis Downs wrote: > I guess this problem doesn't occur for LBR unwinding since the LBR > records are captured at the same > moment in time as the PEBS record, so reflect the correct branch > sequence. Actually it happens with LBRs too, but it always gives the backtrace consistently at the PMI trigger point. > What would this fix mean for perf report when you use cycles:pp and > cycles:ppp (or any PEBS based events)? The unwinding should generally > work, but the IP at the top of that stack (from the PMI) will > generally be different than that recorded by PEBS. The tree view and > overhead calculations will be based on the captured stacks, I guess - > but when I annotate, will the values I see correspond to the PEBS IPs > or the PMI IPs? Based on PEBS IPs. It would be a good idea to add a check to perf report that the two IPs are different, and if they differ add some indicator to the sample. This could be a new sort key, although that would waste some space on the screen, or something else. It wouldn't be cover all cases, for example if you have recursion on the same function it might report the same IP even though it's a different instance, but I presume that should be rare enough to not be a problem. -Andi