Message ID | 20230311065753.3012826-3-irogers@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp160008wrd; Fri, 10 Mar 2023 23:10:35 -0800 (PST) X-Google-Smtp-Source: AK7set9Nj2OOP4aRDzjYSZOsab1Oj9Ql1Q38VfUso0sI7msMcs7My4W9nTKRRy/pruamaq3IbgRH X-Received: by 2002:a62:1850:0:b0:5a8:ab3d:3fe with SMTP id 77-20020a621850000000b005a8ab3d03femr23068578pfy.16.1678518635390; Fri, 10 Mar 2023 23:10:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678518635; cv=none; d=google.com; s=arc-20160816; b=UvRVYOIVKp2lBupMh80nTwAHxUCSo4teTG1FIbi/Hvj9DY/+bq8WbWkUxQi/jQdpob zObFF/63ScFRXbXXEaUFT1LotEKyp+pC9psv/S/FloynpP5cJ4NsNcEcvzyCsXUyMeZV pVQKlD1hSWMMmclwLtXs2hXzR8Jqz1PW7g2cLcaCNk2vNRLdr1x/9EJMUkSjV+nlm6m3 uXuLpTaS3A75I6HWP1UMdQkwsdsakMR3xJASHbvNVdp8dRGbBBFH4oUD8YsVdG38kKlb wY5eYqiJNFMHnuNI9FDA7g6BdhiqK7UYD1/1ym5G2bbSfkFZafbO8LMarJf6n6Tq02CS otkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=RBPfmbzctqVIG9gwCAzW6yooPI1omXt9V9PytRIeuNs=; b=Z/G78P4Aebatec2iQVBxknVU7fgyoZNFMb5pc7LH2TYjejRoaF5TNZTxvJAszGfosf uSb7PLk1bh5Tlom0jeo5tEtdBbWGfKGLF+fag+5HnJBm8JiCjVABwS7aaZpME6xxTfmT FO7J90thLbfvzr7QLiOnPVY+RkC1zjOZAjEaPMmKOdjmsy4C1WvyqEdP4POwTYaEUwY2 b1kKIfZqK0q3q2mZV1IBcOLaxXiDkizlS81HnnMStylElmfxo4oN981P3/IQ4CKie9ig rY4m81EjZV4vGAljvs9gqkqVbZnqLSmd9cek6vS/0Ly4EXJPVw6+7R8q9eqdybXPEMfb 3AJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QIy+Zsx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h128-20020a636c86000000b004fae5f0895dsi1655585pgc.45.2023.03.10.23.10.21; Fri, 10 Mar 2023 23:10:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QIy+Zsx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbjCKG6c (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Sat, 11 Mar 2023 01:58:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbjCKG6X (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 11 Mar 2023 01:58:23 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15C9B1CACF for <linux-kernel@vger.kernel.org>; Fri, 10 Mar 2023 22:58:21 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-536c02ed619so77481407b3.8 for <linux-kernel@vger.kernel.org>; Fri, 10 Mar 2023 22:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678517901; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=RBPfmbzctqVIG9gwCAzW6yooPI1omXt9V9PytRIeuNs=; b=QIy+Zsx8m6qoDCdnldf0taLwai2+eVaQBBo50mkDUf1VKm2OpzfMRAtYZUfFENXA6z thQnedSb9es+j5EYkRMqJ7s9vBI1/ZODxhOEnJ4xp5KtjpkgsVDyDOQq25CjNENVZmNF U3c8y7gBp6qI97MFVXOehWtTzBmuZQCBXSxYoqydOH89iXMaTfJM0iKrdUBDT34L7U4D 7VV2rJYTEwBI6qR1ngadiisg3L/a5CPArbU3eygofpA+uxpus6gLBVVNQPj4E2yPx2k/ lC6FCcLswyZoOqX6gAGX62Tj3YutR7bIv4/aGAB1yC2qAAa8tFqxXbCnBLQSBe04+Foz vT6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678517901; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RBPfmbzctqVIG9gwCAzW6yooPI1omXt9V9PytRIeuNs=; b=YTpBRfrPgM0cRmcK0bbaKrBMgefemGAzsLXuOU/vksCIjkaqxO125DUYWjiQzpZ4Cv v83n0J1ZaXcj4v0RpD06x8bvunbSAQ0HFGB1xIn3mBWIyzspxF2Ruchdsst81ohHssM1 d/liz5wfi7aqX2S37ULs0Y4gJeho18iecVxNnhAegaQvQkTZYj+fXKGhYqaHy4mgweUV Cal3eD+IKP2iYLeS6D1gBF2TfV/+LCD/Z7skNUFOT72wERNwcHfMwL6SGOK5I1ykymXu DQ72rVapQc8miZn5D6R9AHrf1A8RT/mo0andXAt+GvHT4JnsidWOKrvMoj11+cV1IICh 9nNA== X-Gm-Message-State: AO0yUKUL4Wr0AsXpQIHixPEboiT/rHV5GKlmYi2z5mQJB/8GtFgZocZX S72wihfFFENjUFp/I76OICC4tjQtCW+V X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a11d:a763:a328:f2d6]) (user=irogers job=sendgmr) by 2002:a0d:ea0c:0:b0:4fd:56f3:fdad with SMTP id t12-20020a0dea0c000000b004fd56f3fdadmr9ywe.57.1678517900896; Fri, 10 Mar 2023 22:58:20 -0800 (PST) Date: Fri, 10 Mar 2023 22:57:42 -0800 In-Reply-To: <20230311065753.3012826-1-irogers@google.com> Message-Id: <20230311065753.3012826-3-irogers@google.com> Mime-Version: 1.0 References: <20230311065753.3012826-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Subject: [PATCH v1 02/13] perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL From: Ian Rogers <irogers@google.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Tom Rix <trix@redhat.com>, Roberto Sassu <roberto.sassu@huawei.com>, Quentin Monnet <quentin@isovalent.com>, Andres Freund <andres@anarazel.de>, Tiezhu Yang <yangtiezhu@loongson.cn>, Pavithra Gurushankar <gpavithrasha@gmail.com>, Yang Jihong <yangjihong1@huawei.com>, Adrian Hunter <adrian.hunter@intel.com>, Leo Yan <leo.yan@linaro.org>, " =?utf-8?q?Martin_Li=C5=A1ka?= " <mliska@suse.cz>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, llvm@lists.linux.dev Cc: Stephane Eranian <eranian@google.com>, Ian Rogers <irogers@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760054356465894669?= X-GMAIL-MSGID: =?utf-8?q?1760054356465894669?= |
Series |
Perf tool build improvements
|
|
Commit Message
Ian Rogers
March 11, 2023, 6:57 a.m. UTC
BPF skeleton support is now key to a number of perf features. Rather
than making it so that BPF support must be enabled for the build, make
this the default and error if the build lacks a clang and libbpf that
are sufficient. To avoid the error and build without BPF skeletons the
NO_BPF_SKEL=1 flag can be used. Add a build-options flag to 'perf
version' to enable detection of the BPF skeleton support and use this
in the offcpu shell test.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/Makefile.config | 19 ++++++++++++-------
tools/perf/Makefile.perf | 8 ++++----
tools/perf/builtin-lock.c | 2 +-
tools/perf/builtin-record.c | 2 +-
tools/perf/builtin-version.c | 1 +
tools/perf/tests/shell/record_offcpu.sh | 2 +-
6 files changed, 20 insertions(+), 14 deletions(-)
Comments
Em Fri, Mar 10, 2023 at 10:57:42PM -0800, Ian Rogers escreveu: > BPF skeleton support is now key to a number of perf features. Rather > than making it so that BPF support must be enabled for the build, make > this the default and error if the build lacks a clang and libbpf that > are sufficient. To avoid the error and build without BPF skeletons the > NO_BPF_SKEL=1 flag can be used. Add a build-options flag to 'perf > version' to enable detection of the BPF skeleton support and use this > in the offcpu shell test. Checking this: cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.Rr5xDuXo13 DESTDIR=/tmp/tmp.cYdDvy09eY BUILD: Doing 'make -j32' parallel build HOSTCC /tmp/tmp.Rr5xDuXo13/fixdep.o HOSTLD /tmp/tmp.Rr5xDuXo13/fixdep-in.o LINK /tmp/tmp.Rr5xDuXo13/fixdep Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h Warning: Kernel ABI header at 'tools/include/linux/coresight-pmu.h' differs from latest version at 'include/linux/coresight-pmu.h' diff -u tools/include/linux/coresight-pmu.h include/linux/coresight-pmu.h Makefile.config:1130: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel GEN /tmp/tmp.Rr5xDuXo13/common-cmds.h CC /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.o CC /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.o LINK /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.so LINK /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.so INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/exec-cmd.h INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/help.h INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/pager.h INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/parse-options.h INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/run-command.h CC /tmp/tmp.Rr5xDuXo13/libsubcmd/exec-cmd.o CC /tmp/tmp.Rr5xDuXo13/libsubcmd/help.o CC /tmp/tmp.Rr5xDuXo13/libsubcmd/pager.o CC /tmp/tmp.Rr5xDuXo13/libsubcmd/parse-options.o CC /tmp/tmp.Rr5xDuXo13/libsubcmd/run-command.o CC /tmp/tmp.Rr5xDuXo13/libsubcmd/sigchain.o CC /tmp/tmp.Rr5xDuXo13/libsubcmd/subcmd-config.o MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/ MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/ INSTALL libsubcmd_headers INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/hashmap.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/relo_core.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_internal.h PERF_VERSION = 6.3.rc1.g0b82b38b7b56 INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/bpf_perf.h INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/core.h INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/cpumap.h INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/threadmap.h INSTALL /tmp/tmp.Rr5xDuXo13/libsymbol/include/symbol/kallsyms.h INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/cpu.h INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evlist.h INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/debug.h INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evsel.h INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/io.h GEN perf-archive INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/event.h INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fd/array.h GEN perf-iostat INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/mmap.h CC /tmp/tmp.Rr5xDuXo13/libperf/core.o CC /tmp/tmp.Rr5xDuXo13/libsymbol/kallsyms.o CC /tmp/tmp.Rr5xDuXo13/libapi/cpu.o INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/cpumap.h INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/fs.h INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/tracing_path.h MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fd/ CC /tmp/tmp.Rr5xDuXo13/libapi/debug.o CC /tmp/tmp.Rr5xDuXo13/libapi/str_error_r.o CC /tmp/tmp.Rr5xDuXo13/libperf/cpumap.o INSTALL libsymbol_headers INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evlist.h CC /tmp/tmp.Rr5xDuXo13/libperf/threadmap.o INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evsel.h CC /tmp/tmp.Rr5xDuXo13/libperf/evsel.o INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/lib.h CC /tmp/tmp.Rr5xDuXo13/libperf/evlist.o INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/mmap.h MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fs/ INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/threadmap.h CC /tmp/tmp.Rr5xDuXo13/libapi/fd/array.o MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fs/ CC /tmp/tmp.Rr5xDuXo13/libperf/mmap.o INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/xyarray.h CC /tmp/tmp.Rr5xDuXo13/libapi/fs/fs.o CC /tmp/tmp.Rr5xDuXo13/libperf/zalloc.o CC /tmp/tmp.Rr5xDuXo13/libperf/xyarray.o CC /tmp/tmp.Rr5xDuXo13/libapi/fs/cgroup.o CC /tmp/tmp.Rr5xDuXo13/libperf/lib.o INSTALL libapi_headers CC /tmp/tmp.Rr5xDuXo13/libapi/fs/tracing_path.o INSTALL libperf_headers GEN /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/bpf_helper_defs.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/btf.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_common.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_legacy.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helpers.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_tracing.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_endian.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_core_read.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/skel_internal.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_version.h INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/usdt.bpf.h LD /tmp/tmp.Rr5xDuXo13/libapi/fd/libapi-in.o LD /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol-in.o AR /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol.a LD /tmp/tmp.Rr5xDuXo13/libapi/fs/libapi-in.o INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helper_defs.h MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ INSTALL libbpf_headers MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ LD /tmp/tmp.Rr5xDuXo13/libapi/libapi-in.o MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_probes.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/hashmap.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/nlattr.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf_dump.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_errno.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/str_error.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/netlink.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ringbuf.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf_prog_linfo.o LD /tmp/tmp.Rr5xDuXo13/libperf/libperf-in.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/strset.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/linker.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/gen_loader.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/relo_core.o AR /tmp/tmp.Rr5xDuXo13/libapi/libapi.a CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/usdt.o AR /tmp/tmp.Rr5xDuXo13/libperf/libperf.a LD /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd-in.o AR /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd.a GEN /tmp/tmp.Rr5xDuXo13/python/perf.cpython-311-x86_64-linux-gnu.so LD /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf-in.o LINK /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/libbpf.a CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/main.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/common.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/json_writer.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/gen.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/xlated_dumper.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf_dumper.o CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/disasm.o LINK /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/bpftool GEN /tmp/tmp.Rr5xDuXo13/util/bpf_skel/vmlinux.h CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bpf_prog_profiler.bpf.o CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/func_latency.bpf.o CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/off_cpu.bpf.o CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/kwork_trace.bpf.o util/bpf_skel/lock_contention.bpf.c:192:7: error: call to undeclared function 'bpf_core_type_matches'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] if (bpf_core_type_matches(struct rw_semaphore___old)) { ^ util/bpf_skel/lock_contention.bpf.c:192:29: error: expected expression if (bpf_core_type_matches(struct rw_semaphore___old)) { ^ util/bpf_skel/lock_contention.bpf.c:195:36: error: expected expression } else if (bpf_core_type_matches(struct rw_semaphore___new)) { ^ 3 errors generated. /usr/bin/ld: bpf architecture of input file `/tmp/bperf_follower-74fba5.o' is incompatible with i386:x86-64 output /usr/bin/ld: bpf architecture of input file `/tmp/bperf_leader-b2ec61.o' is incompatible with i386:x86-64 output /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' /usr/bin/ld: final link failed: file in wrong format /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' /usr/bin/ld: final link failed: file in wrong format collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) /usr/bin/ld: bpf architecture of input file `/tmp/func_latency-70b7d4.o' is incompatible with i386:x86-64 output make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o] Error 1 make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o] Error 1 /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' /usr/bin/ld: final link failed: file in wrong format collect2: error: ld returned 1 exit status clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/func_latency.bpf.o] Error 1 /usr/bin/ld: bpf architecture of input file `/tmp/bpf_prog_profiler-6e9720.o' is incompatible with i386:x86-64 output /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' /usr/bin/ld: final link failed: file in wrong format collect2: error: ld returned 1 exit status clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bpf_prog_profiler.bpf.o] Error 1 /usr/bin/ld: bpf architecture of input file `/tmp/kwork_trace-8d5b4e.o' is incompatible with i386:x86-64 output /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' /usr/bin/ld: final link failed: file in wrong format collect2: error: ld returned 1 exit status clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/kwork_trace.bpf.o] Error 1 /usr/bin/ld: bpf architecture of input file `/tmp/off_cpu-1cb75d.o' is incompatible with i386:x86-64 output /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' /usr/bin/ld: final link failed: file in wrong format collect2: error: ld returned 1 exit status clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/off_cpu.bpf.o] Error 1 /usr/bin/ld: bpf architecture of input file `/tmp/bperf_cgroup-45eb44.o' is incompatible with i386:x86-64 output /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' /usr/bin/ld: final link failed: file in wrong format collect2: error: ld returned 1 exit status clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o] Error 1 make[3]: *** [Makefile.perf:236: sub-make] Error 2 make[2]: *** [Makefile:70: all] Error 2 make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1 make: *** [Makefile:103: build-test] Error 2 make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf' real 5m55.192s user 62m31.596s sys 14m30.828s ⬢[acme@toolbox perf-tools-next]$
On Mon, Mar 13, 2023 at 1:19 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Em Fri, Mar 10, 2023 at 10:57:42PM -0800, Ian Rogers escreveu: > > BPF skeleton support is now key to a number of perf features. Rather > > than making it so that BPF support must be enabled for the build, make > > this the default and error if the build lacks a clang and libbpf that > > are sufficient. To avoid the error and build without BPF skeletons the > > NO_BPF_SKEL=1 flag can be used. Add a build-options flag to 'perf > > version' to enable detection of the BPF skeleton support and use this > > in the offcpu shell test. > > Checking this: > > cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.Rr5xDuXo13 DESTDIR=/tmp/tmp.cYdDvy09eY > BUILD: Doing 'make -j32' parallel build > HOSTCC /tmp/tmp.Rr5xDuXo13/fixdep.o > HOSTLD /tmp/tmp.Rr5xDuXo13/fixdep-in.o > LINK /tmp/tmp.Rr5xDuXo13/fixdep > Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' > diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h > Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' > diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h > Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' > diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h > Warning: Kernel ABI header at 'tools/include/linux/coresight-pmu.h' differs from latest version at 'include/linux/coresight-pmu.h' > diff -u tools/include/linux/coresight-pmu.h include/linux/coresight-pmu.h > Makefile.config:1130: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel > > GEN /tmp/tmp.Rr5xDuXo13/common-cmds.h > CC /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.o > CC /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.o > LINK /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.so > LINK /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.so > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/exec-cmd.h > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/help.h > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/pager.h > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/parse-options.h > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/run-command.h > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/exec-cmd.o > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/help.o > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/pager.o > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/parse-options.o > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/run-command.o > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/sigchain.o > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/subcmd-config.o > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/ > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/ > INSTALL libsubcmd_headers > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/hashmap.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/relo_core.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_internal.h > PERF_VERSION = 6.3.rc1.g0b82b38b7b56 > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/bpf_perf.h > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/core.h > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/cpumap.h > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/threadmap.h > INSTALL /tmp/tmp.Rr5xDuXo13/libsymbol/include/symbol/kallsyms.h > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/cpu.h > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evlist.h > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/debug.h > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evsel.h > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/io.h > GEN perf-archive > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/event.h > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fd/array.h > GEN perf-iostat > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/mmap.h > CC /tmp/tmp.Rr5xDuXo13/libperf/core.o > CC /tmp/tmp.Rr5xDuXo13/libsymbol/kallsyms.o > CC /tmp/tmp.Rr5xDuXo13/libapi/cpu.o > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/cpumap.h > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/fs.h > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/tracing_path.h > MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fd/ > CC /tmp/tmp.Rr5xDuXo13/libapi/debug.o > CC /tmp/tmp.Rr5xDuXo13/libapi/str_error_r.o > CC /tmp/tmp.Rr5xDuXo13/libperf/cpumap.o > INSTALL libsymbol_headers > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evlist.h > CC /tmp/tmp.Rr5xDuXo13/libperf/threadmap.o > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evsel.h > CC /tmp/tmp.Rr5xDuXo13/libperf/evsel.o > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/lib.h > CC /tmp/tmp.Rr5xDuXo13/libperf/evlist.o > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/mmap.h > MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fs/ > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/threadmap.h > CC /tmp/tmp.Rr5xDuXo13/libapi/fd/array.o > MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fs/ > CC /tmp/tmp.Rr5xDuXo13/libperf/mmap.o > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/xyarray.h > CC /tmp/tmp.Rr5xDuXo13/libapi/fs/fs.o > CC /tmp/tmp.Rr5xDuXo13/libperf/zalloc.o > CC /tmp/tmp.Rr5xDuXo13/libperf/xyarray.o > CC /tmp/tmp.Rr5xDuXo13/libapi/fs/cgroup.o > CC /tmp/tmp.Rr5xDuXo13/libperf/lib.o > INSTALL libapi_headers > CC /tmp/tmp.Rr5xDuXo13/libapi/fs/tracing_path.o > INSTALL libperf_headers > GEN /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/bpf_helper_defs.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/btf.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_common.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_legacy.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helpers.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_tracing.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_endian.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_core_read.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/skel_internal.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_version.h > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/usdt.bpf.h > LD /tmp/tmp.Rr5xDuXo13/libapi/fd/libapi-in.o > LD /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol-in.o > AR /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol.a > LD /tmp/tmp.Rr5xDuXo13/libapi/fs/libapi-in.o > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helper_defs.h > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > INSTALL libbpf_headers > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > LD /tmp/tmp.Rr5xDuXo13/libapi/libapi-in.o > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_probes.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/hashmap.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/nlattr.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf_dump.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_errno.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/str_error.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/netlink.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ringbuf.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf_prog_linfo.o > LD /tmp/tmp.Rr5xDuXo13/libperf/libperf-in.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/strset.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/linker.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/gen_loader.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/relo_core.o > AR /tmp/tmp.Rr5xDuXo13/libapi/libapi.a > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/usdt.o > AR /tmp/tmp.Rr5xDuXo13/libperf/libperf.a > LD /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd-in.o > AR /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd.a > GEN /tmp/tmp.Rr5xDuXo13/python/perf.cpython-311-x86_64-linux-gnu.so > LD /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf-in.o > LINK /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/libbpf.a > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/main.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/common.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/json_writer.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/gen.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/xlated_dumper.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf_dumper.o > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/disasm.o > LINK /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/bpftool > GEN /tmp/tmp.Rr5xDuXo13/util/bpf_skel/vmlinux.h > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bpf_prog_profiler.bpf.o > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/func_latency.bpf.o > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/off_cpu.bpf.o > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/kwork_trace.bpf.o > util/bpf_skel/lock_contention.bpf.c:192:7: error: call to undeclared function 'bpf_core_type_matches'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] > if (bpf_core_type_matches(struct rw_semaphore___old)) { > ^ > util/bpf_skel/lock_contention.bpf.c:192:29: error: expected expression > if (bpf_core_type_matches(struct rw_semaphore___old)) { > ^ > util/bpf_skel/lock_contention.bpf.c:195:36: error: expected expression > } else if (bpf_core_type_matches(struct rw_semaphore___new)) { > ^ > 3 errors generated. > /usr/bin/ld: bpf architecture of input file `/tmp/bperf_follower-74fba5.o' is incompatible with i386:x86-64 output > /usr/bin/ld: bpf architecture of input file `/tmp/bperf_leader-b2ec61.o' is incompatible with i386:x86-64 output > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > (.text+0x1b): undefined reference to `main' > /usr/bin/ld: final link failed: file in wrong format > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > (.text+0x1b): undefined reference to `main' > /usr/bin/ld: final link failed: file in wrong format > collect2: error: ld returned 1 exit status > collect2: error: ld returned 1 exit status > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > /usr/bin/ld: bpf architecture of input file `/tmp/func_latency-70b7d4.o' is incompatible with i386:x86-64 output > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o] Error 1 > make[4]: *** Waiting for unfinished jobs.... > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o] Error 1 > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o] Error 1 > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > (.text+0x1b): undefined reference to `main' > /usr/bin/ld: final link failed: file in wrong format > collect2: error: ld returned 1 exit status > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/func_latency.bpf.o] Error 1 > /usr/bin/ld: bpf architecture of input file `/tmp/bpf_prog_profiler-6e9720.o' is incompatible with i386:x86-64 output > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > (.text+0x1b): undefined reference to `main' > /usr/bin/ld: final link failed: file in wrong format > collect2: error: ld returned 1 exit status > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bpf_prog_profiler.bpf.o] Error 1 > /usr/bin/ld: bpf architecture of input file `/tmp/kwork_trace-8d5b4e.o' is incompatible with i386:x86-64 output > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > (.text+0x1b): undefined reference to `main' > /usr/bin/ld: final link failed: file in wrong format > collect2: error: ld returned 1 exit status > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/kwork_trace.bpf.o] Error 1 > /usr/bin/ld: bpf architecture of input file `/tmp/off_cpu-1cb75d.o' is incompatible with i386:x86-64 output > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > (.text+0x1b): undefined reference to `main' > /usr/bin/ld: final link failed: file in wrong format > collect2: error: ld returned 1 exit status > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/off_cpu.bpf.o] Error 1 > /usr/bin/ld: bpf architecture of input file `/tmp/bperf_cgroup-45eb44.o' is incompatible with i386:x86-64 output > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > (.text+0x1b): undefined reference to `main' > /usr/bin/ld: final link failed: file in wrong format > collect2: error: ld returned 1 exit status > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o] Error 1 > make[3]: *** [Makefile.perf:236: sub-make] Error 2 > make[2]: *** [Makefile:70: all] Error 2 > make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1 > make: *** [Makefile:103: build-test] Error 2 > make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf' > > real 5m55.192s > user 62m31.596s > sys 14m30.828s > ⬢[acme@toolbox perf-tools-next]$ Sorry, I was testing this on top of: https://lore.kernel.org/lkml/20230116010115.490713-1-irogers@google.com/ The issue being that we're trying to use an old libbpf that the has meant disabling things but: NO_BPF_SKEL := 1 hadn't been set as part of this. I can address in v2, but with the "assume libbpf 1.0+" patch I hadn't been worrying about this as we'd error out for this case - rather than build error. The erroring out can be worked around by just not having libbpf be dynamic (ie static or not at all by adding NO_LIBBPF=1). Thanks, Ian >
Em Mon, Mar 13, 2023 at 01:27:21PM -0700, Ian Rogers escreveu: > On Mon, Mar 13, 2023 at 1:19 PM Arnaldo Carvalho de Melo > <acme@kernel.org> wrote: > > > > Em Fri, Mar 10, 2023 at 10:57:42PM -0800, Ian Rogers escreveu: > > > BPF skeleton support is now key to a number of perf features. Rather > > > than making it so that BPF support must be enabled for the build, make > > > this the default and error if the build lacks a clang and libbpf that > > > are sufficient. To avoid the error and build without BPF skeletons the > > > NO_BPF_SKEL=1 flag can be used. Add a build-options flag to 'perf > > > version' to enable detection of the BPF skeleton support and use this > > > in the offcpu shell test. > > > > Checking this: > > > > cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.Rr5xDuXo13 DESTDIR=/tmp/tmp.cYdDvy09eY > > BUILD: Doing 'make -j32' parallel build > > HOSTCC /tmp/tmp.Rr5xDuXo13/fixdep.o > > HOSTLD /tmp/tmp.Rr5xDuXo13/fixdep-in.o > > LINK /tmp/tmp.Rr5xDuXo13/fixdep > > Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' > > diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h > > Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' > > diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h > > Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' > > diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h > > Warning: Kernel ABI header at 'tools/include/linux/coresight-pmu.h' differs from latest version at 'include/linux/coresight-pmu.h' > > diff -u tools/include/linux/coresight-pmu.h include/linux/coresight-pmu.h > > Makefile.config:1130: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel > > > > GEN /tmp/tmp.Rr5xDuXo13/common-cmds.h > > CC /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.o > > CC /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.o > > LINK /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-test-api-v0.so > > LINK /tmp/tmp.Rr5xDuXo13/dlfilters/dlfilter-show-cycles.so > > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/exec-cmd.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/help.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/pager.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/parse-options.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libsubcmd/include/subcmd/run-command.h > > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/exec-cmd.o > > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/help.o > > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/pager.o > > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/parse-options.o > > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/run-command.o > > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/sigchain.o > > CC /tmp/tmp.Rr5xDuXo13/libsubcmd/subcmd-config.o > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/ > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/ > > INSTALL libsubcmd_headers > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/hashmap.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/relo_core.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_internal.h > > PERF_VERSION = 6.3.rc1.g0b82b38b7b56 > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/bpf_perf.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/core.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/cpumap.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/threadmap.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libsymbol/include/symbol/kallsyms.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/cpu.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evlist.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/debug.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/evsel.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/io.h > > GEN perf-archive > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/event.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fd/array.h > > GEN perf-iostat > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/perf/mmap.h > > CC /tmp/tmp.Rr5xDuXo13/libperf/core.o > > CC /tmp/tmp.Rr5xDuXo13/libsymbol/kallsyms.o > > CC /tmp/tmp.Rr5xDuXo13/libapi/cpu.o > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/cpumap.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/fs.h > > INSTALL /tmp/tmp.Rr5xDuXo13/libapi/include/api/fs/tracing_path.h > > MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fd/ > > CC /tmp/tmp.Rr5xDuXo13/libapi/debug.o > > CC /tmp/tmp.Rr5xDuXo13/libapi/str_error_r.o > > CC /tmp/tmp.Rr5xDuXo13/libperf/cpumap.o > > INSTALL libsymbol_headers > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evlist.h > > CC /tmp/tmp.Rr5xDuXo13/libperf/threadmap.o > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/evsel.h > > CC /tmp/tmp.Rr5xDuXo13/libperf/evsel.o > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/lib.h > > CC /tmp/tmp.Rr5xDuXo13/libperf/evlist.o > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/mmap.h > > MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fs/ > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/threadmap.h > > CC /tmp/tmp.Rr5xDuXo13/libapi/fd/array.o > > MKDIR /tmp/tmp.Rr5xDuXo13/libapi/fs/ > > CC /tmp/tmp.Rr5xDuXo13/libperf/mmap.o > > INSTALL /tmp/tmp.Rr5xDuXo13/libperf/include/internal/xyarray.h > > CC /tmp/tmp.Rr5xDuXo13/libapi/fs/fs.o > > CC /tmp/tmp.Rr5xDuXo13/libperf/zalloc.o > > CC /tmp/tmp.Rr5xDuXo13/libperf/xyarray.o > > CC /tmp/tmp.Rr5xDuXo13/libapi/fs/cgroup.o > > CC /tmp/tmp.Rr5xDuXo13/libperf/lib.o > > INSTALL libapi_headers > > CC /tmp/tmp.Rr5xDuXo13/libapi/fs/tracing_path.o > > INSTALL libperf_headers > > GEN /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/bpf_helper_defs.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/btf.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_common.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_legacy.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helpers.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_tracing.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_endian.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_core_read.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/skel_internal.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/libbpf_version.h > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/usdt.bpf.h > > LD /tmp/tmp.Rr5xDuXo13/libapi/fd/libapi-in.o > > LD /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol-in.o > > AR /tmp/tmp.Rr5xDuXo13/libsymbol/libsymbol.a > > LD /tmp/tmp.Rr5xDuXo13/libapi/fs/libapi-in.o > > INSTALL /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/include/bpf/bpf_helper_defs.h > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > INSTALL libbpf_headers > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > LD /tmp/tmp.Rr5xDuXo13/libapi/libapi-in.o > > MKDIR /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_probes.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/hashmap.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/nlattr.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf_dump.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/btf.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf_errno.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/str_error.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/netlink.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/ringbuf.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/bpf_prog_linfo.o > > LD /tmp/tmp.Rr5xDuXo13/libperf/libperf-in.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/strset.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/linker.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/gen_loader.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/relo_core.o > > AR /tmp/tmp.Rr5xDuXo13/libapi/libapi.a > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/usdt.o > > AR /tmp/tmp.Rr5xDuXo13/libperf/libperf.a > > LD /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd-in.o > > AR /tmp/tmp.Rr5xDuXo13/libsubcmd/libsubcmd.a > > GEN /tmp/tmp.Rr5xDuXo13/python/perf.cpython-311-x86_64-linux-gnu.so > > LD /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/staticobjs/libbpf-in.o > > LINK /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/libbpf/libbpf.a > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/main.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/common.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/json_writer.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/gen.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/xlated_dumper.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/btf_dumper.o > > CC /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/disasm.o > > LINK /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bootstrap/bpftool > > GEN /tmp/tmp.Rr5xDuXo13/util/bpf_skel/vmlinux.h > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bpf_prog_profiler.bpf.o > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/func_latency.bpf.o > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/off_cpu.bpf.o > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o > > CLANG /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/kwork_trace.bpf.o > > util/bpf_skel/lock_contention.bpf.c:192:7: error: call to undeclared function 'bpf_core_type_matches'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] > > if (bpf_core_type_matches(struct rw_semaphore___old)) { > > ^ > > util/bpf_skel/lock_contention.bpf.c:192:29: error: expected expression > > if (bpf_core_type_matches(struct rw_semaphore___old)) { > > ^ > > util/bpf_skel/lock_contention.bpf.c:195:36: error: expected expression > > } else if (bpf_core_type_matches(struct rw_semaphore___new)) { > > ^ > > 3 errors generated. > > /usr/bin/ld: bpf architecture of input file `/tmp/bperf_follower-74fba5.o' is incompatible with i386:x86-64 output > > /usr/bin/ld: bpf architecture of input file `/tmp/bperf_leader-b2ec61.o' is incompatible with i386:x86-64 output > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > > (.text+0x1b): undefined reference to `main' > > /usr/bin/ld: final link failed: file in wrong format > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > > (.text+0x1b): undefined reference to `main' > > /usr/bin/ld: final link failed: file in wrong format > > collect2: error: ld returned 1 exit status > > collect2: error: ld returned 1 exit status > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > /usr/bin/ld: bpf architecture of input file `/tmp/func_latency-70b7d4.o' is incompatible with i386:x86-64 output > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/lock_contention.bpf.o] Error 1 > > make[4]: *** Waiting for unfinished jobs.... > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_follower.bpf.o] Error 1 > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_leader.bpf.o] Error 1 > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > > (.text+0x1b): undefined reference to `main' > > /usr/bin/ld: final link failed: file in wrong format > > collect2: error: ld returned 1 exit status > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/func_latency.bpf.o] Error 1 > > /usr/bin/ld: bpf architecture of input file `/tmp/bpf_prog_profiler-6e9720.o' is incompatible with i386:x86-64 output > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > > (.text+0x1b): undefined reference to `main' > > /usr/bin/ld: final link failed: file in wrong format > > collect2: error: ld returned 1 exit status > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bpf_prog_profiler.bpf.o] Error 1 > > /usr/bin/ld: bpf architecture of input file `/tmp/kwork_trace-8d5b4e.o' is incompatible with i386:x86-64 output > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > > (.text+0x1b): undefined reference to `main' > > /usr/bin/ld: final link failed: file in wrong format > > collect2: error: ld returned 1 exit status > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/kwork_trace.bpf.o] Error 1 > > /usr/bin/ld: bpf architecture of input file `/tmp/off_cpu-1cb75d.o' is incompatible with i386:x86-64 output > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > > (.text+0x1b): undefined reference to `main' > > /usr/bin/ld: final link failed: file in wrong format > > collect2: error: ld returned 1 exit status > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/off_cpu.bpf.o] Error 1 > > /usr/bin/ld: bpf architecture of input file `/tmp/bperf_cgroup-45eb44.o' is incompatible with i386:x86-64 output > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/crt1.o: in function `_start': > > (.text+0x1b): undefined reference to `main' > > /usr/bin/ld: final link failed: file in wrong format > > collect2: error: ld returned 1 exit status > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o] Error 1 > > make[3]: *** [Makefile.perf:236: sub-make] Error 2 > > make[2]: *** [Makefile:70: all] Error 2 > > make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1 > > make: *** [Makefile:103: build-test] Error 2 > > make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf' > > > > real 5m55.192s > > user 62m31.596s > > sys 14m30.828s > > ⬢[acme@toolbox perf-tools-next]$ > > Sorry, I was testing this on top of: > https://lore.kernel.org/lkml/20230116010115.490713-1-irogers@google.com/ > The issue being that we're trying to use an old libbpf that the has > meant disabling things but: > NO_BPF_SKEL := 1 > hadn't been set as part of this. I can address in v2, but with the > "assume libbpf 1.0+" patch I hadn't been worrying about this as we'd > error out for this case - rather than build error. The erroring out > can be worked around by just not having libbpf be dynamic (ie static > or not at all by adding NO_LIBBPF=1). I'll try adding that 3-patch series before this one. - Arnaldo
Em Mon, Mar 13, 2023 at 05:34:06PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Mar 13, 2023 at 01:27:21PM -0700, Ian Rogers escreveu: > > On Mon, Mar 13, 2023 at 1:19 PM Arnaldo Carvalho de Melo > > > (.text+0x1b): undefined reference to `main' > > > /usr/bin/ld: final link failed: file in wrong format > > > collect2: error: ld returned 1 exit status > > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o] Error 1 > > > make[3]: *** [Makefile.perf:236: sub-make] Error 2 > > > make[2]: *** [Makefile:70: all] Error 2 > > > make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1 > > > make: *** [Makefile:103: build-test] Error 2 > > > make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf' > > > > > > real 5m55.192s > > > user 62m31.596s > > > sys 14m30.828s > > > ⬢[acme@toolbox perf-tools-next]$ > > > > Sorry, I was testing this on top of: > > https://lore.kernel.org/lkml/20230116010115.490713-1-irogers@google.com/ > > The issue being that we're trying to use an old libbpf that the has > > meant disabling things but: > > NO_BPF_SKEL := 1 > > hadn't been set as part of this. I can address in v2, but with the > > "assume libbpf 1.0+" patch I hadn't been worrying about this as we'd > > error out for this case - rather than build error. The erroring out > > can be worked around by just not having libbpf be dynamic (ie static > > or not at all by adding NO_LIBBPF=1). > > I'll try adding that 3-patch series before this one. ⬢[acme@toolbox perf-tools-next]$ git log --oneline -16 76c8a07f51703787 (HEAD -> perf-tools-next) perf build: Error if no libelf and NO_LIBELF isn't set 030a6c72b38e334d perf build: Remove redundant NO_NEWT build option 5d1360fc84cd2e3b perf build: If libtraceevent isn't present error the build e25e0db4700aa39a perf build: Switch libpfm4 to opt-out rather than opt-in 39f53202a8961d3d perf symbol: Add abi::__cxa_demangle C++ demangling support d857f258f3d1214a tools build: Add feature test for abi::__cxa_demangle 7aae0d8341c9c373 perf build: Make binutil libraries opt in dc4890e772aba1e9 perf build: Error if jevents won't work and NO_JEVENTS=1 isn't set 334e64172816623d perf util: Remove weak sched_getcpu e44d7e7c60fc4ded perf build: Remove unused HAVE_GLIBC_SUPPORT 14ea53be45758450 perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL eb03903c5c119254 perf build: Support python/perf.so testing f8b579c1996ba4a9 perf bpf: Remove pre libbpf 1.0 conditional logic 2cce43c63d4d0abc perf build: Remove libbpf pre-1.0 feature tests a24ebff6cce14a34 tools build: Pass libbpf feature only if libbpf 1.0+ 17535a33a9c1e4fb perf lock contention: Fix compiler builtin detection ⬢[acme@toolbox perf-tools-next]$ make_libbpf_dynamic_O: cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.cO9WpgtAvo DESTDIR=/tmp/tmp.jjguTPlLWt ldd: /tmp/tmp.cO9WpgtAvo/perf: No such file or directory cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.cO9WpgtAvo DESTDIR=/tmp/tmp.jjguTPlLWt BUILD: Doing 'make -j32' parallel build HOSTCC /tmp/tmp.cO9WpgtAvo/fixdep.o HOSTLD /tmp/tmp.cO9WpgtAvo/fixdep-in.o LINK /tmp/tmp.cO9WpgtAvo/fixdep Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h Warning: Kernel ABI header at 'tools/include/linux/coresight-pmu.h' differs from latest version at 'include/linux/coresight-pmu.h' diff -u tools/include/linux/coresight-pmu.h include/linux/coresight-pmu.h Makefile.config:563: *** Error: No libbpf devel library found, please install libbpf-devel. Stop. make[3]: *** [Makefile.perf:236: sub-make] Error 2 make[2]: *** [Makefile:70: all] Error 2 make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1 But: ⬢[acme@toolbox perf-tools-next]$ rpm -qa | grep libbpf libbpf-0.8.0-2.fc37.x86_64 libbpf-devel-0.8.0-2.fc37.x86_64 ⬢[acme@toolbox perf-tools-next]$ ⬢[acme@toolbox perf-tools-next]$ cat /etc/os-release NAME="Fedora Linux" VERSION="37 (Container Image)" I'll see if this is just a matter of tweaking the error message to something like "libbpf-devel not found or older than 1.0.0, please install/update" - Arnaldo
Em Mon, Mar 13, 2023 at 05:59:35PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Mar 13, 2023 at 05:34:06PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Mon, Mar 13, 2023 at 01:27:21PM -0700, Ian Rogers escreveu: > > > On Mon, Mar 13, 2023 at 1:19 PM Arnaldo Carvalho de Melo > > > > (.text+0x1b): undefined reference to `main' > > > > /usr/bin/ld: final link failed: file in wrong format > > > > collect2: error: ld returned 1 exit status > > > > clang-15: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) > > > > make[4]: *** [Makefile.perf:1081: /tmp/tmp.Rr5xDuXo13/util/bpf_skel/.tmp/bperf_cgroup.bpf.o] Error 1 > > > > make[3]: *** [Makefile.perf:236: sub-make] Error 2 > > > > make[2]: *** [Makefile:70: all] Error 2 > > > > make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1 > > > > make: *** [Makefile:103: build-test] Error 2 > > > > make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf' > > > > > > > > real 5m55.192s > > > > user 62m31.596s > > > > sys 14m30.828s > > > > ⬢[acme@toolbox perf-tools-next]$ > > > > > > Sorry, I was testing this on top of: > > > https://lore.kernel.org/lkml/20230116010115.490713-1-irogers@google.com/ > > > The issue being that we're trying to use an old libbpf that the has > > > meant disabling things but: > > > NO_BPF_SKEL := 1 > > > hadn't been set as part of this. I can address in v2, but with the > > > "assume libbpf 1.0+" patch I hadn't been worrying about this as we'd > > > error out for this case - rather than build error. The erroring out > > > can be worked around by just not having libbpf be dynamic (ie static > > > or not at all by adding NO_LIBBPF=1). > > > > I'll try adding that 3-patch series before this one. > > ⬢[acme@toolbox perf-tools-next]$ git log --oneline -16 > 76c8a07f51703787 (HEAD -> perf-tools-next) perf build: Error if no libelf and NO_LIBELF isn't set > 030a6c72b38e334d perf build: Remove redundant NO_NEWT build option > 5d1360fc84cd2e3b perf build: If libtraceevent isn't present error the build > e25e0db4700aa39a perf build: Switch libpfm4 to opt-out rather than opt-in > 39f53202a8961d3d perf symbol: Add abi::__cxa_demangle C++ demangling support > d857f258f3d1214a tools build: Add feature test for abi::__cxa_demangle > 7aae0d8341c9c373 perf build: Make binutil libraries opt in > dc4890e772aba1e9 perf build: Error if jevents won't work and NO_JEVENTS=1 isn't set > 334e64172816623d perf util: Remove weak sched_getcpu > e44d7e7c60fc4ded perf build: Remove unused HAVE_GLIBC_SUPPORT > 14ea53be45758450 perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL > eb03903c5c119254 perf build: Support python/perf.so testing > f8b579c1996ba4a9 perf bpf: Remove pre libbpf 1.0 conditional logic > 2cce43c63d4d0abc perf build: Remove libbpf pre-1.0 feature tests > a24ebff6cce14a34 tools build: Pass libbpf feature only if libbpf 1.0+ > 17535a33a9c1e4fb perf lock contention: Fix compiler builtin detection > ⬢[acme@toolbox perf-tools-next]$ > > make_libbpf_dynamic_O: cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.cO9WpgtAvo DESTDIR=/tmp/tmp.jjguTPlLWt > ldd: /tmp/tmp.cO9WpgtAvo/perf: No such file or directory > cd . && make LIBBPF_DYNAMIC=1 FEATURES_DUMP=/var/home/acme/git/perf-tools-next/tools/perf/BUILD_TEST_FEATURE_DUMP -j32 O=/tmp/tmp.cO9WpgtAvo DESTDIR=/tmp/tmp.jjguTPlLWt > BUILD: Doing 'make -j32' parallel build > HOSTCC /tmp/tmp.cO9WpgtAvo/fixdep.o > HOSTLD /tmp/tmp.cO9WpgtAvo/fixdep-in.o > LINK /tmp/tmp.cO9WpgtAvo/fixdep > Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' > diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h > Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' > diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h > Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/perf_regs.h' differs from latest version at 'arch/arm64/include/uapi/asm/perf_regs.h' > diff -u tools/arch/arm64/include/uapi/asm/perf_regs.h arch/arm64/include/uapi/asm/perf_regs.h > Warning: Kernel ABI header at 'tools/include/linux/coresight-pmu.h' differs from latest version at 'include/linux/coresight-pmu.h' > diff -u tools/include/linux/coresight-pmu.h include/linux/coresight-pmu.h > Makefile.config:563: *** Error: No libbpf devel library found, please install libbpf-devel. Stop. > make[3]: *** [Makefile.perf:236: sub-make] Error 2 > make[2]: *** [Makefile:70: all] Error 2 > make[1]: *** [tests/make:326: make_libbpf_dynamic_O] Error 1 > > > But: > > ⬢[acme@toolbox perf-tools-next]$ rpm -qa | grep libbpf > libbpf-0.8.0-2.fc37.x86_64 > libbpf-devel-0.8.0-2.fc37.x86_64 > ⬢[acme@toolbox perf-tools-next]$ > > ⬢[acme@toolbox perf-tools-next]$ cat /etc/os-release > NAME="Fedora Linux" > VERSION="37 (Container Image)" > > > I'll see if this is just a matter of tweaking the error message to > something like "libbpf-devel not found or older than 1.0.0, please install/update" Yeah, I'll tweak the warning: ⬢[acme@toolbox perf-tools-next]$ cat /tmp/build/perf-tools-next/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. | ^~~~~ ⬢[acme@toolbox perf-tools-next]$ - Arnaldo
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 5f11834f189e..33d62d542fd5 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -415,6 +415,7 @@ ifdef NO_LIBELF NO_LIBUNWIND := 1 NO_LIBDW_DWARF_UNWIND := 1 NO_LIBBPF := 1 + NO_BPF_SKEL := 1 NO_JVMTI := 1 else ifeq ($(feature-libelf), 0) @@ -662,18 +663,22 @@ ifndef NO_LIBBPF msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.) NO_LIBBPF := 1 endif +else + NO_BPF_SKEL := 1 endif -ifdef BUILD_BPF_SKEL +ifndef NO_BPF_SKEL $(call feature_check,clang-bpf-co-re) ifeq ($(feature-clang-bpf-co-re), 0) - dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL) - endif - ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),) - dummy := $(error Error: BPF skeleton support requires libbpf) + dummy := $(error: ERROR: BPF skeletons unsupported. clang too old/not installed or build with NO_BPF_SKEL=1.) + else + ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),) + dummy := $(error: ERROR: BPF skeletons unsupported. BPF skeleton support requires libbpf or build with NO_BPF_SKEL=1.) + else + $(call detected,CONFIG_PERF_BPF_SKEL) + CFLAGS += -DHAVE_BPF_SKEL + endif endif - $(call detected,CONFIG_PERF_BPF_SKEL) - CFLAGS += -DHAVE_BPF_SKEL endif dwarf-post-unwind := 1 diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 2fcee585b225..283ee4f56234 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -126,7 +126,7 @@ include ../scripts/utilities.mak # # Define NO_LIBDEBUGINFOD if you do not want support debuginfod # -# Define BUILD_BPF_SKEL to enable BPF skeletons +# Define NO_BPF_SKEL to disable BPF skeletons # # As per kernel Makefile, avoid funny character set dependencies @@ -1055,7 +1055,7 @@ SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h $(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT) $(LIBSYMBOL_OUTPUT): $(Q)$(MKDIR) -p $@ -ifdef BUILD_BPF_SKEL +ifndef NO_BPF_SKEL BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) @@ -1088,11 +1088,11 @@ bpf-skel: $(SKELETONS) .PRECIOUS: $(SKEL_TMP_OUT)/%.bpf.o -else # BUILD_BPF_SKEL +else # NO_BPF_SKEL bpf-skel: -endif # BUILD_BPF_SKEL +endif # NO_BPF_SKEL bpf-skel-clean: $(call QUIET_CLEAN, bpf-skel) $(RM) -r $(SKEL_TMP_OUT) $(SKELETONS) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 054997edd98b..240d49a85524 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -2371,7 +2371,7 @@ int cmd_lock(int argc, const char **argv) #ifndef HAVE_BPF_SKEL set_option_nobuild(contention_options, 'b', "use-bpf", - "no BUILD_BPF_SKEL=1", false); + "NO_BPF_SKEL=1", false); #endif if (argc) { argc = parse_options(argc, argv, contention_options, diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 8374117e66f6..495627437f97 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -3971,7 +3971,7 @@ int cmd_record(int argc, const char **argv) #ifndef HAVE_BPF_SKEL # define set_nobuild(s, l, m, c) set_option_nobuild(record_options, s, l, m, c) - set_nobuild('\0', "off-cpu", "no BUILD_BPF_SKEL=1", true); + set_nobuild('\0', "off-cpu", "NO_BPF_SKEL=1", true); # undef set_nobuild #endif diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c index a886929ec6e5..0d9cda238c07 100644 --- a/tools/perf/builtin-version.c +++ b/tools/perf/builtin-version.c @@ -83,6 +83,7 @@ static void library_status(void) STATUS(HAVE_ZSTD_SUPPORT, zstd); STATUS(HAVE_LIBPFM, libpfm4); STATUS(HAVE_LIBTRACEEVENT, libtraceevent); + STATUS(HAVE_BPF_SKEL, BPF skeletons); } int cmd_version(int argc, const char **argv) diff --git a/tools/perf/tests/shell/record_offcpu.sh b/tools/perf/tests/shell/record_offcpu.sh index e01973d4e0fb..24f81ff85793 100755 --- a/tools/perf/tests/shell/record_offcpu.sh +++ b/tools/perf/tests/shell/record_offcpu.sh @@ -28,7 +28,7 @@ test_offcpu_priv() { err=2 return fi - if perf record --off-cpu -o /dev/null --quiet true 2>&1 | grep BUILD_BPF_SKEL + if perf version --build-options 2>&1 | grep HAVE_BPF_SKEL | grep -q OFF then echo "off-cpu test [Skipped missing BPF support]" err=2