Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2002325imd; Fri, 2 Nov 2018 04:29:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5eoO4DiBfDN/uPvqwVU7EX5ogcXMCELEFV7xQtJMOrcFXdyPh8DJtv6z2bdU82Ypq4rVf5h X-Received: by 2002:a17:902:443:: with SMTP id 61-v6mr11229989ple.216.1541158149156; Fri, 02 Nov 2018 04:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541158149; cv=none; d=google.com; s=arc-20160816; b=NHLR8sFiEL4mGE/gkx8R2p3xIci2OfSvtTT1aJHckKjVoKnWLlvkS83bSn7xhddyJE sYp3R0Q1/GnAckCkcZeUAYhMUV0Mh9gMsXjaSpy9O6yQN0W9vBVjvPvwKEmpRrcaCPNZ zGumIGCXC90mQNg5Hv3fw+PKnugITYNcUvi4woRuZ0/E16A/0WK8qnDRJ652oUjErNOz uJdsb0jPIXPq//mTBQoYn8c5yb6J1iDsNl1naxkFp9eaztBrnoUX8lW10t+hQmUy6Igj hpSHLUEqHcnkTjvZi6HTg3XpngaLENrynRD9/4Cz2t1A/hW89l7Rqt5qLNM+Z1+Wk/fb OWlw== 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=OjO1ow+C9KHnXXgQVfI1k80bnxo7tKwRPIQlzL6oZWg=; b=RyuIpAMGvEZ2yySL0ZbTIXC4zlV4QrMdHwvegvtUEFDGHCWW69xHg3vrOMz/Hfgn+t axz3+D/CVvtMCi2hAFRBp9i0CQ00dR+qKAnkQL3UArG+zurcgNInuXmEdJaYMSQhYBGM pPpHWZGvyhWbuTnLO/aBVfZuCNvOg1cQfbDiKywSuh6iwyyQIT8zhrNz0fV++uQ7egB2 sEr4PiTQsS6IHSCieoeK7PwRarcK4TB7RL4oewFqPwa3wmeGqDGTZaN3KcP79YgSAeWB Dp3XrWTQTHRsNyZiWcCqa2jZ/A/Ys5zbMwLakU3xgJ0iBgxqtF5kxQwj30qRmcMPA8qw Boxg== 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 b1-v6si10745007pgl.235.2018.11.02.04.28.54; Fri, 02 Nov 2018 04:29:09 -0700 (PDT) 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 S1727665AbeKBUd3 (ORCPT + 99 others); Fri, 2 Nov 2018 16:33:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60354 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbeKBUd3 (ORCPT ); Fri, 2 Nov 2018 16:33:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4422430084CB; Fri, 2 Nov 2018 11:26:38 +0000 (UTC) Received: from krava (unknown [10.40.205.35]) by smtp.corp.redhat.com (Postfix) with SMTP id 599AC600C9; Fri, 2 Nov 2018 11:26:35 +0000 (UTC) Date: Fri, 2 Nov 2018 12:26:35 +0100 From: Jiri Olsa To: Milian Wolff Cc: Andi Kleen , 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: <20181102112635.GD5458@krava> References: <2335309.gnWok9HYb4@agathebauer> <20181024144818.GF6218@tassilo.jf.intel.com> <2122395.LD3O1NFKj8@agathebauer> <13521319.OzbRBoFVZM@agathebauer> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13521319.OzbRBoFVZM@agathebauer> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 02 Nov 2018 11:26:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 01, 2018 at 11:08:18PM +0100, Milian Wolff wrote: > On Dienstag, 30. Oktober 2018 23:34:35 CET Milian Wolff wrote: > > On Mittwoch, 24. Oktober 2018 16:48:18 CET Andi Kleen wrote: > > > > Can someone at least confirm whether unwinding from a function prologue > > > > via > > > > .eh_frame (but without .debug_frame) should actually be possible? > > > > > > Yes it should be possible. Asynchronous unwind tables should work > > > from any instruction. > > > > > We can find `7f91345bdaf8+1 = 7f91345bdaf9" at offset 16 (search for "f9 da > > 5b 34 91 7f"). Using that address makes unwinding work for this sample. > > What could be the reason for this shift? > > I believe I have found the culprit: PEBS seems to be at fault here - i.e. the > RIP/RSP and the ustack dump of the sample simply don't fit together. > > Check this out: > > ``` > $ for i in $(seq 10); do perf record -q -e "cycles:" --call-graph dwarf ./cpp- > inlining > /dev/null; perf script | pcre2grep -c -M "hypot_finite.*\n.*\ > [unknown\]"; done > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > > $ for i in $(seq 10); do perf record -q -e "cycles:p" --call-graph dwarf ./ > cpp-inlining > /dev/null; perf script | pcre2grep -c -M "hypot_finite.*\n.*\ > [unknown\]"; done > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > > $ for i in $(seq 10); do perf record -q -e "cycles:pp" --call-graph dwarf ./ > cpp-inlining > /dev/null; perf script | pcre2grep -c -M "hypot_finite.*\n.*\ > [unknown\]"; done > 37 > 39 > 35 > 28 > 40 > 39 > 29 > 37 > 31 > 26 > > $ for i in $(seq 10); do perf record -q -e "cycles:ppp" --call-graph dwarf ./ > cpp-inlining > /dev/null; perf script | pcre2grep -c -M "hypot_finite.*\n.*\ > [unknown\]"; done > 79 > 70 > 76 > 77 > 70 > 90 > 64 > 78 > 86 > 74 > ``` > > Note how precise levels 0 and 1 do not produce any samples where unwinding > fails. But precise level 2 produces some, and precise level 3 increases the > amount (by ca. ~2x). > > I can reproduce this pattern on two separate Intel CPUs and kernel versions > currently: > > Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz with 4.18.16-arch1-1-ARCH > Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz with 4.14.78-1-lts > > Could someone else try this? What about AMD and IBS - is it also affected? > What about newer/different Intel CPUs? I tried on intel and can't actualy see that.. how do the failed samples look like? like is there the stack dump attached, what's in the regs? could you please paste the 'perf report -D' output for some of the failed samples? thanks, jirka