From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4854DC61DA4 for ; Tue, 14 Mar 2023 01:53:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbjCNBvR (ORCPT ); Mon, 13 Mar 2023 21:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbjCNBvQ (ORCPT ); Mon, 13 Mar 2023 21:51:16 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A3ED7432E for ; Mon, 13 Mar 2023 18:51:13 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id bp11so2519610ilb.3 for ; Mon, 13 Mar 2023 18:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678758673; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=589d5gGFeTRFSWyqkY4bWEOUvz8ytn+1q0THemjgTjo=; b=sCoaYS53kX1FbnPJO069z9fN0xiunJwETCfuUF0U+/1RY4OSf2gZybXW3iq2NvZtxL N3xD1WDLzMneibZj8Q3LKDEfJFudxp9oIpmwf5eOXWyWx+wW0FJtOX7nLfzWWpK2+z94 aJ5Xanx5/iUJnv4jg7mSaFCnACgXLQRGVkZAU0jGHhQpgDgZxawwuUPuUJRUCOccQwxu oOiq+OeNrEHYo37W1HQdW/+izUkV1CJSVNCCDgjq7JSkccc0HO7BvdXU+s2bsT8CUhMT elDT2/kflN9YtGfavs/UkIQ5Uo6goP5LKIO8AWva4YDcH2BjhLC0X0G8VMGzLVnfZfEF q91A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678758673; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=589d5gGFeTRFSWyqkY4bWEOUvz8ytn+1q0THemjgTjo=; b=tm+eEjH7kqrYuC9ykyYrareDD7YBC7QnX0B/oEUezYoE8V6bb7FlutVLwxXHIIZAHp ZlFnSYslxPJDSRYrvZ1N7Qm3uj9rpHUOjAYQ1ZOaYxjycE7EKEcEncXO7xk+vAZwM99l YcETCdGHRVfhSCt41qsAzKAh3m7foQ3Q4FCofQpZSnofechj+F2GCEXXPTxw53MiFraH cTWUg/V2zQbjnKNTdqyTgahg/NUEYRSyLBn+s+kKTKmPdVbo8gksELjNCnhox/Xw6NNk h+lSHVhZ2tYYyxxXHayAR53K2tDcvX2JTaoMWRGQ7jEeDQmR+A7wcDExykBE5NHeb6oD UENA== X-Gm-Message-State: AO0yUKVc0+p8QZeTZPE6KXMP6vX4r7WlIEZSut/ohoFrs82RjEDk6cAO x2Q1JV6NCLt4ALnPUFMbq3MSJ2wAs8IQ/cbDFXPDFg== X-Google-Smtp-Source: AK7set8+Dh8f7H+Wetyv5sOVdRcPFSdXasKPH4Ttdqkf4wP3Sdu73sgx2P46Ghc94F6DQroovlvQv8Ld0rvKqSoUjYc= X-Received: by 2002:a05:6e02:601:b0:311:1424:47f1 with SMTP id t1-20020a056e02060100b00311142447f1mr54396ils.0.1678758672482; Mon, 13 Mar 2023 18:51:12 -0700 (PDT) MIME-Version: 1.0 References: <20230116010115.490713-1-irogers@google.com> <20230116010115.490713-3-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 13 Mar 2023 18:51:01 -0700 Message-ID: Subject: Re: [PATCH v2 2/3] perf build: Remove libbpf pre-1.0 feature tests To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Andres Freund , Quentin Monnet , Roberto Sassu , Christy Lee , Andrii Nakryiko , Adrian Hunter , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Mon, Mar 13, 2023 at 5:19=E2=80=AFPM Ian Rogers wro= te: > > On Mon, Mar 13, 2023 at 2:38=E2=80=AFPM Arnaldo Carvalho de Melo > wrote: > > > > Em Mon, Mar 13, 2023 at 06:10:40PM -0300, Arnaldo Carvalho de Melo escr= eveu: > > > Em Sun, Jan 15, 2023 at 05:01:14PM -0800, Ian Rogers escreveu: > > > > The feature tests were necessary for libbpf pre-1.0, but as the lib= bpf > > > > implies at least 1.0 we can remove these now. > > > > > > So I added this: > > > > > > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config > > > index 8b0bd3aa018ef166..b715cd4f43f4a014 100644 > > > --- a/tools/perf/Makefile.config > > > +++ b/tools/perf/Makefile.config > > > @@ -580,7 +580,7 @@ ifndef NO_LIBELF > > > EXTLIBS +=3D -lbpf > > > $(call detected,CONFIG_LIBBPF_DYNAMIC) > > > else > > > - dummy :=3D $(error Error: No libbpf devel library found, p= lease install libbpf-devel); > > > + dummy :=3D $(error Error: No libbpf devel library found or= older than v1.0, please install/update libbpf-devel); > > > endif > > > else > > > # Libbpf will be built as a static library from tools/lib/bp= f. > > > > > > To better reflect the failure reason: > > > > > > =E2=AC=A2[acme@toolbox perf-tools-next]$ cat /tmp/build/perf-tools-ne= xt/feature/test-libbpf.make.output > > > test-libbpf.c:5:2: error: #error At least libbpf 1.0 is required for = Linux tools. > > > 5 | #error At least libbpf 1.0 is required for Linux tools. > > > | ^~~~~ > > > =E2=AC=A2[acme@toolbox perf-tools-next]$ rpm -q libbpf-devel > > > libbpf-devel-0.8.0-2.fc37.x86_64 > > > =E2=AC=A2[acme@toolbox perf-tools-next]$ > > > > > > I'll see if I can make the build test conditional on libbpf being >= =3D 1.0 > > > > I'm trying with this: > > > > =E2=AC=A2[acme@toolbox libbpf]$ git log --oneline -1 9476dce6fe905a6bf1= d4c483f7b2b8575c4ffb2d > > 9476dce6fe905a6b libbpf: remove deprecated low-level APIs > > =E2=AC=A2[acme@toolbox libbpf]$ git tag --contains 9476dce6fe905a6bf1d4= c483f7b2b8575c4ffb2d > > v1.0.0 > > v1.0.1 > > v1.1.0 > > =E2=AC=A2[acme@toolbox libbpf]$ > > > > diff --git a/tools/perf/tests/make b/tools/perf/tests/make > > index 531324c3dab594e1..f866c58b916f4d7a 100644 > > --- a/tools/perf/tests/make > > +++ b/tools/perf/tests/make > > @@ -63,6 +63,7 @@ endif > > > > has =3D $(shell which $1 2>/dev/null) > > python_perf_so :=3D $(shell $(MAKE) python_perf_target|grep "Target is= :"|awk '{print $$3}') > > +old_libbpf :=3D $(shell grep -q LIBBPF_DEPRECATED /usr/include/bpf/bpf= .h) > > I think this could also be: > old_libbpf :=3D $(shell grep MAJOR /usr/include/bpf/libbpf_version.h > 2>&1 |grep -q 0) > Which may be a bit more intention revealing and future proof. > > Thanks, > Ian To avoid /usr/include assumptions, there's also: old_libbpf :=3D $(shell echo "#include " | $(CC) -E -dM -x c -|grep "define LIBBPF_MAJOR_VERSION"|grep -q 0) :-) Ian > > # standard single make variable specified > > make_clean_all :=3D clean all > > @@ -151,7 +152,9 @@ run +=3D make_no_libaudit > > run +=3D make_no_libbionic > > run +=3D make_no_auxtrace > > run +=3D make_no_libbpf > > +ifneq ($(old_libbpf),) > > run +=3D make_libbpf_dynamic > > +endif > > run +=3D make_no_libbpf_DEBUG > > run +=3D make_no_libcrypto > > run +=3D make_no_sdt