Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2046495ybm; Thu, 23 May 2019 10:29:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlGRAx10oHIONfnbzBmwnks6py5Nm1ZjoL2UnPKNpnJjbkpL8Viwx/LwVmq0Dq6pn06CfJ X-Received: by 2002:a62:5387:: with SMTP id h129mr3815416pfb.6.1558632592636; Thu, 23 May 2019 10:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558632592; cv=none; d=google.com; s=arc-20160816; b=oYYziiC3BwDjY5PmeiXVOGgCbA4glEzgFDaaGn/irksLGv3vqPOLhC1uhWMWA8ahQl yP54aLSTYfwOTokPtchw9PySFqlUPV8Es+VMEIpNysqluAGbPZR46pn9LtJd821DFhnd pbJNSQtNArz2bhPD4tSp4LBWvFxGntfQOr25q9PXK0Z7lo1H9SXDC0Be4/DQp5VKYQ2M 6hJySnew8sZ74h0i0k2CASDjxzLCJ8FtcuHf6ZoCRhBVLXJi+Kl8WegSZx4xQMGXq/Pm elMiTAH3IQ/exocKBBT19eBaecfckUKh4/YKFLPrggKe8NlC51nmRt7JIcjTbwcgPDFW rmHQ== 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=9J5fWXFfQcDQl4xsE/q8G2M6LmrekwHjY+la/48IGK4=; b=cY/JfcUqdCpQJzrF0Vb5LW6D8ISw02DCE2UlfEk/jE3TE1DDucpwmXJl6feDkOEfLm u1QUZUqpCZgDm9OSS7uAlmWdhWEcs4UdG1ggkkRBbw2FTSnzM8gj+CQCoCg3oHLAK0zf 92xT6rri3E15Ea7CTAaXk5kvV0Xxji273IHlPP2bDA47LUHzv5HnHnvrV8HJAhIlSthm LEJ4+0pG1hgf3nGxMWOpCzi+XdYeq12vaw6IL+uVP8IVDGdI8nRCzDtQk+fIxLH9va/K ruMoNVDh8xdnsNAcAj3f6VFw/KLJtUl9iKlyzji0hotHP+aP0f4CvNZkcVjZ6L69InSN 7kNw== 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 v70si115575pgd.317.2019.05.23.10.29.37; Thu, 23 May 2019 10:29:52 -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 S1731275AbfEWR1a (ORCPT + 99 others); Thu, 23 May 2019 13:27:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46876 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730957AbfEWR1a (ORCPT ); Thu, 23 May 2019 13:27:30 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CE565946F; Thu, 23 May 2019 17:27:26 +0000 (UTC) Received: from treble (ovpn-121-106.rdu2.redhat.com [10.10.121.106]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 331E560BF3; Thu, 23 May 2019 17:27:17 +0000 (UTC) Date: Thu, 23 May 2019 12:27:14 -0500 From: Josh Poimboeuf To: Kairui Song Cc: Alexei Starovoitov , Peter Zijlstra , Song Liu , lkml , Kernel Team , Alexei Starovoitov , Daniel Borkmann , "bpf@vger.kernel.org" Subject: Re: Getting empty callchain from perf_callchain_kernel() Message-ID: <20190523172714.6fkzknfsuv2t44se@treble> References: <20190522140233.GC16275@worktop.programming.kicks-ass.net> <20190522174517.pbdopvookggen3d7@treble> <20190522234635.a47bettklcf5gt7c@treble> <20190523133253.tad6ywzzexks6hrp@treble> <20190523152413.m2pbnamihu3s2c5s@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 23 May 2019 17:27:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 24, 2019 at 12:41:59AM +0800, Kairui Song wrote: > On Thu, May 23, 2019 at 11:24 PM Josh Poimboeuf wrote: > > > > On Thu, May 23, 2019 at 10:50:24PM +0800, Kairui Song wrote: > > > > > Hi Josh, this still won't fix the problem. > > > > > > > > > > Problem is not (or not only) with ___bpf_prog_run, what actually went > > > > > wrong is with the JITed bpf code. > > > > > > > > There seem to be a bunch of issues. My patch at least fixes the failing > > > > selftest reported by Alexei for ORC. > > > > > > > > How can I recreate your issue? > > > > > > Hmm, I used bcc's example to attach bpf to trace point, and with that > > > fix stack trace is still invalid. > > > > > > CMD I used with bcc: > > > python3 ./tools/stackcount.py t:sched:sched_fork > > > > I've had problems in the past getting bcc to build, so I was hoping it > > was reproducible with a standalone selftest. > > > > > And I just had another try applying your patch, self test is also failing. > > > > Is it the same selftest reported by Alexei? > > > > test_stacktrace_map:FAIL:compare_map_keys stackid_hmap vs. stackmap err -1 errno 2 > > > > > I'm applying on my local master branch, a few days older than > > > upstream, I can update and try again, am I missing anything? > > > > The above patch had some issues, so with some configs you might see an > > objtool warning for ___bpf_prog_run(), in which case the patch doesn't > > fix the test_stacktrace_map selftest. > > > > Here's the latest version which should fix it in all cases (based on > > tip/master): > > > > https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/commit/?h=bpf-orc-fix > > Hmm, I still get the failure: > test_stacktrace_map:FAIL:compare_map_keys stackid_hmap vs. stackmap > err -1 errno 2 > > And I didn't see how this will fix the issue. As long as ORC need to > unwind through the JITed code it will fail. And that will happen > before reaching ___bpf_prog_run. Ok, I was able to recreate by doing echo 1 > /proc/sys/net/core/bpf_jit_enable first. I'm guessing you have CONFIG_BPF_JIT_ALWAYS_ON. -- Josh