mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-26 11:30:22 +00:00
8ca45cfa37
Use `cargo fmt` with a specific nightly branch in the CI to enforce formatting. Globally format these files while the diff is still small so we can stay on top of it. Test plan: - CI lint check passes. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE | ||
meson.build | ||
org.scx.Loader.conf | ||
README.md | ||
rustfmt.toml |
scx_loader: A DBUS Interface for Managing sched-ext Schedulers
scx_loader
is a utility that provides a convenient DBUS interface for starting, stopping, and managing sched_ext schedulers.
Features
StartScheduler
Method: Launches a scheduler specified by itsscx_name
(e.g., "scx_rusty") and a scheduler mode (profile) represented as an unsigned integer.StartSchedulerWithArgs
Method: Starts a scheduler with itsscx_name
and allows passing arbitrary CLI arguments directly to the scheduler.StopScheduler
Method: Terminates the currently running scheduler.CurrentScheduler
Property: Returns thescx_name
of the active scheduler or "unknown" if none is running.SchedulerMode
Property: Provides information about the currently active scheduler's mode (profile).SupportedSchedulers
Property: Lists the schedulers currently supported byscx_loader
.
Usage
scx_loader
interacts with schedulers through its DBUS interface. You can use tools like dbus-send
or gdbus
to communicate with it.
Examples using dbus-send
:
-
Start a Scheduler:
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StartScheduler string:scx_rusty uint32:0
(This starts
scx_rusty
with scheduler mode 0) -
Start a Scheduler with Arguments:
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StartSchedulerWithArgs string:scx_bpfland array:string:"-k","-c","0"
(This starts
scx_bpfland
with arguments-k -c 0
) -
Stop the Current Scheduler:
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.scx.Loader.StopScheduler
-
Get the Currently Active Scheduler:
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.freedesktop.DBus.Properties.Get string:org.scx.Loader string:CurrentScheduler
-
Get the Supported Schedulers:
dbus-send --system --print-reply --dest=org.scx.Loader /org/scx/Loader org.freedesktop.DBus.Properties.Get string:org.scx.Loader string:SupportedSchedulers
Note: Replace the example scheduler names and arguments with the actual ones you want to use.
Development Status
scx_loader
is under active development. Future improvements may include:
- More robust error handling.
- Configuration file.