Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1745942ybj; Wed, 6 May 2020 04:39:30 -0700 (PDT) X-Google-Smtp-Source: APiQypL7Ye9gjAbwM6Z4eN7tIFamULHDLfpCZ1AuteUYpQnGLrR1Mc7R8/rUmIIWfVDGhcPmpfDD X-Received: by 2002:a17:906:3952:: with SMTP id g18mr7006492eje.191.1588765170382; Wed, 06 May 2020 04:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588765170; cv=none; d=google.com; s=arc-20160816; b=aLYhmGcerrxTjSR3uyH1RQZYqo+XcrlAGivOOCP7RpzSPtZBF4uNkf268rMkmPJ9wp jenUb0VNi3J/mlMmABIeiqSxTGvO61UUgSx75IB30egA38bgJWxWX9/n+e1PwxpJrYxI DM/EbuPUnwUOE3nEfuOlz5MW3LTqeddM1ZNAL8aP/h7NFIn6tczw31pL238Kgb9YOG38 eCprOdwocMqQleCLb/+hw+h3LdlmeVx6fliYlDK4Vr4sHEMBt+v9xHOmnmXT0Fgb7ejV +R0urU02zdlGQ7CBwwT6Ks+SCZjJiNNf4aWFh1FookHm88Is8M1myODBnc1O2c+J/EbN Aj0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kqU6VorUIgGWfY+iiAfCqor/IMA70ztBrMTXurwWktE=; b=hzHiG7OIGYNgxZ0Z2VlOvXCJRkj1GunIo24eVWQtbSLZO+flmX8sCtjmEct/cka5Nf 2n+5mam3fHbSMar07Bmqq7Mim5dwjXaADJfSm4ihe1hBq1mCv975FxPLRWJR09NywdGA 46i7Z7M3x4rPfRIoR1QI64knY8eqth8LTk0VOnPzQFvxL9aptDm4npmyx0FlB3nyj7WK SCKS/9359ZfMj6zSXUn+JTbWNSEYdNe7eGO9sifs8+fDzPQMk0RqwG/AGE8zS8y7uzFS JxfagUxJsMeV6hrR2bd5QoEBshYREgP8A2uX31IGhpI1qThyithAqswF0ILYAtBNoYNU 9+oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="IfP/8Pnw"; 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 s27si982053ejd.254.2020.05.06.04.39.05; Wed, 06 May 2020 04:39:30 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="IfP/8Pnw"; 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 S1726558AbgEFLhX (ORCPT + 99 others); Wed, 6 May 2020 07:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725824AbgEFLhX (ORCPT ); Wed, 6 May 2020 07:37:23 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 823E2C061A0F for ; Wed, 6 May 2020 04:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kqU6VorUIgGWfY+iiAfCqor/IMA70ztBrMTXurwWktE=; b=IfP/8PnwOXoiv6AGKP6OYgSHvs 5vMHrqYyhQ/Xyc0foE5Xy1R/WbPI+19dCEzg1GtgCzd/L8gGGGj8IjMIDrVKVsnYrbf2pNu1lsoX2 wI8qLonKFxaF7JlpX41k3wKFAp9jAAPOBp+lwxFnS2uFFB4JZcCSSFeE27FPqLzh4G8XKIHw02Tnl 3aOugXSrqTLzORQasi4kR1yJOXSz9q6hjD4pOwPSGOz/MH3m6eeSfZapg++CzvewSIR20b4HoYarE LBBfok13aGPKtfGPEOwgK90G+ORmiOk0c5Hw4ebu/xPO3h5advFs1tS33uIyU7ObzolQRrkX7PbqU aoVW1AtQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIMX-0001bV-QN; Wed, 06 May 2020 11:37:17 +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 BB7AE300739; Wed, 6 May 2020 13:37:14 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A249F2B74FC73; Wed, 6 May 2020 13:37:14 +0200 (CEST) Date: Wed, 6 May 2020 13:37:14 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: LKML , Vince Weaver , jpoimboe@redhat.com, "Liang, Kan" , Andi Kleen Subject: Re: callchain ABI change with commit 6cbc304f2f360 Message-ID: <20200506113714.GA5281@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 05, 2020 at 08:37:40PM -0700, Stephane Eranian wrote: > Hi, > > I have received reports from users who have noticed a change of > behaviour caused by > commit: > > 6cbc304f2f360 ("perf/x86/intel: Fix unwind errors from PEBS entries (mk-II)") > > When using PEBS sampling on Intel processors. > > Doing simple profiling with: > $ perf record -g -e cycles:pp ... > > Before: > > 1 1595951041120856 0x7f77f8 [0xe8]: PERF_RECORD_SAMPLE(IP, 0x4002): > 795385/690513: 0x558aa66a9607 period: 10000019 addr: 0 > ... FP chain: nr:22 > ..... 0: fffffffffffffe00 > ..... 1: 0000558aa66a9607 > ..... 2: 0000558aa66a8751 > ..... 3: 0000558a984a3d4f > > Entry 1: matches sampled IP 0x558aa66a9607. > > After: > > 3 487420973381085 0x2f797c0 [0x90]: PERF_RECORD_SAMPLE(IP, 0x4002): > 349591/146458: 0x559dcd2ef889 period: 10000019 addr: 0 > ... FP chain: nr:11 > ..... 0: fffffffffffffe00 > ..... 1: 0000559dcd2ef88b > ..... 2: 0000559dcd19787d > ..... 3: 0000559dcd1cf1be > > entry 1 does not match sampled IP anymore. > > Before the patch the kernel was stashing the sampled IP from PEBS into > the callchain. After the patch it is stashing the interrupted IP, thus > with the skid. > > I am trying to understand whether this is an intentional change or not > for the IP. > > It seems that stashing the interrupted IP would be more consistent across all > sampling modes, i.e., with and without PEBS. Entry 1: would always be > the interrupted IP. > The changelog talks about ORC unwinder being more happy this the > interrupted machine > state, but not about the ABI expectation here. > Could you clarify? Intentional; fundamentally, we cannot unwind a stack that no longer exists. The PEBS record comes in after the fact, the stack at the time of record is irretrievably gone. The only (and best) thing we can do is provide the unwind at the interrupt. Adding a previous IP on top of a later unwind gives a completely insane/broken call-stacks.