scx/rust/scx_loader
Jake Hillion 8ca45cfa37
lint: enable cargo fmt (#643)
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.
2024-09-11 10:03:20 +01:00
..
src lint: enable cargo fmt (#643) 2024-09-11 10:03:20 +01:00
Cargo.toml version: v1.0.4 2024-09-05 18:12:45 -10:00
LICENSE scx_loader: Fix broken LICENSE symlink 2024-09-07 07:16:22 -10:00
meson.build scx_loader: Add scheduler loader via system DBUS interface 2024-08-30 00:56:27 +04:00
org.scx.Loader.conf scx_loader: Add scheduler loader via system DBUS interface 2024-08-30 00:56:27 +04:00
README.md scx_loader: Add scheduler loader via system DBUS interface 2024-08-30 00:56:27 +04:00
rustfmt.toml scx_loader: Add scheduler loader via system DBUS interface 2024-08-30 00:56:27 +04:00

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 its scx_name (e.g., "scx_rusty") and a scheduler mode (profile) represented as an unsigned integer.
  • StartSchedulerWithArgs Method: Starts a scheduler with its scx_name and allows passing arbitrary CLI arguments directly to the scheduler.
  • StopScheduler Method: Terminates the currently running scheduler.
  • CurrentScheduler Property: Returns the scx_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 by scx_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.