From af55bc98b465c7881ea9357226fb944dba71b7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Tue, 6 Jan 2026 11:21:48 -0800 Subject: [PATCH 1/3] Clone pahole from GitHub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parallel downloads of pahole from git.kernel.org using HTTPS seems to be blocked randomly, rendering parallel vmlinux.h header generation flaky & unusable. Switch to cloning Arnaldo's mirror at https://github.com/acmel/dwarves, which doesn't pose this restriction. Signed-off-by: Daniel Müller --- .github/workflows/vmlinux.h.yml | 19 ++++++++++++++++++- scripts/install-pahole.sh | 22 ---------------------- 2 files changed, 18 insertions(+), 23 deletions(-) delete mode 100755 scripts/install-pahole.sh diff --git a/.github/workflows/vmlinux.h.yml b/.github/workflows/vmlinux.h.yml index bc38b73..960b930 100644 --- a/.github/workflows/vmlinux.h.yml +++ b/.github/workflows/vmlinux.h.yml @@ -24,11 +24,28 @@ jobs: fetch-depth: 1 path: linux/ + - name: Check out pahole source + uses: actions/checkout@v6 + with: + repository: 'acmel/dwarves' + ref: 'next' + fetch-depth: 1 + path: pahole/ + + - name: Install pahole + shell: bash + run: | + sudo apt -y install cmake git libdw-dev libelf-dev + cd pahole + mkdir -p build + cmake -B=build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr + make -C build -j$(nproc) + sudo make -C build install + - name: Install dependencies shell: bash run: | ./scripts/install-dependencies.sh - ./scripts/install-pahole.sh ./scripts/install-bpftool.sh - name: x86_64/vmlinux.h diff --git a/scripts/install-pahole.sh b/scripts/install-pahole.sh deleted file mode 100755 index ee62e4a..0000000 --- a/scripts/install-pahole.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -eux - -PAHOLE_ORIGIN=${PAHOLE_ORIGIN:-https://git.kernel.org/pub/scm/devel/pahole/pahole.git} -PAHOLE_REVISION=${PAHOLE_REVISION:-next} - -sudo apt -y install cmake git libdw-dev libelf-dev - -WORKSPACE=$(mktemp -d -t pahole.XXXXXX) -pushd "$WORKSPACE" -git clone ${PAHOLE_ORIGIN} \ - --branch "${PAHOLE_REVISION}" \ - --depth=1 \ - --single-branch -cd pahole -mkdir -p build -cmake -B=build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -make -C build -j$(nproc) -sudo make -C build install -popd -rm -rf "$WORKSPACE" From faaf6366b79a0b4aaf0e0aa463e4f73e0bba3e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Tue, 6 Jan 2026 10:09:38 -0800 Subject: [PATCH 2/3] Generate vmlinux.h headers in parallel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generate vmlinux.h headers for all supported architectures in parallel, by using dedicated jobs. Doing so speeds up the workflow from ~27min to ~6min. Signed-off-by: Daniel Müller --- .github/workflows/vmlinux.h.yml | 63 ++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/.github/workflows/vmlinux.h.yml b/.github/workflows/vmlinux.h.yml index 960b930..9a74e7c 100644 --- a/.github/workflows/vmlinux.h.yml +++ b/.github/workflows/vmlinux.h.yml @@ -9,8 +9,18 @@ on: jobs: gen-headers: - name: Generate vmlinux.h + name: Generate vmlinux.h (${{ matrix.arch }}) runs-on: ubuntu-latest + strategy: + matrix: + arch: + - x86_64 + - aarch64 + - arm + - loongarch64 + - ppc64le + - riscv64 + - s390x steps: @@ -48,35 +58,40 @@ jobs: ./scripts/install-dependencies.sh ./scripts/install-bpftool.sh - - name: x86_64/vmlinux.h + - name: Generate ${{ matrix.arch }}/vmlinux.h shell: bash - run: ./scripts/gen-vmlinux-header.sh x86_64 + run: ./scripts/gen-vmlinux-header.sh ${{ matrix.arch }} - - name: aarch64/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh aarch64 - - - name: arm/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh arm - - - name: loongarch64/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh loongarch64 + - name: Upload headers + uses: actions/upload-artifact@v4 + with: + name: vmlinux.h-${{ matrix.arch }} + if-no-files-found: error + path: ./vmlinux.h/${{ matrix.arch }} - - name: ppc64le/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh ppc64le + combine-headers: + name: Combine all vmlinux.h headers + runs-on: ubuntu-latest + needs: gen-headers - - name: riscv64/vmlinux.h - shell: bash - run: ./scripts/gen-vmlinux-header.sh riscv64 + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + pattern: vmlinux.h-* - - name: s390x/vmlinux.h + - name: Reorganize headers shell: bash - run: ./scripts/gen-vmlinux-header.sh s390x - - - name: Upload headers + run: | + mkdir -p vmlinux.h + for dir in vmlinux.h-*/; do + arch="${dir#vmlinux.h-}" + arch="${arch%/}" + mkdir -p "vmlinux.h/$arch" + mv "$dir"* "vmlinux.h/$arch/" + done + + - name: Upload combined headers uses: actions/upload-artifact@v4 with: name: vmlinux.h From 8075b45b705de4b0db96b2bfecea44dd86eec891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Tue, 6 Jan 2026 10:53:23 -0800 Subject: [PATCH 3/3] Check vmlinux.h header up-to-dateness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check that vmlinux.h headers in the repository are up-to-date with respect to the checked in config. Doing so should make it clear to pull request submitters that they should update headers after update of the config (or targeted kernel version or similar). We don't want to completely automate away the update, to have a human in the loop to double check sanity, e.g., for cases where config values get renamed. Signed-off-by: Daniel Müller --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/vmlinux.h.yml | 10 ++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73cfc53..9493046 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,3 +73,31 @@ jobs: EOF cargo update cargo check --tests + generate-headers: + name: Generate vmlinux.h headers + uses: ./.github/workflows/vmlinux.h.yml + check-headers: + name: Check headers are up to date + runs-on: ubuntu-latest + needs: generate-headers + steps: + - uses: actions/checkout@v4 + + - name: Download generated headers + uses: actions/download-artifact@v4 + with: + name: vmlinux.h + path: generated-headers + + - name: Copy headers to include/ directory + shell: bash + run: | + # Copy each vmlinux.h file to the corresponding include/ subdirectory + for dir in generated-headers/*/; do + arch=$(basename "$dir") + cp "$dir"vmlinux.h "include/$arch/" + done + + - name: Check for differences + run: git diff --exit-code || + (echo "!!!! CHECKED IN vmlinux.h HEADER IS OUTDATED !!!!" && false) diff --git a/.github/workflows/vmlinux.h.yml b/.github/workflows/vmlinux.h.yml index 9a74e7c..d383d05 100644 --- a/.github/workflows/vmlinux.h.yml +++ b/.github/workflows/vmlinux.h.yml @@ -6,6 +6,7 @@ on: branches: - main workflow_dispatch: + workflow_call: jobs: gen-headers: @@ -87,8 +88,13 @@ jobs: for dir in vmlinux.h-*/; do arch="${dir#vmlinux.h-}" arch="${arch%/}" - mkdir -p "vmlinux.h/$arch" - mv "$dir"* "vmlinux.h/$arch/" + # Map architecture names to match include/ directory structure + target_arch="$arch" + case "$arch" in + ppc64le) target_arch="powerpc" ;; + esac + mkdir -p "vmlinux.h/$target_arch" + mv "$dir"* "vmlinux.h/$target_arch/" done - name: Upload combined headers