From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753408AbeADPji (ORCPT + 1 other); Thu, 4 Jan 2018 10:39:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:55530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbeADPjh (ORCPT ); Thu, 4 Jan 2018 10:39:37 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7035721873 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Thu, 4 Jan 2018 12:39:34 -0300 From: Arnaldo Carvalho de Melo To: "Wangnan (F)" Cc: Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Linux Kernel Mailing List Subject: Re: perf test BPF failing on 4.15.0-rc6 Message-ID: <20180104153934.GB14721@kernel.org> References: <20180102185917.GA3124@kernel.org> <88e98d42-d61e-6180-35cf-eb8d7e5fdbf9@huawei.com> <2c205ecf-6742-b700-ad7a-69d6685b87fc@huawei.com> <20180103165844.GA13097@kernel.org> <20180103182701.GB13097@kernel.org> <20180103183307.GC13097@kernel.org> <20180103201344.GB3196@kernel.org> <5cf517e8-b307-e1a2-daf9-9cf9f8d7e7d6@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5cf517e8-b307-e1a2-daf9-9cf9f8d7e7d6@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Em Thu, Jan 04, 2018 at 09:37:35AM +0800, Wangnan (F) escreveu: > > > On 2018/1/4 4:13, Arnaldo Carvalho de Melo wrote: > > Em Wed, Jan 03, 2018 at 03:33:07PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Wed, Jan 03, 2018 at 03:27:01PM -0300, Arnaldo Carvalho de Melo escreveu: > > > > > Continuing investigation... > > > > After applying the fallback patch to allow new tools to work with older > > > > kernels: > > > > > > > > [root@felicio ~]# perf test bpf > > > > 39: BPF filter : > > > > 39.1: Basic BPF filtering : Ok > > > > 39.2: BPF pinning : Ok > > > > 39.3: BPF prologue generation : Ok > > > > 39.4: BPF relocation checker : Ok > > > > [root@felicio ~]# uname -a > > > > Linux felicio.ghostprotocols.net 4.13.0-rc7+ #1 SMP Mon Sep 11 13:56:18 -03 2017 x86_64 x86_64 x86_64 GNU/Linux > > > > [root@felicio ~]# rpm -q glibc > > > > glibc-2.17-157.el7_3.2.x86_64 > > > > [root@felicio ~]# > > > > > > > > After applying the patch below I get to, which is what I am trying to > > > > fix now: > > > > > > > > [root@jouet ~]# perf test bpf > > > > 39: BPF filter : > > > > 39.1: Basic BPF filtering : Ok > > > > 39.2: BPF pinning : Ok > > > > 39.3: BPF prologue generation : FAILED! > > > > 39.4: BPF relocation checker : Skip > > > > [root@jouet ~]# > > > Update the patch to the one at the end of this message to make it work > > > with older glibcs, so that we ask for epoll_pwait() and hook into that > > > as well(). > > > > > > Now checking why 39.3 fails... > > Couldn't reproduce after fixing up some kernel build problems, the patch > > below is all I need to have this working with both Fedora 27 and RHEL7, > > please take a look and see if it continues to work on your systems, > > It works for me. Thank you. > > Since we test epoll_pwait, we'd better correct function names: Right, that wasn't strictly needed, so I tried to restrict my changes to focus on the fix. Now that we agree on it, I'm doing what you suggest, to make it less confusing. I'm adding your Tested-by, thanks! - Arnaldo > > diff --git a/tools/perf/tests/bpf-script-example.c > b/tools/perf/tests/bpf-script-example.c > index 268e5f8..e4123c1 100644 > --- a/tools/perf/tests/bpf-script-example.c > +++ b/tools/perf/tests/bpf-script-example.c > @@ -31,8 +31,8 @@ struct bpf_map_def SEC("maps") flip_table = { > .max_entries = 1, > }; > > -SEC("func=SyS_epoll_wait") > -int bpf_func__SyS_epoll_wait(void *ctx) > +SEC("func=SyS_epoll_pwait") > +int bpf_func__SyS_epoll_pwait(void *ctx) > { > int ind =0; > int *flag = bpf_map_lookup_elem(&flip_table, &ind); > diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c > index 34c22cd..a8f9095 100644 > --- a/tools/perf/tests/bpf.c > +++ b/tools/perf/tests/bpf.c > @@ -19,13 +19,13 @@ > > #ifdef HAVE_LIBBPF_SUPPORT > > -static int epoll_wait_loop(void) > +static int epoll_pwait_loop(void) > { > int i; > > /* Should fail NR_ITERS times */ > for (i = 0; i < NR_ITERS; i++) > - epoll_wait(-(i + 1), NULL, 0, 0); > + epoll_pwait(-(i + 1), NULL, 0, 0, NULL); > return 0; > } > > @@ -68,7 +68,7 @@ static struct { > "[basic_bpf_test]", > "fix 'perf test LLVM' first", > "load bpf object failed", > - &epoll_wait_loop, > + &epoll_pwait_loop, > (NR_ITERS + 1) / 2, > false, > }, > @@ -78,7 +78,7 @@ static struct { > "[bpf_pinning]", > "fix kbuild first", > "check your vmlinux setting?", > - &epoll_wait_loop, > + &epoll_pwait_loop, > (NR_ITERS + 1) / 2, > true, > }, > >