Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use clang-17 for building binary #270

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mchataigner
Copy link
Contributor

@mchataigner mchataigner commented Dec 9, 2024

For some reason, clang-16 is not available anymore on debian testing.
Switching to clang 17 (available in both ubuntu 24.04 github runner and debian testing) unblocks the build.

  • Clang 19 was not available in ubuntu 24.04 github runner
  • Clang 18 broke tests with kernels 4.19.314 and 5.4.276

@mchataigner mchataigner requested review from a team as code owners December 9, 2024 14:19
Copy link
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mchataigner, can you also fix the tests? It seems you just need to update the GH workflow and introduce clang-19.

@rockdaboot
Copy link
Contributor

rockdaboot commented Dec 9, 2024

Comparison of eBPF artifacts size

clang-16

.text has 0 instructions
perf_event/unwind_dotnet has 3593 instructions
perf_event/unwind_hotspot has 3252 instructions
tracepoint/sched/sched_switch has 1160 instructions
perf_event/unwind_stop has 445 instructions
perf_event/native_tracer_entry has 431 instructions
perf_event/unwind_native has 4030 instructions
perf_event/unwind_perl has 2646 instructions
perf_event/unwind_php has 2563 instructions
perf_event/unwind_python has 3739 instructions
perf_event/unwind_ruby has 3255 instructions
tracepoint/sched/sched_process_exit has 111 instructions
tracepoint/syscalls/sys_enter_bpf has 25 instructions
raw_tracepoint/sys_enter has 29 instructions
perf_event/unwind_v8 has 3317 instructions

Total instructions: 28596

clang-17

.text has 0 instructions
perf_event/unwind_dotnet has 3463 instructions
perf_event/unwind_hotspot has 3266 instructions
tracepoint/sched/sched_switch has 1160 instructions
perf_event/unwind_stop has 445 instructions
perf_event/native_tracer_entry has 431 instructions
perf_event/unwind_native has 4002 instructions
perf_event/unwind_perl has 2585 instructions
perf_event/unwind_php has 2523 instructions
perf_event/unwind_python has 3654 instructions
perf_event/unwind_ruby has 2927 instructions
tracepoint/sched/sched_process_exit has 111 instructions
tracepoint/syscalls/sys_enter_bpf has 25 instructions
raw_tracepoint/sys_enter has 29 instructions
perf_event/unwind_v8 has 3312 instructions

Total instructions: 27933

clang-18

.text has 73 instructions
perf_event/unwind_dotnet has 3465 instructions
perf_event/unwind_hotspot has 3265 instructions
tracepoint/sched/sched_switch has 1153 instructions
perf_event/unwind_stop has 446 instructions
perf_event/native_tracer_entry has 375 instructions
perf_event/unwind_native has 4003 instructions
perf_event/unwind_perl has 2591 instructions
perf_event/unwind_php has 2567 instructions
perf_event/unwind_python has 3741 instructions
perf_event/unwind_ruby has 3203 instructions
tracepoint/sched/sched_process_exit has 111 instructions
tracepoint/syscalls/sys_enter_bpf has 25 instructions
raw_tracepoint/sys_enter has 29 instructions
perf_event/unwind_v8 has 3382 instructions

Total instructions: 28429

@mchataigner mchataigner changed the title Use clang-19 for building binary Use clang-18 for building binary Dec 9, 2024
@mchataigner
Copy link
Contributor Author

Ok, switching to clang-18 because 19 is not available by default on ubuntu 24.04 github action runner.

@rockdaboot
Copy link
Contributor

The 4.19 and 5.4 ebpf verifiers are too picky for clang-18 code :|

@mchataigner
Copy link
Contributor Author

Ok, then I’m trying Clang 17 :)

@mchataigner mchataigner changed the title Use clang-18 for building binary Use clang-17 for building binary Dec 10, 2024
@mchataigner mchataigner force-pushed the fix_docker_build branch 2 times, most recently from 3ca8442 to e98300e Compare December 10, 2024 10:34
@mchataigner
Copy link
Contributor Author

ok, it seems to work with clang 17

Copy link
Contributor

@rockdaboot rockdaboot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-17 is still packaged for Debian testing.

@korniltsev
Copy link

korniltsev commented Dec 10, 2024

https://apt.llvm.org/ may be worth considering automatic install script from llvm and still using clang-16

Copy link
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update support/ebpf/print_instruction_count.sh to use llvm-objdump-17 instead of -16 ?

support/ebpf/tracer.ebpf.release.arm64 Show resolved Hide resolved
For some reason, clang-16 is not available anymore on debian testing.
Switching to clang 17 (available in both ubuntu 24.04 github runner
and debian testing) unblocks the build.

- Clang 19 was not available in ubuntu 24.04 github runner
- Clang 18 broke tests with kernels 4.19.314 and 5.4.276
AMD64:

perf_event/unwind_dotnet has 3463 instructions
perf_event/unwind_hotspot has 3266 instructions
tracepoint/sched/sched_switch has 1160 instructions
perf_event/unwind_stop has 445 instructions
perf_event/native_tracer_entry has 431 instructions
perf_event/unwind_native has 4002 instructions
perf_event/unwind_perl has 2585 instructions
perf_event/unwind_php has 2523 instructions
perf_event/unwind_python has 3654 instructions
perf_event/unwind_ruby has 2927 instructions
tracepoint/sched/sched_process_exit has 111 instructions
tracepoint/syscalls/sys_enter_bpf has 25 instructions
raw_tracepoint/sys_enter has 29 instructions
perf_event/unwind_v8 has 3312 instructions

Total instructions: 27933

ARM64:

I had to run `make agent TARGET_ARCH=arm64` twice:

```error: Invalid record (Producer: 'LLVM19.1.4' Reader: 'LLVM17.0.6')```
@mchataigner
Copy link
Contributor Author

mchataigner commented Dec 11, 2024

AMD64:

perf_event/unwind_dotnet has 3463 instructions
perf_event/unwind_hotspot has 3266 instructions
tracepoint/sched/sched_switch has 1160 instructions
perf_event/unwind_stop has 445 instructions
perf_event/native_tracer_entry has 431 instructions
perf_event/unwind_native has 4002 instructions
perf_event/unwind_perl has 2585 instructions
perf_event/unwind_php has 2523 instructions
perf_event/unwind_python has 3654 instructions
perf_event/unwind_ruby has 2927 instructions
tracepoint/sched/sched_process_exit has 111 instructions
tracepoint/syscalls/sys_enter_bpf has 25 instructions
raw_tracepoint/sys_enter has 29 instructions
perf_event/unwind_v8 has 3312 instructions

Total instructions: 27933

ARM64:

I had to run make agent TARGET_ARCH=arm64 twice:

error: Invalid record (Producer: 'LLVM19.1.4' Reader: 'LLVM17.0.6')

Copy link
Member

@christos68k christos68k Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now essentially an empty file so something went wrong on your end. I pushed a branch that has the ARM64 artifact compiled with clang-17 through the docker image. Feel free to copy it from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants