From: James Clark <james.clark@linaro.org>
To: Howard Chu <howardchu95@gmail.com>
Cc: mingo@redhat.com, acme@kernel.org, namhyung@kernel.org,
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, alan.maguire@oracle.com,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH v2 0/2] perf trace: Fix support for the new BPF feature in clang 12
Date: Fri, 11 Oct 2024 09:18:21 +0100 [thread overview]
Message-ID: <ae55ea37-0e0d-4fe1-9b1c-6a31dd20ea30@linaro.org> (raw)
In-Reply-To: <20241011021403.4089793-1-howardchu95@gmail.com>
On 11/10/2024 3:14 am, Howard Chu wrote:
> Changes in v2:
> - Resolved a clang-16 build error pointed out by Namhyung Kim
> <namhyung@kernel.org>
>
> 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 | 122 ++++++++++--------
> 2 files changed, 69 insertions(+), 57 deletions(-)
>
Tested with clang 15:
$ sudo perf trace -e write --max-events=100 -- echo hello
0.000 ( 0.014 ms): echo/976249 write(fd: 1, buf: hello\10, count: 6)
=
Tested-by: James Clark <james.clark@linaro.org>
next prev parent reply other threads:[~2024-10-11 8:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 2:14 Howard Chu
2024-10-11 2:14 ` [PATCH v2 1/2] perf build: Change the clang check back to 12.0.1 Howard Chu
2024-10-11 2:14 ` [PATCH v2 2/2] perf trace: Rewrite BPF code to pass the verifier Howard Chu
2024-10-11 8:18 ` James Clark [this message]
2024-10-15 18:32 ` [PATCH v2 0/2] perf trace: Fix support for the new BPF feature in clang 12 Namhyung Kim
2024-10-15 19:35 ` Arnaldo Carvalho de Melo
2024-10-15 19:58 ` Arnaldo Carvalho de Melo
2024-10-15 20:37 ` Arnaldo Carvalho de Melo
2024-10-15 21:37 ` Song Liu
[not found] ` <CA+JHD905Xtbb2OYqm3mGbh3C1dKOd-avnC=01=uJfTVEnmA1zQ@mail.gmail.com>
2024-10-15 23:20 ` Song Liu
2024-10-16 2:06 ` Namhyung Kim
2024-10-16 14:22 ` Arnaldo Carvalho de Melo
2024-10-22 17:04 ` Namhyung Kim
2024-10-22 18:33 ` Arnaldo Carvalho de Melo
2024-10-22 23:52 ` Namhyung Kim
2024-10-23 14:39 ` Arnaldo Carvalho de Melo
2024-10-23 21:57 ` Namhyung Kim
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=ae55ea37-0e0d-4fe1-9b1c-6a31dd20ea30@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alan.maguire@oracle.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
all inboxes | Powered by JetHome®