Describes all the structures and functions related to the whole DVFS context (the whole system).
More...
Go to the source code of this file.
|
| int | dvfs_start (dvfs_ctx **ppCtx, bool seq) |
| | Starts controlling DVFS on the system. More...
|
| |
| int | dvfs_stop (dvfs_ctx *ctx) |
| | Frees the memory associated to a DVFS context and restores the DVFS control to its state before calling dvfs_start. More...
|
| |
| int | dvfs_has_TB () |
| | Returns true if one of the DVFS unit on the system allows TurboBoost. More...
|
| |
| int | dvfs_set_gov (const dvfs_ctx *ctx, const char *gov) |
| | Sets the provided governor on all the DVFS units. More...
|
| |
| int | dvfs_set_freq (dvfs_ctx *ctx, unsigned int freq) |
| | Sets the given frequency on all the DVFS units. More...
|
| |
| int | dvfs_get_core (const dvfs_ctx *ctx, const dvfs_core **ppCore, unsigned int core_id) |
| | Gets the dvfs_core structure associated to the given core id. More...
|
| |
| int | dvfs_get_unit_by_id (const dvfs_ctx *ctx, const dvfs_unit **ppUnit, unsigned int index) |
| | Gets the DVFS unit associated to the given index. More...
|
| |
| int | dvfs_get_unit_by_core (const dvfs_ctx *ctx, const dvfs_core *core, const dvfs_unit **ppUnit) |
| | Gets the DVFS unit associated with the given core. More...
|
| |
| int | dvfs_get_nb_units (const dvfs_ctx *ctx, unsigned int *pNb) |
| | Gets the number of DVFS units available in this context. More...
|
| |
Describes all the structures and functions related to the whole DVFS context (the whole system).
This is the entry point of the library.
- See also
- dvfs_unit
| int dvfs_get_core |
( |
const dvfs_ctx * |
ctx, |
|
|
const dvfs_core ** |
ppCore, |
|
|
unsigned int |
core_id |
|
) |
| |
Gets the dvfs_core structure associated to the given core id.
- Parameters
-
| ctx | The DVFS context as provided by dvfs_start() |
| ppCore | The dvfs_core structure associated to the core or NULL if the core id is not found. |
| core_id | The core id. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ctx or ppCore are NULL. |
| DVFS_ERROR_INVALID_CORE_ID | if the core ID is not valid. |
| int dvfs_get_nb_units |
( |
const dvfs_ctx * |
ctx, |
|
|
unsigned int * |
pNb |
|
) |
| |
Gets the number of DVFS units available in this context.
- Parameters
-
| ctx | The DVFS context as provided by dvfs_start() |
| pNb | Will be filled with the number of DVFS unit available |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ctx or pNb are NULL. |
Gets the DVFS unit associated with the given core.
- Parameters
-
| ctx | The DVFS context as provided by dvfs_start() |
| core | The core structure. |
| ppUnit | The DVFS unit in charge of this core. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ctx or core or ppUnit are NULL. |
| DVFS_ERROR_CORE_UNIT_MISMATCH | if the unit can not be find. |
| int dvfs_get_unit_by_id |
( |
const dvfs_ctx * |
ctx, |
|
|
const dvfs_unit ** |
ppUnit, |
|
|
unsigned int |
index |
|
) |
| |
Gets the DVFS unit associated to the given index.
- Parameters
-
| ctx | The DVFS context as provided by dvfs_start() |
| ppUnit | Will be filled with the DVFS unit. |
| index | The index of the DVFS unit to get |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ctx or core or ppUnit are NULL. |
| DVFS_ERROR_INVALID_INDEX | if index does not match any DVFS unit. |
Returns true if one of the DVFS unit on the system allows TurboBoost.
- Returns
- Return values
-
| DVFS_TB_AVAILABLE | if TurboBoost is available on one of the DVFS unit. |
| DVFS_TB_UNAVAILABLE | if TurboBoost is not available. |
| DVFS_ERROR_FILE_FAILED | if the information could not be read (likely because /proc/cpuinfo is not available), or can't be opened. |
| int dvfs_set_freq |
( |
dvfs_ctx * |
ctx, |
|
|
unsigned int |
freq |
|
) |
| |
Sets the given frequency on all the DVFS units.
The effects are unknown if the current governor is not "userspace".
- Parameters
-
| ctx | The DVFS context as provided by dvfs_start() |
| freq | The new frequency to set. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ctx is NULL. |
| int dvfs_set_gov |
( |
const dvfs_ctx * |
ctx, |
|
|
const char * |
gov |
|
) |
| |
Sets the provided governor on all the DVFS units.
- Parameters
-
| ctx | The DVFS context as provided by dvfs_start |
| gov | The new governor to set |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ctx or gov are NULL. |
| int dvfs_start |
( |
dvfs_ctx ** |
ppCtx, |
|
|
bool |
seq |
|
) |
| |
Starts controlling DVFS on the system.
- Parameters
-
| ppCtx | the new DVFS context used in the various functions. |
| seq | Tells if the frequency transitions must be synchronized or not. |
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ppCtx is NULL. |
| DVFS_ERROR_MEM_ALLOC_FAILED | if memory allocation failed. |
| DVFS_ERROR_RELATED_CORE_UNAVAILABLE | the related core information is not available |
- See also
- dvfs_stop()
Frees the memory associated to a DVFS context and restores the DVFS control to its state before calling dvfs_start.
- Parameters
-
- Returns
- Return values
-
| DVFS_SUCCESS | if everything goes right. |
| DVFS_ERROR_INVALID_ARG | if ctx is NULL. |
- See also
- dvfs_start()