Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1583288yba; Fri, 17 May 2019 01:33:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC5kFPCZLzDsv5hJi09ZP3wQpND7IboADjXMcN8X1sPFeBw8S+ewXiN0WSCRWmTkA7zwy7 X-Received: by 2002:a65:6449:: with SMTP id s9mr53763297pgv.90.1558081981046; Fri, 17 May 2019 01:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558081981; cv=none; d=google.com; s=arc-20160816; b=sq1LaTQ/5nbiTPJqT5uiFibpv1upi66ecouBYhzUQMiCTqR52OgaNi+GB0wVIyZlqS xrv42pGUlrn4MLvcLcEGBrq2S1DPMp5Ee14o0oLAH8tCJ51IvR2HQEs1ODgB88287/PY 2oj7Oj058GylS4Osc8jYkTN8yFwZnyyS014xQJ606JaNjGsCV0MkshQ/FloUz+sqz6o6 nw9Q/HVPExOqBJKInSrKLosWT2YtcVb1QBUmyObwi9SokLUbHarB2LFPp859cM0jkY+7 36hRd1qgPennvIQoVCjUMDhCDgAJsrQWsp/YvaXsnHCOIXh2srm/NG2WEKwpVB3uwloi FsXA== 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:dkim-signature; bh=tmsLUqIFffsMwKQ5rrShy/n7aicGtwKA3Co+5yH2+Eg=; b=okd+e2aC/fw56VAxhDmI8s0BqHSMb5UXqVbBE4urYjVenGFQJGoD30HSxPN4T+HEhZ aWVu9YCszoBbnMI3k5GjWEbEmNuFShsvqzxWga6w7y6nyWjN/gzSo43hOF+SYA4mwZJQ KZWtbTH5xhfQYF309xH+iRcBgy+fv+C5/awZHVMbHmn64ECP67C5tmU38LF1wedPUJHd L5Z/oFC0++ZwdSX+yraymnsdOs1cxEtcODB+IuoaBZXpSDDjfB2o5er9BOZuW9fuce8K TR7nxI9Jf/nSl14jmO0e0UsI5Rw1I80aW4WW1hYR0BbHlEW+pMKB9T3fwnaRujfHzssF dd3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=WlKVIgzc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si4786668plb.217.2019.05.17.01.32.45; Fri, 17 May 2019 01:33:01 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=WlKVIgzc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728607AbfEQHqE (ORCPT + 99 others); Fri, 17 May 2019 03:46:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57536 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728300AbfEQHqE (ORCPT ); Fri, 17 May 2019 03:46:04 -0400 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tmsLUqIFffsMwKQ5rrShy/n7aicGtwKA3Co+5yH2+Eg=; b=WlKVIgzco8hD114GFqSmSVlYG K2zQzSLvlv60DtdYFvgpuRPtl/oRuvEOe+/9ddFbi/jRYzLsKrIum562tmMKMnojsQi9qWDxfXd4p KPha8+/UkXK81SCyePFKP9Pv+zk1veQdlkwEfy0YqrRWn6DmHFAtFf4Z6spJBynUmTsbPe5MDhwwy A5eh+ihjU8UsRYfLvivj2FAk8t3mzch1FlFP9sVLI9hiBSGPSru9eH9opBbR1s0gm20Ub4SQYQy8t 0pjVpSrC8oc8EDeZJvqsxYFAEy+FN735BEuHG3Aqgop8K27A+4suNH6R7BZkdK9v8DBL/Fcj01iAz 2itne3pmg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRXZ3-0002Yb-LT; Fri, 17 May 2019 07:46:01 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2256D2027C9FD; Fri, 17 May 2019 09:46:00 +0200 (CEST) Date: Fri, 17 May 2019 09:46:00 +0200 From: Peter Zijlstra To: Song Liu Cc: "kasong@redhat.com" , lkml , Kernel Team , Josh Poimboeuf Subject: Re: Getting empty callchain from perf_callchain_kernel() Message-ID: <20190517074600.GJ2623@hirez.programming.kicks-ass.net> References: <3CD3EE63-0CD2-404A-A403-E11DCF2DF8D9@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3CD3EE63-0CD2-404A-A403-E11DCF2DF8D9@fb.com> 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 Thu, May 16, 2019 at 11:51:55PM +0000, Song Liu wrote: > Hi, > > We found a failure with selftests/bpf/tests_prog in test_stacktrace_map (on bpf/master > branch). > > After digging into the code, we found that perf_callchain_kernel() is giving empty > callchain for tracepoint sched/sched_switch. And it seems related to commit > > d15d356887e770c5f2dcf963b52c7cb510c9e42d > ("perf/x86: Make perf callchains work without CONFIG_FRAME_POINTER") > > Before this commit, perf_callchain_kernel() returns callchain with regs->ip. With > this commit, regs->ip is not sent for !perf_hw_regs(regs) case. So while I think the below is indeed right; we should store regs->ip regardless of the unwind path chosen, I still think there's something fishy if this results in just the 1 entry. The sched/sched_switch event really should have a non-trivial stack. Let me see if I can reproduce with just perf.