Skip to content

Commit 308e050

Browse files
committed
Implement veristat-scx job
veristat-scx job does the following: * run: libbpf/ci/build-scx-scheds action [1] to produce sched-ext [2] BPF binaries * run veristat on those binaries against the target kernel [1] https://github.com/libbpf/ci/tree/main/build-scx-scheds [2] https://github.com/sched-ext/scx Signed-off-by: Ihor Solodrai <isolodrai@meta.com>
1 parent 3881580 commit 308e050

File tree

6 files changed

+135
-2
lines changed

6 files changed

+135
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
PROGS_DIR=$1
6+
7+
mkdir -p "${PROGS_DIR}"
8+
9+
find "${SCX_BUILD_OUTPUT}" -type f -name "bpf.bpf.o" -print0 | \
10+
while IFS= read -r -d '' prog; do
11+
obj_name=$(echo "$prog" | grep -o "scx.*.bpf.o" | tr / _)
12+
cp -v "$prog" "${PROGS_DIR}/${obj_name}"
13+
done

.github/workflows/kernel-build-test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ jobs:
137137
secrets:
138138
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
139139

140+
veristat-scx:
141+
if: ${{ inputs.run_veristat }}
142+
uses: ./.github/workflows/veristat-scx.yml
143+
needs: [build]
144+
permissions:
145+
id-token: write
146+
contents: read
147+
with:
148+
arch: ${{ inputs.arch }}
149+
toolchain_full: ${{ inputs.toolchain_full }}
150+
runs_on: ${{ inputs.runs_on }}
151+
llvm_version: ${{ inputs.llvm_version }}
152+
140153
gcc-bpf:
141154
name: 'GCC BPF'
142155
if: ${{ inputs.arch == 'x86_64' }}

.github/workflows/veristat-kernel.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
KBUILD_OUTPUT: kbuild-output/
3232
ARCH_AND_TOOL: ${{ inputs.arch }}-${{ inputs.toolchain_full }}
3333
VERISTAT_DUMP_LOG_ON_FAILURE: 'true'
34+
VERISTAT_TARGET: kernel
3435

3536
steps:
3637

@@ -55,7 +56,7 @@ jobs:
5556
vmlinuz: '${{ github.workspace }}/vmlinuz'
5657
kernel-root: '.'
5758
max-cpu: 8
58-
kernel-test: 'run_veristat_kernel'
59+
kernel-test: 'run_veristat'
5960
output-dir: '${{ github.workspace }}'
6061

6162
- name: Compare and save veristat.kernel.csv

.github/workflows/veristat-meta.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
REPO_PATH: ""
3939
KBUILD_OUTPUT: kbuild-output/
4040
ARCH_AND_TOOL: ${{ inputs.arch }}-${{ inputs.toolchain_full }}
41+
VERISTAT_TARGET: meta
4142

4243
steps:
4344

@@ -76,7 +77,7 @@ jobs:
7677
vmlinuz: '${{ github.workspace }}/vmlinuz'
7778
kernel-root: '.'
7879
max-cpu: 8
79-
kernel-test: 'run_veristat_meta'
80+
kernel-test: 'run_veristat'
8081
output-dir: '${{ github.workspace }}'
8182

8283
- name: Compare and save veristat.meta.csv

.github/workflows/veristat-scx.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: veristat_kernel
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
arch:
7+
required: true
8+
type: string
9+
description: The architecture to build against, e.g x86_64, aarch64, s390x...
10+
toolchain_full:
11+
required: true
12+
type: string
13+
description: Toolchain identifier, such as llvm-20
14+
runs_on:
15+
required: true
16+
type: string
17+
description: The runners to run the test on. This is a json string representing an array of labels.
18+
llvm_version:
19+
required: true
20+
type: string
21+
22+
jobs:
23+
24+
build-scheds:
25+
name: build sched-ext/scx
26+
runs-on: ${{ fromJSON(inputs.runs_on) }}
27+
env:
28+
LLVM_VERSION: ${{ inputs.llvm_version }}
29+
SCX_BUILD_OUTPUT: ${{ github.workspace }}/scx-build-output
30+
SCX_PROGS: ${{ github.workspace }}/scx-progs
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
sparse-checkout: |
35+
.github
36+
ci
37+
- uses: libbpf/ci/build-scx-scheds@v3
38+
with:
39+
output-dir: ${{ env.SCX_BUILD_OUTPUT }}
40+
- name: Collect scx progs
41+
run: ${{ github.workspace }}/.github/scripts/collect-scx-bpf-progs.sh ${{ env.SCX_PROGS }}
42+
- name: Upload scx progs
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: scx-progs-${{ inputs.arch }}-${{ inputs.toolchain_full }}
46+
if-no-files-found: error
47+
path: ${{ env.SCX_PROGS }}
48+
49+
veristat:
50+
name: veristat-scx
51+
runs-on: ${{ fromJSON(inputs.runs_on) }}
52+
needs: [build-scheds]
53+
permissions:
54+
id-token: write
55+
contents: read
56+
env:
57+
KERNEL: LATEST
58+
REPO_ROOT: ${{ github.workspace }}
59+
REPO_PATH: ""
60+
KBUILD_OUTPUT: kbuild-output/
61+
ARCH_AND_TOOL: ${{ inputs.arch }}-${{ inputs.toolchain_full }}
62+
VERISTAT_DUMP_LOG_ON_FAILURE: 'true'
63+
VERISTAT_TARGET: scx
64+
SCX_PROGS: ${{ github.workspace }}/scx-progs
65+
66+
steps:
67+
68+
- uses: actions/checkout@v4
69+
with:
70+
sparse-checkout: |
71+
.github
72+
ci
73+
74+
- name: Download kernel build artifacts
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: vmlinux-${{ env.ARCH_AND_TOOL }}
78+
path: .
79+
80+
- name: Untar kernel build artifacts
81+
run: zstd -d -T0 vmlinux-${{ env.ARCH_AND_TOOL }}.tar.zst --stdout | tar -xf -
82+
83+
- name: Download scx progs
84+
uses: actions/download-artifact@v4
85+
with:
86+
name: scx-progs-${{ inputs.arch }}-${{ inputs.toolchain_full }}
87+
path: ${{ env.SCX_PROGS }}
88+
89+
- name: Run veristat
90+
uses: libbpf/ci/run-vmtest@v3
91+
with:
92+
arch: x86_64
93+
vmlinuz: '${{ github.workspace }}/vmlinuz'
94+
kernel-root: '.'
95+
kernel-test: 'run_veristat'
96+
output-dir: '${{ github.workspace }}'
97+
98+
- name: Compare and save veristat.scx.csv
99+
uses: ./.github/actions/veristat_baseline_compare
100+
with:
101+
veristat_output: veristat-scx
102+
baseline_name: ${{ env.ARCH_AND_TOOL}}-baseline-veristat-scx
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VERISTAT_OBJECTS_DIR="${SCX_PROGS}"
2+
VERISTAT_OBJECTS_GLOB="*.bpf.o"
3+
VERISTAT_OUTPUT="veristat-scx"

0 commit comments

Comments
 (0)