<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <!--
      org.scx.Loader:
      @short_description: Scheduler Loader Service

      The Scheduler Loader service provides an interface for managing schedulers
      that can be used with sched-ext. It allows starting, stopping, switching and querying
      the status of supported schedulers.
  -->
  <interface name="org.scx.Loader">

    <!--
        CurrentScheduler:

        The name of the currently running scheduler. If no scheduler is active,
        this property will be set to "unknown".
    -->
    <property name="CurrentScheduler" type="s" access="read"/>

    <!--
        SchedulerMode:
        @sched_mode: 0 = Auto, 1 = Gaming, 2 = PowerSave, 3 = LowLatency, 4 = Server

        The currently active scheduler mode.  Scheduler modes allow you to
        apply pre-defined configurations to a scheduler that are
        optimized for different use cases. If no scheduler is active,
        this property will be set to 0 (Auto).
    -->
    <property name="SchedulerMode" type="u" access="read"/>

    <!--
        CurrentSchedulerArgs:

        The arguments used for the currently running scheduler. If no scheduler
        is active or the scheduler was started with a predefined mode (not custom
        arguments), this property will return an empty array.
    -->
    <property name="CurrentSchedulerArgs" type="as" access="read"/>
    <!--
        SupportedSchedulers:

        A list of the schedulers currently supported by the Scheduler Loader.
        The names of the supported schedulers will be listed as strings in
        this array.
    -->
    <property name="SupportedSchedulers" type="as" access="read"/>

    <!--
        DefaultScheduler:

        The name of the default scheduler configured in the config file.
        If no default scheduler is configured, this property will be set
        to "unknown".
    -->
    <property name="DefaultScheduler" type="s" access="read"/>

    <!--
        DefaultMode:
        @sched_mode: 0 = Auto, 1 = Gaming, 2 = PowerSave, 3 = LowLatency, 4 = Server

        The default scheduler mode configured in the config file.
        Defaults to 0 (Auto) if not explicitly configured.
    -->
    <property name="DefaultMode" type="u" access="read"/>

    <!--
        StartScheduler:

        Starts the specified scheduler with the given mode.

        @scx_name: The name of the scheduler to start (e.g., "scx_rusty").
        @sched_mode: The scheduler mode (profile) as an unsigned integer.
                   See the SchedulerMode property for details.
    -->
    <method name="StartScheduler">
      <arg name="scx_name" type="s" direction="in"/>
      <arg name="sched_mode" type="u" direction="in"/>
    </method>

    <!--
        StartSchedulerWithArgs:

        Starts the specified scheduler with the provided arguments.

        @scx_name: The name of the scheduler to start (e.g., "scx_bpfland").
        @scx_args: An array of strings representing the CLI arguments to pass
                    to the scheduler.
    -->
    <method name="StartSchedulerWithArgs">
      <arg name="scx_name" type="s" direction="in"/>
      <arg name="scx_args" type="as" direction="in"/>
    </method>

    <!--
        SwitchScheduler:

        Switches to the specified scheduler with the given mode. This method
        will stop the currently running scheduler (if any) and then start the
        new scheduler.

        @scx_name: The name of the scheduler to switch to (e.g., "scx_rusty").
        @sched_mode: The scheduler mode (profile) as an unsigned integer.
                   See the SchedulerMode property for details.
    -->
    <method name="SwitchScheduler">
      <arg name="scx_name" type="s" direction="in"/>
      <arg name="sched_mode" type="u" direction="in"/>
    </method>

    <!--
        SwitchSchedulerWithArgs:

        Switches to the specified scheduler with the provided arguments. This
        method will stop the currently running scheduler (if any) and then
        start the new scheduler with the given arguments.

        @scx_name: The name of the scheduler to switch to (e.g., "scx_bpfland").
        @scx_args: An array of strings representing the CLI arguments to pass
                    to the scheduler.
    -->
    <method name="SwitchSchedulerWithArgs">
      <arg name="scx_name" type="s" direction="in"/>
      <arg name="scx_args" type="as" direction="in"/>
    </method>

    <!--
        StopScheduler:

        Stops the currently running scheduler.
    -->
    <method name="StopScheduler">
    </method>

    <!--
        RestartScheduler:

        Restarts the currently running scheduler with its original configuration.
        This method will stop the currently running scheduler and then restart 
        it with the same scheduler and arguments/mode that were used originally.
        Returns an error if no scheduler is currently running.
    -->
    <method name="RestartScheduler">
    </method>

    <!--
        RestoreDefault:

        Switches to the default scheduler with the default mode as configured
        in the config file. This method will stop the currently running
        scheduler (if any) and then start the default scheduler.
        Returns an error if no default scheduler is configured.
    -->
    <method name="RestoreDefault">
    </method>
  </interface>
</node>
