Skip to main content

Crate scx_rustsched_build

Crate scx_rustsched_build 

Source
Expand description

Build script support for a Rust BPF sched_ext scheduler: build its no_std BPF crate for the BPF target with the toolchain that builds the scheduler, and add to each object’s BTF what the Rust toolchain does not emit. A scheduler’s build.rs fills a Spec and calls build().

Re-exports§

pub(crate) use env; 🔒
pub(crate) use env; 🔒
pub(crate) use ffi::CString; 🔒
pub(crate) use fs; 🔒
pub(crate) use path::PathBuf; 🔒
pub(crate) use process::Command; 🔒
pub(crate) use libbpf_rs::libbpf_sys; 🔒

Modules§

catalog 🔒

Macros§

kfuncs
Expand a kfunc catalog, see scx_rustsched’s kfuncs.rs, into a kfuncs() function listing it for Spec.

Structs§

Kfunc
A kfunc of the catalog in scx_rustsched’s kfuncs.rs: its name, parameters and return type, whether a kernel may lack it, and whether it takes a trailing size parameter on kernels that pass the structure’s size.
Spec
What a Rust BPF scheduler hands the build: where its BPF crate is, what it calls and reads from the kernel, and the object variants to build.

Enums§

Ty
The parameter and return types the catalog names, see the BPF side’s aliases in scx_rustsched’s src/kfuncs.rs.

Constants§

KSYM_DOMAIN_POINTER
KSYM_INT
The kinds of per-CPU kernel variables, see Spec: an int, a struct sched_domain pointer or a struct rq.
KSYM_RQ
RUNTIME_KSYMS
The per-CPU kernel variables scx_rustsched reads.

Functions§

add_btf 🔒
Add to the BTF of object what the Rust toolchain does not emit: the kfuncs’ prototypes and .ksyms entries, the ksym variables, and the arg:trusted tags, and replace the object’s .BTF section with it.
build
Build the BPF crate of spec for each of its variants, with the toolchain that builds the scheduler or the rustup toolchain BPF_RUST_TOOLCHAIN names, and patch each object’s BTF.
build_default
Build the BPF crate in bpf/ beside the build script, for a scheduler that calls and reads nothing from the kernel but through scx_rustsched: the runtime’s kfuncs, kernel variables and global functions, and an object for each kind of kernel. The whole build script of such a scheduler is fn main() { scx_rustsched_build::build_default(); }.
checked 🔒
missing_tools 🔒
What the Rust BPF build needs that this host lacks: the toolchain with rust-src, bpf-linker and llvm-objcopy.
resolved 🔒 ⚠
The type id names once its typedefs and qualifiers are peeled off.
runs 🔒
Whether program runs with args.
runtime_kfuncs
The kfuncs of scx_rustsched’s catalog.
trusted_arguments 🔒 ⚠
The parameters of the object’s global functions that are a pointer to a task_struct, as (function, parameter index).
undefined_symbols 🔒