Skip to content

Commit f19f57b

Browse files
Merge branch 'libbpf:main' into add-config-ftrace
2 parents e3449b4 + 75bb40a commit f19f57b

4 files changed

Lines changed: 96 additions & 65 deletions

File tree

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,31 @@ jobs:
7373
EOF
7474
cargo update
7575
cargo check --tests
76+
generate-headers:
77+
name: Generate vmlinux.h headers
78+
uses: ./.github/workflows/vmlinux.h.yml
79+
check-headers:
80+
name: Check headers are up to date
81+
runs-on: ubuntu-latest
82+
needs: generate-headers
83+
steps:
84+
- uses: actions/checkout@v4
85+
86+
- name: Download generated headers
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: vmlinux.h
90+
path: generated-headers
91+
92+
- name: Copy headers to include/ directory
93+
shell: bash
94+
run: |
95+
# Copy each vmlinux.h file to the corresponding include/ subdirectory
96+
for dir in generated-headers/*/; do
97+
arch=$(basename "$dir")
98+
cp "$dir"vmlinux.h "include/$arch/"
99+
done
100+
101+
- name: Check for differences
102+
run: git diff --exit-code ||
103+
(echo "!!!! CHECKED IN vmlinux.h HEADER IS OUTDATED !!!!" && false)

.github/workflows/vmlinux.h.yml

Lines changed: 68 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,98 @@ on:
66
branches:
77
- main
88
workflow_dispatch:
9+
workflow_call:
910

1011
jobs:
1112
gen-headers:
12-
name: Generate vmlinux.h
13+
name: Generate vmlinux.h (${{ matrix.arch }})
1314
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
arch:
18+
- x86_64
19+
- aarch64
20+
- arm
21+
- loongarch64
22+
- ppc64le
23+
- riscv64
24+
- s390x
1425

1526
steps:
1627

1728
- uses: actions/checkout@v4
1829

19-
- name: Download Linux source
30+
- name: Check out Linux source
31+
uses: actions/checkout@v6
32+
with:
33+
repository: 'torvalds/linux'
34+
ref: 'v6.18'
35+
fetch-depth: 1
36+
path: linux/
37+
38+
- name: Check out pahole source
39+
uses: actions/checkout@v6
40+
with:
41+
repository: 'acmel/dwarves'
42+
ref: 'next'
43+
fetch-depth: 1
44+
path: pahole/
45+
46+
- name: Install pahole
2047
shell: bash
21-
run: ./scripts/download-latest-linux-release.sh
48+
run: |
49+
sudo apt -y install cmake git libdw-dev libelf-dev
50+
cd pahole
51+
mkdir -p build
52+
cmake -B=build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
53+
make -C build -j$(nproc)
54+
sudo make -C build install
2255
2356
- name: Install dependencies
2457
shell: bash
2558
run: |
2659
./scripts/install-dependencies.sh
27-
./scripts/install-pahole.sh
2860
./scripts/install-bpftool.sh
2961
30-
- name: x86_64/vmlinux.h
62+
- name: Generate ${{ matrix.arch }}/vmlinux.h
3163
shell: bash
32-
run: ./scripts/gen-vmlinux-header.sh x86_64
64+
run: ./scripts/gen-vmlinux-header.sh ${{ matrix.arch }}
3365

34-
- name: aarch64/vmlinux.h
35-
shell: bash
36-
run: ./scripts/gen-vmlinux-header.sh aarch64
37-
38-
- name: arm/vmlinux.h
39-
shell: bash
40-
run: ./scripts/gen-vmlinux-header.sh arm
41-
42-
- name: loongarch64/vmlinux.h
43-
shell: bash
44-
run: ./scripts/gen-vmlinux-header.sh loongarch64
66+
- name: Upload headers
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: vmlinux.h-${{ matrix.arch }}
70+
if-no-files-found: error
71+
path: ./vmlinux.h/${{ matrix.arch }}
4572

46-
- name: ppc64le/vmlinux.h
47-
shell: bash
48-
run: ./scripts/gen-vmlinux-header.sh ppc64le
73+
combine-headers:
74+
name: Combine all vmlinux.h headers
75+
runs-on: ubuntu-latest
76+
needs: gen-headers
4977

50-
- name: riscv64/vmlinux.h
51-
shell: bash
52-
run: ./scripts/gen-vmlinux-header.sh riscv64
78+
steps:
79+
- name: Download all artifacts
80+
uses: actions/download-artifact@v4
81+
with:
82+
pattern: vmlinux.h-*
5383

54-
- name: s390x/vmlinux.h
84+
- name: Reorganize headers
5585
shell: bash
56-
run: ./scripts/gen-vmlinux-header.sh s390x
86+
run: |
87+
mkdir -p vmlinux.h
88+
for dir in vmlinux.h-*/; do
89+
arch="${dir#vmlinux.h-}"
90+
arch="${arch%/}"
91+
# Map architecture names to match include/ directory structure
92+
target_arch="$arch"
93+
case "$arch" in
94+
ppc64le) target_arch="powerpc" ;;
95+
esac
96+
mkdir -p "vmlinux.h/$target_arch"
97+
mv "$dir"* "vmlinux.h/$target_arch/"
98+
done
5799
58-
- name: Upload headers
100+
- name: Upload combined headers
59101
uses: actions/upload-artifact@v4
60102
with:
61103
name: vmlinux.h

scripts/download-latest-linux-release.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

scripts/install-pahole.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)