Open minosfuture opened 1 week ago
So, I thought a bit about it and it seems like we just need to have per-arch vmlinux.h shipped in scx_utils
. @minosfuture, do you wanna take a stab at it?
@htejun, sure thing. But these files are quite large though. Do you mind clarifying why not to follow how bpftool generates vmlinux.h on the fly?
For a couple reasons:
cargo install scx_layered
and it won't need any external dependencies outside the toolchain).vmlinux.h
should track the latest regardless of the host that schedulers are being built on. e.g. backward compatibility macros in under include/scx
assume all the latest definitions.These two scripts might help you @minosfuture
This one, when ran from that directory (i.e. it needs the dockerfile/other script there) will generate a vmlinux.h from a commit hash, kernel git repo, and branch name: https://github.com/sched-ext/scx-backports/blob/35aacc4-1.0.5-d-fixes/backport-scripts/generate-backport-vmlinux.sh
In the event you don't want to deal with that dockerfile (cloning/building the kernel in docker while iterating is... painful), you can use the commands towards the end of this script to generate a vmlinux.h from a vmlinux:
@htejun @likewhatevs I submitted a PR #793 for this. Please review, thanks! I can also add another commit to include a simple script (similar to what @likewhatevs had) into the repo, if that'll be useful.
A compile issue that it is unable to find the definition of
struct user_pt_regs
when compilingscx_rlfifo
andscx_rustland
(they use BPF_KPROBE and thus requiresuser_pt_regs
).struct user_pt_regs
indeed is not included inscheds/include/vmlinux/vmlinux.h
.Regenerating
vmlinux.h
from the linux upstream88264981f20
can solve the problem.This is likely an issue only on aarch64. Generating vmlinux.h during compilation, as bpftool repo does, may be a solution.
Log:
environment: