Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2527567ybm; Thu, 23 May 2019 19:23:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjWKGNpd2v7UrlaFu5NYE0UOZSvB2q43Tw4dvjzQcODngykDb2FGDkgjyCiKsMfMNZj/w6 X-Received: by 2002:a62:6844:: with SMTP id d65mr31369763pfc.175.1558664616341; Thu, 23 May 2019 19:23:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558664616; cv=none; d=google.com; s=arc-20160816; b=uBuNYplvjpBax+amAa619TQPx97Dumx41QS+nNFvQo7TmCDUMRR0gR/z7+q0r1Y0mY cLlLg7d6Jp8OM4XyJRH/d7iKMAMGUsC6+yXO3XxWBGxzsueS0euAuYD9zuQCI7ijAfYx fbWCVnlWGyuIhAQ6/URPt+lRRTIzq77h5wZfZFC1DV992L8b4m6j577smuLhc4TGB6cj J2ym2DeIP3a8+6ZrBLf5FXVLkkTnDXY0hYRd0lbF4ho8+UHtIWIigvXacXpm+zw0Hf8y cDw2vi1LhFVQBBjjCKJhKxQlFhK2PTcBQJuMbr3KdU1wQvqWz6C6Sf/xl5Pm3eDIXt5X yHuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=TU9aYcgfNn+o19/ZAhWzQtbz6o/09lUEz74yQbsbrOs=; b=gVnwNo09/6xKYDEWdeWiueS4pydGXgcyisYCyuLbQqErVoTGxRKizh4ZT8JWM/PorV mStz9ozCCFcj6nEs/QSiUnjVejJl0FC/2IoFyzFFeRh1o9VOoeozbabsVe6Jidau2l27 5eiqvrQWC5GNYxrNnDwGHdMRxVcDlfGzG2GkoQi5eNVT2V536pCMMoPc+9vzcUF5Dd0P vZZ6wvp+apxYEAGtmftYSZ1zRyfCpxiBNjYKH9y8PLdyBUJ0Yu47uJvo+U6DGsDDeRS8 rJTmHHK6dLD8JQuRFr1myNjNLXwV91p2bc2EluvGSpB+oL8Esg4tHLN76PQ3gJpbSSvY L5Zg== 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 w35si2090881pga.490.2019.05.23.19.23.16; Thu, 23 May 2019 19:23:36 -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 S2388338AbfEXCVF (ORCPT + 99 others); Thu, 23 May 2019 22:21:05 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:32963 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388221AbfEXCVE (ORCPT ); Thu, 23 May 2019 22:21:04 -0400 Received: by mail-io1-f67.google.com with SMTP id z4so6594242iol.0 for ; Thu, 23 May 2019 19:21:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TU9aYcgfNn+o19/ZAhWzQtbz6o/09lUEz74yQbsbrOs=; b=IYmFlcrCbLJvf+DMaU0f07icE+57EErMva7k0BG1s06+uLm5pg5EzoyKFoqhRbzPw/ PtfRMIxkIzTAWwbbO3qKnPbSzeeCOQV+wdisuoA6PWCk8bCvZcu0afoe1tz8XJU6GPMW zPmRb0iYbJjwq+3MfeoLd+jsDZEo9kmXyG4QZ9XzXJyGOTJPoBR4rVyt1XYhURjQh6eK 9XzBhuFumtDdyv22Auuk+5OehhamWrkd/VnQoZRXMPKHA3cGpY/9tkF5BovrPwuOOdrQ fkSPvxymrrErfg35AllMx/QSVUnpX6NbZuiwocN3NJchrUcKbDZrca16tAXReG9gDS2p r6Bg== X-Gm-Message-State: APjAAAUnkjP7v1Hgxh5yQmpTjHyVebEVLauBxC2XpJeF5dDaMYdunEf0 qTq4359oflruaARtbYI/U+uJo7012cHrQO88PsvgrA== X-Received: by 2002:a05:6602:211a:: with SMTP id x26mr5453533iox.202.1558664464183; Thu, 23 May 2019 19:21:04 -0700 (PDT) MIME-Version: 1.0 References: <20190522140233.GC16275@worktop.programming.kicks-ass.net> <20190522174517.pbdopvookggen3d7@treble> <20190522234635.a47bettklcf5gt7c@treble> <20190523133253.tad6ywzzexks6hrp@treble> <20190523152413.m2pbnamihu3s2c5s@treble> <20190523172714.6fkzknfsuv2t44se@treble> In-Reply-To: <20190523172714.6fkzknfsuv2t44se@treble> From: Kairui Song Date: Fri, 24 May 2019 10:20:52 +0800 Message-ID: Subject: Re: Getting empty callchain from perf_callchain_kernel() To: Josh Poimboeuf Cc: Alexei Starovoitov , Peter Zijlstra , Song Liu , lkml , Kernel Team , Alexei Starovoitov , Daniel Borkmann , "bpf@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" 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 1:27 AM Josh Poimboeuf wrote: > > 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. > Yes, with JIT off it will be fixed. I can confirm that. -- Best Regards, Kairui Song