Skip to content

Cross compile tools for ARM (aarch64) #394

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

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

Conversation

echiugoog
Copy link
Contributor

Cross compile supporting toolchain (where possible)
For perf, I bumped up the version to get a newer version of perf that supports Neoverse V2 cores

processwatch has ARM support, but we can't crosscompile right now as we need an ARM kernel to do the btf dump
e.g.

src/bpf/insn/build.sh
${BPFTOOL} btf dump file /sys/kernel/btf/vmlinux format c > ${DIR}/vmlinux.h

Did a basic perf test on a Neoverse V2 guest to validate perf:

$ sudo ./perf stat -- sleep 1

 Performance counter stats for 'sleep 1':

              0.53 msec task-clock                       #    0.001 CPUs utilized
                 2      context-switches                 #    3.784 K/sec
                 0      cpu-migrations                   #    0.000 /sec
                65      page-faults                      #  122.975 K/sec
           1547407      instructions                     #    1.10  insn per cycle
                                                  #    0.34  stalled cycles per insn
           1412410      cycles                           #    2.672 GHz
            504472      stalled-cycles-frontend          #   35.72% frontend cycles idle
            519564      stalled-cycles-backend           #   36.79% backend cycles idle
              8354      branch-misses

@echiugoog echiugoog requested a review from harp-intel as a code owner June 26, 2025 18:40
Copy link
Contributor

@harp-intel harp-intel left a comment

Choose a reason for hiding this comment

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

Looks awesome. One issue with where to get the aarch64 binaries when building with the container.

@@ -24,6 +24,7 @@ perfspect:
.PHONY: resources
resources:
mkdir -p internal/script/resources/x86_64
mkdir -p internal/script/resources/aarch64
ifneq ("$(wildcard /prebuilt/tools)","") # /prebuilt/tools is a directory in the container
cp -r /prebuilt/tools/* internal/script/resources/x86_64
Copy link
Contributor

Choose a reason for hiding this comment

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

When building through the build.sh script, and associated containers, tools should come from the "prebuilt" folder.

cp -r /prebuilt/tools/bin-aarch64/* internal/script/resources/aarch64

Does that make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm running into this and some other issues as I work to cross compile and package perfspect. I'll pull the commits into this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Please limit commits to those necessary for building the tools and the perfspect binary, i.e., not the enablement of collecting metrics on ARM. Leave that for a second PR. Thanks.

@harp-intel
Copy link
Contributor

Too bad turbostat is x86 only. It's really useful for telemetry.

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.

2 participants