From: James Clark <james.clark@linaro.org>
To: Howard Chu <howardchu95@gmail.com>,
Namhyung Kim <namhyung@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: mingo@redhat.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 0/2] perf trace: Fix support for the new BPF feature in clang 12
Date: Thu, 10 Oct 2024 10:06:05 +0100 [thread overview]
Message-ID: <52125138-9ba5-4f71-9e7d-aff5f85d0dae@linaro.org> (raw)
In-Reply-To: <20241007051414.2995674-1-howardchu95@gmail.com>
On 07/10/2024 6:14 am, Howard Chu wrote:
> The new augmentation feature in perf trace, along with the protocol
> change (from payload to payload->value), breaks the clang 12 build.
>
> perf trace actually builds for any clang version newer than clang 16.
> However, as pointed out by Namhyung Kim <namhyung@kernel.org> and Ian
> Rogers <irogers@google.com>, clang 16, which was released in 2023, is
> still too new for most users. Additionally, as James Clark
> <james.clark@linaro.org> noted, some commonly used distributions do not
> yet support clang 16. Therefore, breaking BPF features between clang 12
> and clang 15 is not a good approach.
>
> This patch series rewrites the BPF program in a way that allows it to
> pass the BPF verifier, even when the BPF bytecode is generated by older
> versions of clang.
>
> However, I have only tested it till clang 14, as older versions are not
> supported by my distribution.
>
> Howard Chu (2):
> perf build: Change the clang check back to 12.0.1
> perf trace: Rewrite BPF code to pass the verifier
>
> tools/perf/Makefile.config | 4 +-
> .../bpf_skel/augmented_raw_syscalls.bpf.c | 117 ++++++++++--------
> 2 files changed, 65 insertions(+), 56 deletions(-)
>
Tested with clang 15:
$ sudo perf trace -e write --max-events=100 -- echo hello
0.000 ( 0.014 ms): echo/834165 write(fd: 1, buf: hello\10, count: 6)
=
Tested-by: James Clark <james.clark@linaro.org>
next prev parent reply other threads:[~2024-10-10 9:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 5:14 [PATCH 0/2] perf trace: Fix support for the new BPF feature in clang 12 Howard Chu
2024-10-07 5:14 ` [PATCH 1/2] perf build: Change the clang version check back to 12.0.1 Howard Chu
2024-10-07 5:14 ` [PATCH 2/2] perf trace: Rewrite BPF programs to pass the verifier Howard Chu
2024-10-10 9:06 ` James Clark [this message]
2024-10-11 0:20 ` [PATCH 0/2] perf trace: Fix support for the new BPF feature in clang 12 Namhyung Kim
2024-10-11 2:16 ` Howard Chu
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=52125138-9ba5-4f71-9e7d-aff5f85d0dae@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).