From f86699a94bdde7d973ba5d6fa3e7ca4ab2f234fb Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 8 May 2026 19:43:33 +0300 Subject: add duration metric, tolerate missing tracepoints, ship el8 build - Bubbles, treemap, icicle, and the live flamegraph 'b' cycle now include syscall duration (sum) as a third metric alongside events and bytes. Statsengine snapshots expose TotalLatencyNs to support this. - AttachAll takes an optional warn callback. Production passes one so older kernels that lack newer tracepoints log a warning and keep going instead of aborting startup. - Dockerfile.el8 + scripts/build-with-docker-el8.sh + mage buildDockerEl8 produce ior.el8, a static binary built against Rocky Linux 8 glibc for RHEL/Rocky/Alma 8 hosts. - README.md documents installing mage and the new el8 target. --- scripts/build-with-docker-el8.sh | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 scripts/build-with-docker-el8.sh (limited to 'scripts') diff --git a/scripts/build-with-docker-el8.sh b/scripts/build-with-docker-el8.sh new file mode 100755 index 0000000..9ee35ba --- /dev/null +++ b/scripts/build-with-docker-el8.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# Build the ior binary inside a Rocky Linux 8 container and write it as +# ior.el8 to the repo root. The container image is built once and reused on +# subsequent runs. Mirrors scripts/build-with-docker.sh but targets Rocky 8 +# so the produced binary runs on hosts with the older glibc shipped there. +# +# Usage: +# ./build-with-docker-el8.sh # build image + compile ior.el8 +# ./build-with-docker-el8.sh --build # force rebuild of the Docker image +# ./build-with-docker-el8.sh --run # skip image build, only compile ior.el8 +set -euo pipefail + +IMAGE="ior-builder:rocky8" +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +DOCKERFILE="${REPO_ROOT}/Dockerfile.el8" + +# Derive the Go version from go.mod so the Docker image always matches the +# minimum toolchain declared by the project. +GO_VERSION="$(grep '^go ' "${REPO_ROOT}/go.mod" | awk '{print $2}')" + +BUILD_IMAGE=true +RUN_BUILD=true + +for arg in "$@"; do + case "$arg" in + --build) BUILD_IMAGE=true; RUN_BUILD=false ;; + --run) BUILD_IMAGE=false; RUN_BUILD=true ;; + esac +done + +if $BUILD_IMAGE; then + echo "==> Building Docker image ${IMAGE} (this takes ~15-20 min on first run)..." + docker build --platform=linux/amd64 \ + --build-arg "GO_VERSION=${GO_VERSION}" \ + -f "${DOCKERFILE}" \ + -t "${IMAGE}" \ + "${REPO_ROOT}" + echo "==> Image build complete." +fi + +if $RUN_BUILD; then + echo "==> Compiling ior.el8 inside the container..." + # --privileged gives full host capabilities. + # tracefs (/sys/kernel/tracing) and BTF (/sys/kernel/btf) are not auto-mounted + # by Docker even with --privileged, so they are mounted explicitly: + # - /sys/kernel/tracing : mage generate reads available syscall tracepoints + # - /sys/kernel/btf : mage bpfBuild reads vmlinux BTF for vmlinux.h + docker run --rm \ + --platform=linux/amd64 \ + --privileged \ + -v /sys/kernel/tracing:/sys/kernel/tracing \ + -v /sys/kernel/btf:/sys/kernel/btf \ + -v "${REPO_ROOT}:/git/ior" \ + "${IMAGE}" + echo "==> Done. Binary written to ${REPO_ROOT}/ior.el8" +fi -- cgit v1.2.3