mirror of
https://github.com/masonr/yet-another-bench-script.git
synced 2026-11-07 08:22:53 +08:00
Compare commits
4 Commits
iperf3-3.2
...
96f102f8d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96f102f8d0 | ||
|
|
0e9a967115 | ||
|
|
d83b3c7009 | ||
|
|
6a25c5bc6e |
25
.github/workflows/build-fio.yml
vendored
25
.github/workflows/build-fio.yml
vendored
@@ -2,6 +2,11 @@ name: Build fio Static Binaries
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
force:
|
||||
description: 'Rebuild even if a release for the latest upstream version already exists (e.g. to add a new architecture)'
|
||||
type: boolean
|
||||
default: false
|
||||
schedule:
|
||||
# check upstream for a new fio release once a day
|
||||
- cron: '23 5 * * *'
|
||||
@@ -36,8 +41,15 @@ jobs:
|
||||
# Check if this version already exists in our releases (upstream tag is
|
||||
# already prefixed, e.g. "fio-3.41", so it can be used as-is)
|
||||
if gh release view "$VERSION" --repo ${{ github.repository }} >/dev/null 2>&1; then
|
||||
echo "Version $VERSION already exists in releases"
|
||||
echo "should-build=false" >> $GITHUB_OUTPUT
|
||||
# an existing release normally skips the build, but a manual dispatch with
|
||||
# force=true rebuilds anyway (e.g. to add a new architecture to the assets)
|
||||
if [ "${{ inputs.force }}" = "true" ]; then
|
||||
echo "Version $VERSION already exists but force rebuild requested"
|
||||
echo "should-build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Version $VERSION already exists in releases"
|
||||
echo "should-build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "Version $VERSION does not exist, should build"
|
||||
echo "should-build=true" >> $GITHUB_OUTPUT
|
||||
@@ -65,6 +77,9 @@ jobs:
|
||||
- arch: arm
|
||||
cross: arm-linux-musleabihf
|
||||
host: arm-linux-gnueabihf
|
||||
- arch: riscv64
|
||||
cross: riscv64-linux-musl
|
||||
host: riscv64-linux-gnu
|
||||
|
||||
steps:
|
||||
- name: Create compilation script
|
||||
@@ -113,8 +128,9 @@ jobs:
|
||||
# redefines struct prctl_mm_map under musl; sys/prctl.h alone is sufficient
|
||||
sed -i '/#include <linux\/prctl.h>/d' backend.c
|
||||
CC=/root/$CROSS-cross/bin/$CROSS-gcc ./configure --disable-native --build-static
|
||||
# link against libatomic for 32-bit/ARM targets that lack native 64-bit atomics
|
||||
make EXTLIBS+=' -latomic'
|
||||
# link against libatomic for 32-bit/ARM targets that lack native 64-bit atomics; -no-pie forces a
|
||||
# classic static executable on default-PIE toolchains (riscv64), where a static-PIE fails to link
|
||||
make EXTLIBS+=' -latomic -no-pie'
|
||||
|
||||
# verify no external shared library links
|
||||
libcheck fio
|
||||
@@ -326,6 +342,7 @@ jobs:
|
||||
- `fio_x86` - i686 (32-bit)
|
||||
- `fio_aarch64` - ARM 64-bit
|
||||
- `fio_arm` - ARM 32-bit
|
||||
- `fio_riscv64` - RISC-V 64-bit
|
||||
|
||||
**Security Verification:**
|
||||
All binaries have been scanned by VirusTotal and verified clean.
|
||||
|
||||
24
.github/workflows/build-iperf3.yml
vendored
24
.github/workflows/build-iperf3.yml
vendored
@@ -2,6 +2,11 @@ name: Build iperf3 Static Binaries
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
force:
|
||||
description: 'Rebuild even if a release for the latest upstream version already exists (e.g. to add a new architecture)'
|
||||
type: boolean
|
||||
default: false
|
||||
schedule:
|
||||
# check upstream for a new iperf3 release once a day
|
||||
- cron: '47 5 * * *'
|
||||
@@ -35,8 +40,15 @@ jobs:
|
||||
|
||||
# Check if this version already exists in our releases
|
||||
if gh release view "iperf3-$VERSION" --repo ${{ github.repository }} >/dev/null 2>&1; then
|
||||
echo "Version $VERSION already exists in releases"
|
||||
echo "should-build=false" >> $GITHUB_OUTPUT
|
||||
# an existing release normally skips the build, but a manual dispatch with
|
||||
# force=true rebuilds anyway (e.g. to add a new architecture to the assets)
|
||||
if [ "${{ inputs.force }}" = "true" ]; then
|
||||
echo "Version $VERSION already exists but force rebuild requested"
|
||||
echo "should-build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Version $VERSION already exists in releases"
|
||||
echo "should-build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "Version $VERSION does not exist, should build"
|
||||
echo "should-build=true" >> $GITHUB_OUTPUT
|
||||
@@ -67,6 +79,9 @@ jobs:
|
||||
- arch: arm
|
||||
cross: arm-linux-musleabihf
|
||||
host: arm-linux-gnueabihf
|
||||
- arch: riscv64
|
||||
cross: riscv64-linux-musl
|
||||
host: riscv64-linux-gnu
|
||||
|
||||
steps:
|
||||
- name: Create compilation script
|
||||
@@ -104,7 +119,9 @@ jobs:
|
||||
curl -L -4 --retry 5 --retry-delay 2 --connect-timeout 15 "https://github.com/esnet/iperf/archive/$VERSION.tar.gz" -o "iperf.tar.gz"
|
||||
tar xf iperf.tar.gz
|
||||
cd iperf-*
|
||||
CC=/root/$CROSS-cross/bin/$CROSS-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "$HOST" --with-openssl=no --enable-static-bin
|
||||
# -no-pie must be set via LDFLAGS at configure time (passing it to make overrides automake's LDFLAGS and
|
||||
# drops --static); on default-PIE toolchains (riscv64) a static-PIE iperf3 links but segfaults at runtime
|
||||
LDFLAGS="${LDFLAGS} -no-pie" CC=/root/$CROSS-cross/bin/$CROSS-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "$HOST" --with-openssl=no --enable-static-bin
|
||||
# remove libatomic.la so libtool links the static libatomic.a rather than
|
||||
# attempting to link libatomic.so into the static binary (breaks arm32 builds)
|
||||
rm -f /root/$CROSS-cross/$CROSS/lib/libatomic.la
|
||||
@@ -349,6 +366,7 @@ jobs:
|
||||
- `iperf3_x86` - i686 (32-bit)
|
||||
- `iperf3_aarch64` - ARM 64-bit
|
||||
- `iperf3_arm` - ARM 32-bit (if available)
|
||||
- `iperf3_riscv64` - RISC-V 64-bit
|
||||
|
||||
${{ steps.check-arm.outputs.arm-note }}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ repository** - they are built automatically by GitHub Actions workflows
|
||||
[build-iperf3.yml](../.github/workflows/build-iperf3.yml)) on GitHub-hosted
|
||||
runners and published as release assets on this repository:
|
||||
|
||||
* `fio-*` releases (e.g. `fio-3.42`) - contain `fio_x64`, `fio_x86`, `fio_aarch64`, `fio_arm`
|
||||
* `iperf3-*` releases (e.g. `iperf3-3.21`) - contain `iperf3_x64`, `iperf3_x86`, `iperf3_aarch64`, `iperf3_arm`
|
||||
* `fio-*` releases (e.g. `fio-3.42`) - contain `fio_x64`, `fio_x86`, `fio_aarch64`, `fio_arm`, `fio_riscv64`
|
||||
* `iperf3-*` releases (e.g. `iperf3-3.21`) - contain `iperf3_x64`, `iperf3_x86`, `iperf3_aarch64`, `iperf3_arm`, `iperf3_riscv64`
|
||||
* `toolchains` release - musl cross-compilation toolchains mirrored from
|
||||
[musl.cc](https://musl.cc/) (which blocks GitHub Actions IP ranges); see the
|
||||
NOTICE.txt asset for licensing/source info
|
||||
@@ -33,7 +33,7 @@ issue if the binaries are out of date and lacking any security-related and/or
|
||||
performance updates - the daily scheduled workflows should pick up new upstream
|
||||
releases automatically.
|
||||
|
||||
Note: ARM compatibility is considered experimental.
|
||||
Note: ARM and RISC-V compatibility is considered experimental.
|
||||
|
||||
### Compile Notes (manual builds)
|
||||
|
||||
@@ -57,6 +57,10 @@ Compilation of 32-bit and ARM-compatible binaries requires additional
|
||||
environment variables to identify the proper musl toolchain and architecture to
|
||||
target for cross-compilation.
|
||||
|
||||
The musl.cc riscv64 toolchain is default-PIE, so the scripts pass `-no-pie` to
|
||||
produce classic static executables (a static-PIE fio fails to link, and a
|
||||
static-PIE iperf3 links but segfaults at runtime).
|
||||
|
||||
**Compiling 32-bit x86 binaries**:
|
||||
|
||||
```sh
|
||||
@@ -74,3 +78,9 @@ docker run -t -i --rm -v `pwd`:/io --env ARCH=aarch64 --env CROSS=aarch64-linux-
|
||||
```sh
|
||||
docker run -t -i --rm -v `pwd`:/io --env ARCH=arm --env CROSS=arm-linux-musleabihf --env HOST=arm-linux-gnueabihf phusion/holy-build-box-64:latest bash /io/cross-compile.sh
|
||||
```
|
||||
|
||||
**Compiling RISC-V 64-bit binaries**:
|
||||
|
||||
```sh
|
||||
docker run -t -i --rm -v `pwd`:/io --env ARCH=riscv64 --env CROSS=riscv64-linux-musl --env HOST=riscv64-linux-gnu phusion/holy-build-box-64:latest bash /io/cross-compile.sh
|
||||
```
|
||||
|
||||
@@ -39,8 +39,9 @@ cd fio-fio-*
|
||||
# conflicts under musl; sys/prctl.h alone is sufficient
|
||||
sed -i '/#include <linux\/prctl.h>/d' backend.c
|
||||
CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-native --build-static
|
||||
# link against libatomic for 32-bit/ARM targets that lack native 64-bit atomics
|
||||
make EXTLIBS+=' -latomic'
|
||||
# link against libatomic for 32-bit/ARM targets that lack native 64-bit atomics; -no-pie forces a
|
||||
# classic static executable on default-PIE toolchains (riscv64), where a static-PIE fails to link
|
||||
make EXTLIBS+=' -latomic -no-pie'
|
||||
|
||||
# verify no external shared library links
|
||||
libcheck fio
|
||||
@@ -52,7 +53,9 @@ cd ~
|
||||
curl -L https://github.com/esnet/iperf/archive/3.21.tar.gz -o "iperf.tar.gz"
|
||||
tar xf iperf.tar.gz
|
||||
cd iperf-*
|
||||
CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "${HOST}" --with-openssl=no --enable-static-bin
|
||||
# -no-pie must be set via LDFLAGS at configure time (passing it to make overrides automake's LDFLAGS and
|
||||
# drops --static); on default-PIE toolchains (riscv64) a static-PIE iperf3 links but segfaults at runtime
|
||||
LDFLAGS="${LDFLAGS} -no-pie" CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-shared --disable-profiling --build x86_64-pc-linux-gnu --host "${HOST}" --with-openssl=no --enable-static-bin
|
||||
# remove libatomic.la so libtool links the static libatomic.a rather than
|
||||
# attempting to link libatomic.so into the static binary (breaks arm32 builds)
|
||||
rm -f "/root/${CROSS}-cross/${CROSS}/lib/libatomic.la"
|
||||
|
||||
40
yabs.sh
40
yabs.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Yet Another Bench Script by Mason Rowe
|
||||
# Initial Oct 2019; Last update Sep 2026
|
||||
# Initial Oct 2019; Last update Oct 2026
|
||||
|
||||
# Disclaimer: This project is a work in progress. Any errors or suggestions should be
|
||||
# relayed to me via the GitHub project page linked below.
|
||||
@@ -12,7 +12,7 @@
|
||||
# performance via fio. The script is designed to not require any dependencies
|
||||
# - either compiled or installed - nor admin privileges to run.
|
||||
|
||||
YABS_VERSION="v2026-09-20"
|
||||
YABS_VERSION="v2026-10-30"
|
||||
|
||||
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
||||
echo -e '# Yet-Another-Bench-Script #'
|
||||
@@ -113,6 +113,12 @@ else
|
||||
unset LOCAL_CURL
|
||||
fi
|
||||
|
||||
# check for tar (required to extract the Geekbench tarball)
|
||||
if command -v tar >/dev/null 2>&1; then
|
||||
LOCAL_TAR=true
|
||||
else
|
||||
unset LOCAL_TAR
|
||||
fi
|
||||
|
||||
# test if the host has IPv4/IPv6 connectivity
|
||||
[[ -n $LOCAL_CURL ]] && IP_CHECK_CMD="curl -s -m 4" || IP_CHECK_CMD="wget -qO- -T 4"
|
||||
@@ -177,6 +183,8 @@ if [ -n "$PRINT_HELP" ]; then
|
||||
([[ -z $LOCAL_IPERF ]] && echo -e " iperf3 not detected, will download precompiled binary") ||
|
||||
([[ -z $PREFER_BIN ]] && echo -e " iperf3 detected, using local package") ||
|
||||
echo -e " iperf3 detected, but using precompiled binary instead"
|
||||
[[ -n $LOCAL_TAR ]] && echo -e " tar detected, required to extract geekbench" ||
|
||||
echo -e " tar not detected, geekbench test will be skipped (install tar)"
|
||||
echo -e
|
||||
echo -e "Detected Connectivity:"
|
||||
[[ -n $IPV4_CHECK ]] && echo -e " IPv4 connected" ||
|
||||
@@ -288,8 +296,18 @@ echo -e "RAM : $TOTAL_RAM"
|
||||
TOTAL_SWAP_RAW=$(free | grep Swap | awk '{ print $2 }')
|
||||
TOTAL_SWAP=$(format_size "$TOTAL_SWAP_RAW")
|
||||
echo -e "Swap : $TOTAL_SWAP"
|
||||
# total disk size is calculated by adding all partitions of the types listed below (after the -t flags)
|
||||
TOTAL_DISK_RAW=$(df -t simfs -t ext2 -t ext3 -t ext4 -t btrfs -t xfs -t vfat -t exfat -t ntfs -t swap --total 2>/dev/null | grep total | awk '{ print $2 }')
|
||||
# total disk size is calculated by adding all mounted filesystems of the types listed below, counting each
|
||||
# source device only once so filesystems mounted multiple times (e.g. btrfs subvolumes, bind mounts) are
|
||||
# not double counted; only filtered mounts are stat'd so network mounts (nfs/cifs) are never touched
|
||||
DISK_FS_TYPES="simfs ext2 ext3 ext4 btrfs xfs vfat exfat ntfs swap"
|
||||
TOTAL_DISK_RAW=$(while read -r FS_SRC FS_MNT FS_TYPE _; do
|
||||
case " $DISK_FS_TYPES " in *" $FS_TYPE "*)
|
||||
# mount points are octal-escaped in /proc/mounts (e.g. "\040" for spaces), decode before use
|
||||
echo "$FS_SRC $(stat -f -c '%b %S' "$(printf '%b' "$FS_MNT")" 2>/dev/null)" ;;
|
||||
esac
|
||||
done 2>/dev/null < /proc/mounts | awk 'NF == 3 && !seen[$1]++ { total += $2 * $3 / 1024 } END { if (total > 0) printf "%d\n", total }')
|
||||
# fall back to the df-based calculation if the above produced nothing (e.g. stat or /proc/mounts unavailable)
|
||||
[[ -z $TOTAL_DISK_RAW ]] && TOTAL_DISK_RAW=$(df -t simfs -t ext2 -t ext3 -t ext4 -t btrfs -t xfs -t vfat -t exfat -t ntfs -t swap --total 2>/dev/null | grep total | awk '{ print $2 }')
|
||||
TOTAL_DISK=$(format_size "$TOTAL_DISK_RAW")
|
||||
echo -e "Disk : $TOTAL_DISK"
|
||||
DISTRO=$(grep 'PRETTY_NAME' /etc/os-release | cut -d '"' -f 2 )
|
||||
@@ -992,19 +1010,23 @@ function launch_geekbench {
|
||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-5.5.1-Linux.tar.gz"
|
||||
GB_CMD="geekbench5"
|
||||
elif [[ $VERSION == *6* ]]; then # Geekbench v6
|
||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-6.7.1-LinuxARMPreview.tar.gz" \
|
||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-6.7.1-Linux.tar.gz"
|
||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-6.7.2-LinuxARMPreview.tar.gz" \
|
||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-6.7.2-Linux.tar.gz"
|
||||
GB_CMD="geekbench6"
|
||||
else # Geekbench v7
|
||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-7.0.0-LinuxARMPreview.tar.gz" \
|
||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-7.0.0-Linux.tar.gz"
|
||||
[[ $ARCH = *aarch64* || $ARCH = *arm* ]] && GB_URL="https://cdn.geekbench.com/Geekbench-7.1.0-LinuxARMPreview.tar.gz" \
|
||||
|| GB_URL="https://cdn.geekbench.com/Geekbench-7.1.0-Linux.tar.gz"
|
||||
GB_CMD="geekbench7"
|
||||
fi
|
||||
GB_RUN="True"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $GB_RUN == *True* ]]; then # run GB test
|
||||
if [[ $GB_RUN == *True* ]] && [[ -z $LOCAL_TAR ]] && ! command -v "$GB_CMD" &>/dev/null; then
|
||||
# tar is needed to extract the downloaded Geekbench tarball (missing on e.g. AlmaLinux 9 minimal)
|
||||
echo -e "\nGeekbench $VERSION requires tar to extract the download, but tar was not found."
|
||||
echo -e "Install tar (e.g. 'dnf install tar' or 'apt install tar') and re-run. Skipping Geekbench $VERSION."
|
||||
elif [[ $GB_RUN == *True* ]]; then # run GB test
|
||||
echo -en "\nRunning GB$VERSION benchmark test... *cue elevator music*"
|
||||
|
||||
# check for local geekbench installed
|
||||
|
||||
Reference in New Issue
Block a user