Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1590854yba; Fri, 17 May 2019 01:43:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzulMG25VE5v8ugtZpEmgjX0gMyhERnUXyOoBLioqhoNPYlG2+mR+T4YE44IQZ6BBEJvuO6 X-Received: by 2002:a17:902:3383:: with SMTP id b3mr9956595plc.193.1558082631839; Fri, 17 May 2019 01:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558082631; cv=none; d=google.com; s=arc-20160816; b=Y2YuVsRcFiiDHyWkOaymYvnbl/T7hArCOrPVPmnrw3XYdvMyKBlQH2VzEsJkFOzYu8 1HP9cwpXGBi0fjEYcljRmlISDOw++tZ2kcNhm3rExKZpFUkiKuvUIkp2rdLmfHReqJLR sMocaXIoDavVJngknwHVchQOt0xoeLgQGCXjZU1JsWvCUxOV4UOP81/JZGM+q/A3wLlu siQ6VwWDJ98RXJ+K+fdVureZCQRZA8ctPWr7/rPZINJGdB9e4dUyitsYHu4otiPwUJby fK+2AkhXRhf1RIRMCJpemREAYSQ9KRO8J817Bx1tl4DptXu9RosjTvGN4rWlM/A0P8Io rqoA== 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=oRLadEE/AvnoXPzc8Ll1L0mqCG8UjJYvr5VgpwS6P/Y=; b=LxLny4RgXE01EaiQU/qW+5BOO301YFF7V2ziYrJosA5cHllVnJEGStb9cNLL3QqZCg p6turZk0wlvUnqJRScGQ1AtZdQjYz0ZMi2GZBWct7n+r8SGXgi2N7bPnNfwP0fN2xHhv Waiyq/HXS7rrdU3H0e6G2D98IjwFygwbsJA6IViFVdHnQ2IJyjV4EHiHG0DBrMgbScFg BvY1fBv805Kkq6xRtkxSvPWhmEj6HjonXHnD5SqZG0/6L+FyR8HEp9vqHjkkVtQNZZg1 3YouFaUAe2YjY2hzTdpLhnSA2CRQbGZ+COYVe9Zn1k+8BRIl3oOArT032YPMc7p8iOeL virQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=merlin.20170209 header.b=pCnQV1Qe; 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 g3si1951589pgq.247.2019.05.17.01.43.36; Fri, 17 May 2019 01:43:51 -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=neutral (body hash did not verify) header.i=@infradead.org header.s=merlin.20170209 header.b=pCnQV1Qe; 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 S1728720AbfEQILJ (ORCPT + 99 others); Fri, 17 May 2019 04:11:09 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34718 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727624AbfEQILJ (ORCPT ); Fri, 17 May 2019 04:11:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=EYi/lD8MnvzQlLPDFmmiO+HYT+DXRAl+11IxZLrfGE8=; b=pCnQV1QeY+iaauAneXUeW1TTd IF7znaPsi1vWFVC2Kfp0ORGXEaZxRS5OxcwTgirUta1mWC760ueKEu9BhzeRbKXRy+a4ZpZP72D0B BatxEup+iwpOPt5a2TLyskEbHydUYWVLCu02efaRvM0ypMRkABgcyB63JZTsRluO/U0uluR6vMlvR xpsYBaau+TLdRQhQDRO9bV/uK3lT++0KbD9jbzQXng4loBjnaerU4qd/kKOkb6f9u8p4ufGg4URB0 6H9DxSneOBDDuRIoQpOVlZ6gUMZ5MpOnztp5wFLYWkP/Ho4CHJPxLI7sf/v9o1mOnncazdqNA8tLp Jw2L6Jcgw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRXxE-0007QQ-B7; Fri, 17 May 2019 08:11:00 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E400A2027C9FD; Fri, 17 May 2019 10:10:57 +0200 (CEST) Date: Fri, 17 May 2019 10:10:57 +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: <20190517081057.GQ2650@hirez.programming.kicks-ass.net> References: <3CD3EE63-0CD2-404A-A403-E11DCF2DF8D9@fb.com> <20190517074600.GJ2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190517074600.GJ2623@hirez.programming.kicks-ass.net> 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 Fri, May 17, 2019 at 09:46:00AM +0200, Peter Zijlstra wrote: > 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. $ perf record -g -e "sched:sched_switch" -- make clean $ perf report -D 12 904071759467 0x1790 [0xd0]: PERF_RECORD_SAMPLE(IP, 0x1): 7236/7236: 0xffffffff81c29562 period: 1 addr: 0 ... FP chain: nr:10 ..... 0: ffffffffffffff80 ..... 1: ffffffff81c29562 ..... 2: ffffffff81c29933 ..... 3: ffffffff8111f688 ..... 4: ffffffff81120b9d ..... 5: ffffffff81120ce5 ..... 6: ffffffff8100254a ..... 7: ffffffff81e0007d ..... 8: fffffffffffffe00 ..... 9: 00007f9b6cd9682a ... thread: sh:7236 ...... dso: /lib/modules/5.1.0-12177-g41bbb9129767/build/vmlinux IOW, it seems to 'work'.