Tizen Native API
7.0
|
The Resource Monitor API provides functions for monitoring the devices such as CPU, GPU, Bus, Disk, System and so on.
Required Header
#include <system/resource-monitor.h>
Overview
The Resource Monitor API provides a set of functions to monitor the resources. It is required to monitor the various resources at the same time.
Each resource has the different monitoring data aka the resource attribute. The user of Resource Monitor API is able to select both the monitored resources and the monitored resource attributes they want before monitoring. Finally, the user can get the monitored value set they want at the same time.
The user is able to know the system status by analyzing the monitored data set. Also, the analysis of system status will be used to optimize the platform and application.
The Resource Monitor API allows to monitor the following resource types:
- CPU
- Bus
- GPU
- Memory
- Battery
- Display
- System
- Disk
Functions | |
int | resource_monitor_init (void) |
Initializes the resource monitor. | |
int | resource_monitor_exit (int monitor_id) |
Exits the resource monitor. | |
int | resource_monitor_get_resource_count (int monitor_id, resource_monitor_type_e resource_type, int *resource_count) |
Gets the count of supported resources according to resource type. | |
int | resource_monitor_create_resource (int monitor_id, resource_monitor_type_e resource_type) |
Creates resource for given resource_type. | |
int | resource_monitor_delete_resource (int monitor_id, int resource_id) |
Deletes resource of given resource ID. | |
int | resource_monitor_set_resource_ctrl (int monitor_id, int resource_id, resource_monitor_ctrl_id_e ctrl_id, int value) |
Sets the resource control with value which is different according to resource control id. | |
int | resource_monitor_set_resource_attr (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_mask) |
Sets the resource attributes of interest for monitoring. | |
int | resource_monitor_unset_resource_attr (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_mask) |
Unsets the resource attributes of interest for monitoring. | |
int | resource_monitor_is_resource_attr_supported (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, bool *supported) |
Checks whether a resource attribute is supported or not. | |
int | resource_monitor_update (int monitor_id) |
Updates the value of attributes of interest for all created resource. | |
int | resource_monitor_update_resource (int monitor_id, int resource_id) |
Updates the value of attributes of interest for a resource. | |
int | resource_monitor_get_value_int (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t *value) |
Gets the int value of resource attribute. | |
int | resource_monitor_get_value_int64 (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t *value) |
Gets the int64 value of resource attribute. | |
int | resource_monitor_get_value_uint32 (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t *value) |
Gets the uint32 value of resource attribute. | |
int | resource_monitor_get_value_uint64 (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t *value) |
Gets the uint64 value of resource attribute. | |
int | resource_monitor_get_value_double (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, double *value) |
Gets the double value of resource attribute. | |
int | resource_monitor_get_value_string (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, char **value) |
Gets the string value of resource attribute. | |
int | resource_monitor_get_array_int (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t **array, int *length) |
Gets the int array of resource attribute. | |
int | resource_monitor_get_array_int64 (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t **array, int *length) |
Gets the int64 array of resource attribute. | |
int | resource_monitor_get_array_uint32 (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t **array, int *length) |
Gets the uint32 array of resource attribute. | |
int | resource_monitor_get_array_uint64 (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t **array, int *length) |
Gets the uint64 array of resource attribute. | |
int | resource_monitor_get_array_double (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, double **array, int *length) |
Gets the double array of resource attribute. | |
int | resource_monitor_get_array_string (int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, char ***array, int *length) |
Gets the string array of resource attribute. |
Enumeration Type Documentation
Enumeration for resource attribute ID.
- Since :
- 7.0
- Enumerator:
Enumeration for resource control ID.
- Since :
- 7.0
- Enumerator:
Enumeration for resource monitor error value.
- Since :
- 7.0
- Enumerator:
Enumeration for resource type.
- Since :
- 7.0
- Enumerator:
Function Documentation
int resource_monitor_create_resource | ( | int | monitor_id, |
resource_monitor_type_e | resource_type | ||
) |
Creates resource for given resource_type.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The
return
value should be released using resource_delete_resource().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_type Resource type
- Returns:
positive
integer as resource ID on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_RESOURCE Unavailable Resource Type
int resource_monitor_delete_resource | ( | int | monitor_id, |
int | resource_id | ||
) |
Deletes resource of given resource ID.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory
int resource_monitor_exit | ( | int | monitor_id | ) |
Exits the resource monitor.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id ID of resource monitor which be returned by resource_monitor_init()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory
- See also:
- resource_monitor_init()
int resource_monitor_get_array_double | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
double ** | array, | ||
int * | length | ||
) |
Gets the double array of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The array should be released using free().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] array Array retrieved from resource attribute [out] length Length of array
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_array_int | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
int32_t ** | array, | ||
int * | length | ||
) |
Gets the int array of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The array should be released using free().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] array Array retrieved from resource attribute [out] length Length of array
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_array_int64 | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
int64_t ** | array, | ||
int * | length | ||
) |
Gets the int64 array of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The array should be released using free().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] array Array retrieved from resource attribute [out] length Length of array
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_array_string | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
char *** | array, | ||
int * | length | ||
) |
Gets the string array of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The array and each data in the array should be released using free().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] array Array retrieved from resource attribute [out] length Length of array
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_array_uint32 | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
u_int32_t ** | array, | ||
int * | length | ||
) |
Gets the uint32 array of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The array should be released using free().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] array Array retrieved from resource attribute [out] length Length of array
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_array_uint64 | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
u_int64_t ** | array, | ||
int * | length | ||
) |
Gets the uint64 array of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The array should be released using free().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] array Array retrieved from resource attribute [out] length Length of array
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_resource_count | ( | int | monitor_id, |
resource_monitor_type_e | resource_type, | ||
int * | resource_count | ||
) |
Gets the count of supported resources according to resource type.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitorID [in] resource_type Resource type [out] resource_count Resource count retrieved from resource monitor
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_RESOURCE Unavailable Resource Type
- See also:
- resource_monitor_init()
int resource_monitor_get_value_double | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
double * | value | ||
) |
Gets the double value of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] value Value retrieved from resource attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_value_int | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
int32_t * | value | ||
) |
Gets the int value of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] value Value retrieved from resource attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_value_int64 | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
int64_t * | value | ||
) |
Gets the int64 value of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] value Value retrieved from resource attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_value_string | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
char ** | value | ||
) |
Gets the string value of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The value should be released using free().
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] value Value retrieved from resource attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_value_uint32 | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
u_int32_t * | value | ||
) |
Gets the uint32 value of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] value Value retrieved from resource attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_get_value_uint64 | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
u_int64_t * | value | ||
) |
Gets the uint64 value of resource attribute.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] value Value retrieved from resource attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_init | ( | void | ) |
Initializes the resource monitor.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- The
return
value should be released using resource_monitor_exit().
- Returns:
positive
integer as resource monitor ID on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory
- See also:
- resource_monitor_exit()
// Create monitor_id and resource_id for CPU device. int monitor_id = resource_monitor_init(); int resource_id = resource_monitor_create_resource(monitor_id, RESOURCE_MONITOR_TYPE_CPU); // Set control value to indicate the specific CPU device. // It assumes CPU cluster is only one for this example. int ret = resource_monitor_set_resource_ctrl(monitor_id, resource_id, 0); // Set interested resource attributes to monitor the CPU current/minimum frequency. u_int64_t attr_mask = RESOURCE_MONITOR_CPU_ATTR_CUR_FREQ | RESOURCE_MONITOR_CPU_ATTR_MIN_FREQ; ret = resource_monitor_set_resource_attr(monitor_id, resource_id, attr_mask); // Update resource attribute data of CPU current /minimum frequency.. ret = resource_monitor_update(monitor_id); // Get the monitored resource attribute data of CPU current/minimum frequency. int cpu_cur_freq; int cpu_min_freq; ret = resource_monitor_get_value_int(monitor_id, resource_id, RESOURCE_MONITOR_CPU_ATTR_CUR_FREQ, &cpu_cur_freq); ret = resource_monitor_get_value_int(monitor_id, resource_id, RESOURCE_MONITOR_CPU_ATTR_MIN_FREQ, &cpu_min_freq);
int resource_monitor_is_resource_attr_supported | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_id, | ||
bool * | supported | ||
) |
Checks whether a resource attribute is supported or not.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_id Resource attribute ID [out] supported Resource attributes is either supported or not ( true
== supported,false
= not supported)
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory
int resource_monitor_set_resource_attr | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_mask | ||
) |
Sets the resource attributes of interest for monitoring.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_mask Attribute mask including the various attributes
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_set_resource_ctrl | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_ctrl_id_e | ctrl_id, | ||
int | value | ||
) |
Sets the resource control with value which is different according to resource control id.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] ctrl_id Resource control ID [in] value Value for resource control ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory
int resource_monitor_unset_resource_attr | ( | int | monitor_id, |
int | resource_id, | ||
resource_monitor_attr_id_e | attr_mask | ||
) |
Unsets the resource attributes of interest for monitoring.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource() [in] attr_mask Attribute mask including the various attributes
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory RESOURCE_MONITOR_ERROR_NOT_SUPPORTED_ATTRIBUTE Unavailable Attribute
int resource_monitor_update | ( | int | monitor_id | ) |
Updates the value of attributes of interest for all created resource.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory
int resource_monitor_update_resource | ( | int | monitor_id, |
int | resource_id | ||
) |
Updates the value of attributes of interest for a resource.
- Since :
- 7.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Parameters:
-
[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() [in] resource_id Resource ID which be returned by resource_monitor_create_resource()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RESOURCE_MONITOR_ERROR_NONE Successful RESOURCE_MONITOR_ERROR_PERMISSION_DENIED Permission Denied RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter RESOURCE_MONITOR_ERROR_NO_DATA Empty Data RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory