linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] perf trace: Fix support for the new BPF feature in clang 12
@ 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
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Howard Chu @ 2024-10-11  2:14 UTC (permalink / raw)
  To: peterz
  Cc: mingo, acme, namhyung, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, kan.liang, linux-perf-users, linux-kernel,
	james.clark, alan.maguire, Howard Chu

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(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-10-23 21:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  2:14 [PATCH v2 0/2] perf trace: Fix support for the new BPF feature in clang 12 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 ` [PATCH v2 0/2] perf trace: Fix support for the new BPF feature in clang 12 James Clark
2024-10-15 18:32 ` 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

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).