Skip to content

Commit

Permalink
ci: try bpftrace arm64 binary
Browse files Browse the repository at this point in the history
  • Loading branch information
theihor committed Feb 14, 2025
1 parent 264d14c commit 68bb92d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
24 changes: 8 additions & 16 deletions .github/scripts/install-bpftrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,19 @@
set -x -euo pipefail

BPFTRACE_VERSION=${BPFTRACE_VERSION:-0.22.1}
BUILD_BPFTRACE=${BUILD_BPFTRACE:-}

BIN_DIR=/usr/local/bin
sudo mkdir -p $BIN_DIR

if [[ -n "$BUILD_BPFTRACE" ]]; then
# see https://github.com/bpftrace/bpftrace/blob/master/docker/Dockerfile.ubuntu
sudo apt-get install -y \
asciidoctor binutils-dev bison build-essential clang cmake flex git libbpf-dev \
libbpfcc-dev libcereal-dev libelf-dev libiberty-dev libpcap-dev llvm-dev liblldb-dev \
libclang-dev systemtap-sdt-dev zlib1g-dev
git clone --depth 1 -b v${BPFTRACE_VERSION} https://github.com/bpftrace/bpftrace
cd bpftrace/src
cmake -B build -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=$(llvm-config --prefix)/lib/cmake/llvm
make -C build -j$(nproc)
cd -
sudo mv bpftrace/src/build/bpftrace $BIN_DIR/bpftrace
else # download AppImage
sudo curl -L -o $BIN_DIR/bpftrace https://github.com/bpftrace/bpftrace/releases/download/v${BPFTRACE_VERSION}/bpftrace
if [ $(uname -m) == "x86_64" ]; then
URL=https://github.com/bpftrace/bpftrace/releases/download/v${BPFTRACE_VERSION}/bpftrace
elif [ $(uname -m) == "aarch64" ]; then
URL=https://github.com/theihor/bpftrace/releases/download/v${BPFTRACE_VERSION}-arm64/bpftrace-arm64
else
echo "Unexpected arch: $(uname -m)"
exit 1
fi

sudo curl -L -o $BIN_DIR/bpftrace $URL
sudo chmod +x $BIN_DIR/bpftrace

# mount tracefs to avoid warnings from bpftrace
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [ 'ubuntu-latest' ]
runs-on: [ 'ubuntu-latest', 'ubuntu-24.04-arm' ]
shared: [ 0, 1 ]
compiler:
- { name: 'gcc', version: 11 }
Expand Down

0 comments on commit 68bb92d

Please sign in to comment.