# fuchsia.scheduler

<br />

Added: 20

## **PROTOCOLS**

## RoleManager

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=54)*

Allows callers to modify the runtime profiles of zircon objects.

<br />

### GetProfileForRole

Returns a profile handle for the requested role.

- request `target` is the type of profile to retrieve.
- request `role` is the name of the role to retrieve.
- request `input_parameters` is a vector of key/value pairs used to distinguish between multiple variants of the same role.

<!-- -->

- response `profile` is the handle to the requested profile.
- response `output_parameters` is a vector of key/value pairs that roles can be configured to emit.

<!-- -->

- error a zx_status value indicating success or failure.

Added: HEAD

#### Request

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleManagerGetProfileForRoleRequest` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleManager_GetProfileForRole_Result` |

### SetRole

Sets the given object's performance parameters based on the requested
role. The exact parameters of the role are system dependent and may
vary based on device-specific tuning and/or runtime system goals.

- request `target` is a handle to a zircon object to which a profile can be applied.
- request `role` is the name of the role to apply to the target.
- request `input_parameters` is a vector of key/value pairs used to distinguish between multiple variants of the same role.

<!-- -->

- response `output_parameters` is a vector of key/value pairs that roles can be configured to emit.

<!-- -->

- error a zx_status value indicating success or failure.

#### Request

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleManagerSetRoleRequest` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleManager_SetRole_Result` |

## **STRUCTS**

### Parameter

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=22)*

| Field | Type | Description | Default |
|---|---|---|---|
| `key` | `string:512` |   | No default |
| `value` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#ParameterValue` |   | No default |

### RoleName

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=32)*

| Field | Type | Description | Default |
|---|---|---|---|
| `role` | `string:2048` |   | No default |

## **ENUMS**

### RoleType [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=44)*
Added: HEAD

<br />

| Name | Value | Description |
|---|---|---|
| ### TASK | `0` |   |
| ### MEMORY | `1` |   |

## **TABLES**

### RoleManagerGetProfileForRoleRequest [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=86)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `target` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleType` |   |
| ### 2 | `role` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleName` |   |
| ### 3 | `input_parameters` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.scheduler#Parameter>:512` |   |

### RoleManagerSetRoleRequest [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=67)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `target` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleTarget` |   |
| ### 2 | `role` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleName` |   |
| ### 3 | `input_parameters` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.scheduler#Parameter>:512` |   |

### RoleManager_GetProfileForRole_Response [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=90)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `profile` | `handle<profile>` |   |
| ### 2 | `output_parameters` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.scheduler#Parameter>:512` |   |

### RoleManager_SetRole_Response [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=71)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `output_parameters` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.scheduler#Parameter>:512` |   |

## **UNIONS**

### ParameterValue [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=15)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `float_value` | `float64` |   |
| ### 2 | `int_value` | `int64` |   |
| ### 3 | `string_value` | `string:2048` |   |

<br />

### RoleManager_GetProfileForRole_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=90)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleManager_GetProfileForRole_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### RoleManager_SetRole_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=71)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.scheduler#RoleManager_SetRole_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### RoleTarget [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.scheduler/role.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=38)*

A Zircon object to which a profile can be applied.
Currently, only threads and vmars are supported.

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `thread` | `handle<thread>` |   |
| ### 2 | `vmar` | `handle<vmar>` |   |

<br />

## **CONSTANTS**

| Name | Value | Type | Description |
|---|---|---|---|
| [MAX_NAME_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=9) | `2048` | `int32` |   |
| [MAX_PARAMETER_COUNT](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=12) | `512` | `int32` |   |
| [MAX_PARAMETER_KEY_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=10) | `512` | `int32` |   |
| [MAX_PARAMETER_VALUE_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.scheduler/role.fidl;l=11) | `2048` | `int32` |   |