Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1584922imu; Tue, 6 Nov 2018 00:40:51 -0800 (PST) X-Google-Smtp-Source: AJdET5cfWhIqyC4AQpJO/DHys5syvCz6h4KgJhw6Ut1QiiksEL1LB/aNOUGK0WWhW6m+W79JyBs6 X-Received: by 2002:a17:902:c7:: with SMTP id a65-v6mr14685600pla.296.1541493651725; Tue, 06 Nov 2018 00:40:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541493651; cv=none; d=google.com; s=arc-20160816; b=V0upXP0Tyqc9sk4kBpD+8ValTx2hqijxIEze3F5jhdyXrbrt5BcS1YtsGMEgPjF++N qXMKKJV94pMF7h3biylifkFPUlWkFfE2B1cP8UWwN2bZWuutvpWjXJDc/UPb206Mpwle qyhaoACqtDBdM6cg4qqozwhQDOZLVZ8EIegRcANIhF0B32n9oLV82p8s4KzZzt8tjMnU 0Pn785ekIaflfaqTwRsutDUgw2h70O8nLNSxFnAANwsa4c0HJdteqHopfn/pYu+fC8vm gmUBcIkt+ZMibwtzEyIa6RteXYwlTp1gKIPk9tJoucQv30Ha/xSb1IlVK9IMFnbPimL5 Xmew== 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=mcXs3GncM+LH7fK8Zzml0feSVR6+bFammxKGTd7W4lw=; b=hjiiloZyvW2v+Na/Bj/DDs8lC1ndmZ/A3I9nFNY7El/dDo03wEvVxl2FbTIJOX83e1 4WSMoTjNhYwHR7UTJiYbUYfXhS4oaePRFpGGtxXphB+vMkaqf0L89oa0BvPv12fdzTc6 9sceUsyjDv/8m5RBsBh89HR0BHYKN5YB9UZLbUNOr7gaFSDebYLfGslGe630TgEj209b ZvPzNy6unlgJL/ex9P1reYdXrWgMcbCgN4WjEHfduYakucU2koNE6/FIx2lthXxsD+z7 Km+g5CZL+xaGV22Pm49H7prAwEchSCB21JXwxUxSnlZl8ftIGUk1SH7sazZCl0aqzGOf BfeA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1-v6si41596131pld.355.2018.11.06.00.40.36; Tue, 06 Nov 2018 00:40:51 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387481AbeKFSEK (ORCPT + 99 others); Tue, 6 Nov 2018 13:04:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35808 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729349AbeKFSEK (ORCPT ); Tue, 6 Nov 2018 13:04:10 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D82EAC05E75A; Tue, 6 Nov 2018 08:40:02 +0000 (UTC) Received: from krava (unknown [10.40.205.69]) by smtp.corp.redhat.com (Postfix) with SMTP id D780A4138; Tue, 6 Nov 2018 08:39:58 +0000 (UTC) Date: Tue, 6 Nov 2018 09:39:57 +0100 From: Jiri Olsa To: Andi Kleen Cc: Milian Wolff , linux-kernel@vger.kernel.org, Jiri Olsa , namhyung@kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho Subject: Re: PEBS level 2/3 breaks dwarf unwinding! [WAS: Re: Broken dwarf unwinding - wrong stack pointer register value?] Message-ID: <20181106083957.GB8081@krava> 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: <20181106001037.GQ6218@tassilo.jf.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 06 Nov 2018 08:40:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 05, 2018 at 04:10:37PM -0800, Andi Kleen wrote: > > > > - PMU triggers interrupt and PEBS stores RIP etc. > > > > - code continous to execute, possibly changing the stack > > > > > > I dont think the code continues to execute.. the stack is ok > > > > Are you sure about this? I mean, isn't that the whole reason why we need PEBS? > > Generally, if you are sure about this, can you point me to some documentation > > on this to allow me to understand it better? > > Milian is right. > > There is a execution window from PEBS capturing registers to actually triggering > the PMU, and if there is stack manipulation in that window > the PEBS state might be out of sync with the real stack. hum, is this about having 'large pebs' or there's this window if there's also only single pebs record allowed? which should be case for dwarf unwind > The right RIP/RSP to use for the stack unwinding is always the data > in the PMI's exception frame on the stack. > > Probably would need to modify perf to report those too in addition > to the PEBS registers. ok, should not be that hard > > Of course it would still mean that the stack unwinding may not exactly > match the sample RIP, but at least it should be consistent. jirka