From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753165AbdK3DBQ (ORCPT ); Wed, 29 Nov 2017 22:01:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:55462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbdK3DBO (ORCPT ); Wed, 29 Nov 2017 22:01:14 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05072214EF 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, 30 Nov 2017 00:01:10 -0300 From: Arnaldo Carvalho de Melo To: Martin KaFai Lau Cc: Matthias Kaehlcke , Josh Poimboeuf , Yonghong Song , Alexei Starovoitov , "David S. Miller" , Daniel Borkmann , Wang Nan , Alexei Starovoitov , Adrian Hunter , David Ahern , Jiri Olsa , Ingo Molnar , Namhyung Kim , Linux Kernel Mailing List , Andrey Ryabinin Subject: Re: 'perf test BPF' failing, libbpf regression wrt "basic API for BPF obj name" Message-ID: <20171130030110.GA18880@kernel.org> References: <20171128190519.GM3298@kernel.org> <20171129210734.lqs23q65ac6avlwr@kafai-mbp> <20171129211543.GC31403@kernel.org> <20171129223135.6iqvj6ho4ojxmhu6@kafai-mbp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171129223135.6iqvj6ho4ojxmhu6@kafai-mbp> 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 Em Wed, Nov 29, 2017 at 02:31:36PM -0800, Martin KaFai Lau escreveu: > On Wed, Nov 29, 2017 at 06:15:43PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Wed, Nov 29, 2017 at 01:07:34PM -0800, Martin KaFai Lau escreveu: > > > On Tue, Nov 28, 2017 at 04:05:19PM -0300, Arnaldo Carvalho de Melo wrote: > > > > [root@jouet ~]# perf test -v bpf > > > > 39: BPF filter : > > > > 39.1: Basic BPF filtering : > > > > --- start --- > > > > test child forked, pid 12198 > > > > Kernel build dir is set to /lib/modules/4.14.0+/build > > > > set env: KBUILD_DIR=/lib/modules/4.14.0+/build > > > [ ... ] > > > > libbpf: failed to create map (name: 'flip_table'): Invalid argument > > > > libbpf: failed to load object '[basic_bpf_test]' > > > > bpf: load objects failed > > > 88cda1c9da02 ("bpf: libbpf: Provide basic API support to specify BPF obj name") > > > is introduced in 4.15. > > > I think the perf@kernel-4.15 broke on older kernels like 4.14 because > > > the new bpf prog/map name is only introduced since 4.15. > > > The newer perf needs to be compatible with an older kernel? > > Sure :-) > Would the latest features introduced in perf/libbpf supposed to be > available in the latest kernel only? What may be the reason that the Yes, then the new perf binary should try to use the new stuff, if it fails, use the old one, there is no requirement that one uses perf 4.14 in lockstep with the kernel 4.14 (or any other version), perf 4.15 should work with the 4.14 kernel as well as with 4.15 (or any other future kernel), only limited by what it can grok up to when it was released. I'll test with a 4.15 kernel to confirm this, thanks for the explanation! > latest perf is installed with an older kernel while it does not gain new > functionality? See, for instance tools/perf/util/evsel.c, function perf_evsel__open(), and all those fallbacks for features a new tool doesn't find on an older kernel. When the user asks for some feature that is not present in the older kernel, then it fails and the tool calling perf_evsel__open() will use perf_evlist__strerror_open() to provide as best an explanation to what took place as possible. - Arnaldo