All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: irogers@google.com, acme@kernel.org,
	cupertino.miranda@oracle.com,  jose.marchesi@oracle.com,
	namhyung@kernel.org
Cc: adrian.hunter@intel.com, andrii@kernel.org, eddyz87@gmail.com,
	 james.clark@linaro.org, jolsa@kernel.org,
	linux-kernel@vger.kernel.org,  linux-perf-users@vger.kernel.org,
	mingo@redhat.com, peterz@infradead.org,  yonghong.song@linux.dev
Subject: [PATCH v3 0/2] perf build: Support building BPF skeletons with bpf-gcc
Date: Thu, 22 Oct 2026 13:46:25 -0700	[thread overview]
Message-ID: <20261022204627.1813821-1-irogers@google.com> (raw)
In-Reply-To: <20261013231430.2163505-1-irogers@google.com>

Currently the perf build requires clang (>= 12.0.1) to compile BPF
skeleton programs (.bpf.c -> .bpf.o). bpf-gcc (>= 14.0.0) also supports
BPF CO-RE and BTF generation and is already supported in
tools/testing/selftests/bpf/Makefile.

This series updates the perf build to support both clang and bpf-gcc:
- Patch 1 updates Makefile.config, Makefile.perf, and bpf_skel.mak to
  prefer bpf-gcc when building perf with GCC (CC_NO_CLANG=1) and clang
  when building with Clang/LLVM (CC_NO_CLANG=0), while respecting
  explicit BPF_GCC=... or CLANG=... command-line overrides and falling
  back to whichever compiler is available.
- Patch 2 adds make_bpf_skel_clang and make_bpf_skel_bpf_gcc build-test
  targets to tools/perf/tests/make, reuses tools/build/Makefile.feature
  for feature detection, and verifies with
  'perf check -q feature bpf_skeletons' that BPF skeleton support is
  enabled (or disabled for make_no_bpf_skel) as expected.

v3: Reuse tools/build/Makefile.feature and tools/scripts/utilities.mak
    in tools/perf/tests/make rather than open-coding compiler feature
    probes, and explicitly check for exit code 1 from 'perf check' in
    make_no_bpf_skel so crashes are not masked by shell negation.
v2: Pass only -dumpfullversion when querying BPF_GCC_VERSION, guard
    against an empty version string, and fix version-ge3 / version-lt3
    in tools/scripts/utilities.mak so empty or <3-component version
    strings do not shift awk fields and evaluate as false in version-lt3.

Ian Rogers (2):
  perf build: Support building BPF skeletons with bpf-gcc
  perf test make: Add BPF skeleton build tests for clang and bpf-gcc

 tools/perf/Makefile.config     | 83 +++++++++++++++++++++++++++-------
 tools/perf/Makefile.perf       |  8 +++-
 tools/perf/bpf_skel.mak        | 36 ++++++++++-----
 tools/perf/tests/make          | 71 ++++++++++++++++++++++------
 tools/scripts/Makefile.include |  1 +
 tools/scripts/utilities.mak    |  4 +-
 6 files changed, 159 insertions(+), 44 deletions(-)

-- 
2.56.0.307.g5fe7bd680c-goog


  parent reply	other threads:[~2026-10-22 20:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 22:16 [PATCH v1 0/2] perf build: Support building BPF skeletons with bpf-gcc Ian Rogers
2026-10-13 22:16 ` [PATCH v1 1/2] " Ian Rogers
2026-10-13 22:27   ` sashiko-bot
2026-10-13 22:16 ` [PATCH v1 2/2] perf test make: Add BPF skeleton build tests for clang and bpf-gcc Ian Rogers
2026-10-13 22:23   ` sashiko-bot
2026-10-13 23:14 ` [PATCH v2 0/2] perf build: Support building BPF skeletons with bpf-gcc Ian Rogers
2026-10-13 23:14   ` [PATCH v2 1/2] " Ian Rogers
2026-10-13 23:22     ` sashiko-bot
2026-10-13 23:14   ` [PATCH v2 2/2] perf test make: Add BPF skeleton build tests for clang and bpf-gcc Ian Rogers
2026-10-13 23:24     ` sashiko-bot
2026-10-22 20:46   ` Ian Rogers [this message]
2026-10-22 20:46     ` [PATCH v3 1/2] perf build: Support building BPF skeletons with bpf-gcc Ian Rogers
2026-10-22 20:54       ` sashiko-bot
2026-10-22 20:46     ` [PATCH v3 2/2] perf test make: Add BPF skeleton build tests for clang and bpf-gcc Ian Rogers
2026-10-22 20:53       ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261022204627.1813821-1-irogers@google.com \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=andrii@kernel.org \
    --cc=cupertino.miranda@oracle.com \
    --cc=eddyz87@gmail.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=jose.marchesi@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.