From: Chanwoo Choi Date: Wed, 31 Aug 2022 05:54:45 +0000 (+0900) Subject: resource-monitor: Fix typo and change document to improve readability X-Git-Tag: submit/tizen/20220901.013349~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F14%2F280514%2F2;p=platform%2Fcore%2Fapi%2Fresource-monitor.git resource-monitor: Fix typo and change document to improve readability - Fix type - Replace with new words as followings: : id -> ID : int id -> int monitor_id : uint -> uint32 : cpu -> CPU - Change the some description Change-Id: Iced5dda67e09b6fa57b49d4592b0a3231da2a8ca Signed-off-by: Chanwoo Choi --- diff --git a/include/resource-monitor.h b/include/resource-monitor.h index 195cb8b..a02a0dc 100644 --- a/include/resource-monitor.h +++ b/include/resource-monitor.h @@ -100,7 +100,7 @@ typedef enum { RESOURCE_MONITOR_MEMORY_ATTR_TOTAL = MEMORY_ATTR_TOTAL, /**< Memory total size (data type: DATA_TYPE_UINT64, unit: kB) */ RESOURCE_MONITOR_MEMORY_ATTR_AVAILABLE = MEMORY_ATTR_AVAILABLE, /**< Memory available size (data type: DATA_TYPE_UINT64, unit: kB) */ RESOURCE_MONITOR_MEMORY_ATTR_FREE = MEMORY_ATTR_FREE, /**< Memory free size (data type: DATA_TYPE_UINT64, unit: kB) */ - RESOURCE_MONITOR_MEMORY_ATTR_BUFFER = MEMORY_ATTR_BUFFER, /**< Memorry buffer size (data type: DATA_TYPE_UINT64, unit: kB) */ + RESOURCE_MONITOR_MEMORY_ATTR_BUFFER = MEMORY_ATTR_BUFFER, /**< Memory buffer size (data type: DATA_TYPE_UINT64, unit: kB) */ RESOURCE_MONITOR_MEMORY_ATTR_CACHED = MEMORY_ATTR_CACHED, /**< Memory cached size (data type: DATA_TYPE_UINT64, unit: kB) */ RESOURCE_MONITOR_MEMORY_ATTR_CMA_TOTAL = MEMORY_ATTR_CMA_TOTAL, /**< CMA memory total size (data type: DATA_TYPE_UINT64, unit: kB) */ RESOURCE_MONITOR_MEMORY_ATTR_CMA_FREE = MEMORY_ATTR_CMA_FREE, /**< CMA memory free size (data type: DATA_TYPE_UINT64, unit: kB) */ @@ -111,8 +111,8 @@ typedef enum { RESOURCE_MONITOR_BATTERY_ATTR_CAPACITY = BATTERY_ATTR_CAPACITY, /**< Battery capacity (data type: DATA_TYPE_INT, unit: %) */ RESOURCE_MONITOR_BATTERY_ATTR_STATUS = BATTERY_ATTR_STATUS, /**< Battery status (data type: DATA_TYPE_STRING) */ RESOURCE_MONITOR_BATTERY_ATTR_TEMPERATURE = BATTERY_ATTR_TEMPERATURE, /**< Battery temperature (data type: DATA_TYPE_INT) */ - RESOURCE_MONITOR_BATTERY_ATTR_VOLTAGE_NOW = BATTERY_ATTR_VOLTAGE_NOW, /**< Battery voltage figure (data type: DATA_TYPE_INT, unit: uV) */ - RESOURCE_MONITOR_BATTERY_ATTR_CURRENT_NOW = BATTERY_ATTR_CURRENT_NOW, /**< Battery current figure (data type: DATA_TYPE_INT, unit: uA) */ + RESOURCE_MONITOR_BATTERY_ATTR_VOLTAGE_NOW = BATTERY_ATTR_VOLTAGE_NOW, /**< Battery voltage value (data type: DATA_TYPE_INT, unit: uV) */ + RESOURCE_MONITOR_BATTERY_ATTR_CURRENT_NOW = BATTERY_ATTR_CURRENT_NOW, /**< Battery current value (data type: DATA_TYPE_INT, unit: uA) */ RESOURCE_MONITOR_BATTERY_ATTR_PRESENT = BATTERY_ATTR_PRESENT, /**< Battery connected status (data type: DATA_TYPE_INT) */ RESOURCE_MONITOR_BATTERY_ATTR_ONLINE = BATTERY_ATTR_ONLINE, /**< Battery Charger connector status (data type: DATA_TYPE_INT) */ @@ -127,8 +127,8 @@ typedef enum { RESOURCE_MONITOR_SYSTEM_ATTR_PER_CPU_UTIL = SYSTEM_ATTR_PER_CPU_UTIL, /**< Per-CPU utilization (data type: DATA_TYPE_ARRAY_DOUBLE, unit: %) */ RESOURCE_MONITOR_SYSTEM_ATTR_PER_CPU_USER_UTIL = SYSTEM_ATTR_PER_CPU_USER_UTIL, /**< Per-CPU utilization on user (data type: DATA_TYPE_ARRAY_DOUBLE, unit: %) */ RESOURCE_MONITOR_SYSTEM_ATTR_PER_CPU_SYS_UTIL = SYSTEM_ATTR_PER_CPU_SYS_UTIL, /**< Per-CPU utilization on system (data type: DATA_TYPE_ARRAY_DOUBLE, unit: %) */ - RESOURCE_MONITOR_SYSTEM_ATTR_POSSIBLE_CPU = SYSTEM_ATTR_POSSIBLE_CPU, /**< Number of possible cpu (data type: DATA_TYPE_INT, unit: ea) */ - RESOURCE_MONITOR_SYSTEM_ATTR_ONLINE_CPU = SYSTEM_ATTR_ONLINE_CPU, /**< Number of online cpu (data type: DATA_TYPE_INT, unit: ea) */ + RESOURCE_MONITOR_SYSTEM_ATTR_POSSIBLE_CPU = SYSTEM_ATTR_POSSIBLE_CPU, /**< Number of possible CPU (data type: DATA_TYPE_INT, unit: ea) */ + RESOURCE_MONITOR_SYSTEM_ATTR_ONLINE_CPU = SYSTEM_ATTR_ONLINE_CPU, /**< Number of online CPU (data type: DATA_TYPE_INT, unit: ea) */ /* Disk Resource Attribute ID */ RESOURCE_MONITOR_DISK_ATTR_NAME = DISK_ATTR_NAME, /**< Disk device name (data type: DATA_TYPE_STRING) */ @@ -171,8 +171,8 @@ typedef enum { /** * @brief Initializes the resource monitor. * @since_tizen 7.0 - * @remarks The @c return value should be released using resourc_monitor_exit(). - * @return @c positive integer as resource monitor id on success, otherwise a negative error value + * @remarks The @c return value should be released using resource_monitor_exit(). + * @return @c positive integer as resource monitor ID on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data @@ -183,7 +183,7 @@ int resource_monitor_init(void); /** * @brief Exits the resource monitor. * @since_tizen 7.0 - * @param[in] id Id of resource monitor which be returnted by resource_monitor_init() + * @param[in] monitor_id ID of resource monitor which be returned by resource_monitor_init() * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported @@ -191,14 +191,14 @@ int resource_monitor_init(void); * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_exit(int id); +int resource_monitor_exit(int monitor_id); /** * @brief Gets the count of supported resources according to resource type. * @since_tizen 7.0 - * @param[in] id Resource monitor id + * @param[in] monitor_id Resource monitorID * @param[in] resource_type Resource type - * @param[out] resource_count Resource count retrived from resource monitor + * @param[out] resource_count Resource count retrieved from resource monitor * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported @@ -206,28 +206,28 @@ int resource_monitor_exit(int id); * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_resource_count(int id, resource_monitor_type_e resource_type, int *resource_count); +int resource_monitor_get_resource_count(int monitor_id, resource_monitor_type_e resource_type, int *resource_count); /** * @brief Creates resource for given resource_type. * @since_tizen 7.0 - * @remarks The @c return value should be released using resourc_delete_resource(). - * @param[in] id Resource monitor id which be returnted by resource_monitor_init() + * @remarks The @c return value should be released using resource_delete_resource(). + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() * @param[in] resource_type Resource type - * @return @c positive integer as resource id on success, otherwise a negative error value + * @return @c positive integer as resource ID on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported * @retval #RESOURCE_MONITOR_ERROR_INVALID_PARAMETER Invalid Parameter * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_create_resource(int id, resource_monitor_type_e resource_type); +int resource_monitor_create_resource(int monitor_id, resource_monitor_type_e resource_type); /** - * @brief Deletes resource of given resource id. + * @brief Deletes resource of given resource ID. * @since_tizen 7.0 - * @param[in] id Resource monitor id which be returnted by resource_monitor_init() - * @param[in] resource_id Resource id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported @@ -235,15 +235,15 @@ int resource_monitor_create_resource(int id, resource_monitor_type_e resource_ty * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_delete_resource(int id, int resource_id); +int resource_monitor_delete_resource(int monitor_id, int resource_id); /** - * @brief Sets the resource control with value which is diffierential according to resource control id. + * @brief Sets the resource control with value which is different according to resource control id. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] ctrl_id Resource control id - * @param[in] value Value for resource control id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] ctrl_id Resource control ID + * @param[in] value Value for resource control ID * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported @@ -251,14 +251,13 @@ int resource_monitor_delete_resource(int id, int resource_id); * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_set_resource_ctrl(int id, int resource_id, resource_monitor_ctrl_id_e ctrl_id, int value); +int resource_monitor_set_resource_ctrl(int monitor_id, int resource_id, resource_monitor_ctrl_id_e ctrl_id, int value); /** - * @brief Sets the interested attributes for monitoring. + * @brief Sets the interested resource attributes for monitoring. * @since_tizen 7.0 - * @remarks Should be released using resource_monitor_unset_resource_attr(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() * @param[in] attr_mask Attribute mask including the various attributes * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -267,13 +266,13 @@ int resource_monitor_set_resource_ctrl(int id, int resource_id, resource_monitor * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_set_resource_attr(int id, int resource_id, resource_monitor_attr_id_e attr_mask); +int resource_monitor_set_resource_attr(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_mask); /** - * @brief Unsets the interested attributes for monitoring. + * @brief Unsets the interested resource attributes for monitoring. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() * @param[in] attr_mask Attribute mask including the various attributes * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -282,15 +281,15 @@ int resource_monitor_set_resource_attr(int id, int resource_id, resource_monitor * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_unset_resource_attr(int id, int resource_id, resource_monitor_attr_id_e attr_mask); +int resource_monitor_unset_resource_attr(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_mask); /** - * @brief Checks whether a resouce attribute is supported or not. + * @brief Checks whether a resource attribute is supported or not. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id - * @param[out] supported Resource attributes is either supported or not (@c true == supporeted, @c false = not supported) + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID + * @param[out] supported Resource attributes is either supported or not (@c true == supported, @c false = not supported) * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported @@ -298,12 +297,12 @@ int resource_monitor_unset_resource_attr(int id, int resource_id, resource_monit * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_is_resource_attr_supported(int id, int resource_id, resource_monitor_attr_id_e attr_id, bool *supported); +int resource_monitor_is_resource_attr_supported(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, bool *supported); /** * @brief Updates the value of interested attributes for all created resource. * @since_tizen 7.0 - * @param[in] id Resource monitor id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported @@ -311,13 +310,13 @@ int resource_monitor_is_resource_attr_supported(int id, int resource_id, resourc * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_update(int id); +int resource_monitor_update(int monitor_id); /** * @brief Updates the value of interested attributes for a resource. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful * @retval #RESOURCE_MONITOR_ERROR_NOT_SUPPORTED Not Supported @@ -325,14 +324,14 @@ int resource_monitor_update(int id); * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_update_resource(int id, int resource_id); +int resource_monitor_update_resource(int monitor_id, int resource_id); /** * @brief Gets the int value of resource attribute. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] value Value retrieved from resource attribute * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -341,14 +340,14 @@ int resource_monitor_update_resource(int id, int resource_id); * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_value_int(int id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t *value); +int resource_monitor_get_value_int(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t *value); /** * @brief Gets the int64 value of resource attribute. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] value Value retrieved from resource attribute * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -357,14 +356,14 @@ int resource_monitor_get_value_int(int id, int resource_id, resource_monitor_att * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_value_int64(int id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t *value); +int resource_monitor_get_value_int64(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t *value); /** - * @brief Gets the uint value of resource attribute. + * @brief Gets the uint32 value of resource attribute. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] value Value retrieved from resource attribute * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -373,14 +372,14 @@ int resource_monitor_get_value_int64(int id, int resource_id, resource_monitor_a * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_value_uint(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t *value); +int resource_monitor_get_value_uint32(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t *value); /** * @brief Gets the uint64 value of resource attribute. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] value Value retrieved from resource attribute * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -389,14 +388,14 @@ int resource_monitor_get_value_uint(int id, int resource_id, resource_monitor_at * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_value_uint64(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t *value); +int resource_monitor_get_value_uint64(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t *value); /** * @brief Gets the double value of resource attribute. * @since_tizen 7.0 - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] value Value retrieved from resource attribute * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -405,15 +404,15 @@ int resource_monitor_get_value_uint64(int id, int resource_id, resource_monitor_ * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_value_double(int id, int resource_id, resource_monitor_attr_id_e attr_id, double *value); +int resource_monitor_get_value_double(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, double *value); /** * @brief Gets the string value of resource attribute. * @since_tizen 7.0 * @remarks The @a value should be released using free(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] value Value retrieved from resource attribute * @return @c 0 on success, otherwise a negative error value * @retval #RESOURCE_MONITOR_ERROR_NONE Successful @@ -422,15 +421,15 @@ int resource_monitor_get_value_double(int id, int resource_id, resource_monitor_ * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_value_string(int id, int resource_id, resource_monitor_attr_id_e attr_id, char **value); +int resource_monitor_get_value_string(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, char **value); /** * @brief Gets the int array of resource attribute. * @since_tizen 7.0 * @remarks The @a array should be released using free(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] array Array retrieved from resource attribute * @param[out] length Length of array * @return @c 0 on success, otherwise a negative error value @@ -440,15 +439,15 @@ int resource_monitor_get_value_string(int id, int resource_id, resource_monitor_ * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_array_int(int id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t **array, int *length); +int resource_monitor_get_array_int(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t **array, int *length); /** * @brief Gets the int64 array of resource attribute. * @since_tizen 7.0 * @remarks The @a array should be released using free(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] array Array retrieved from resource attribute * @param[out] length Length of array * @return @c 0 on success, otherwise a negative error value @@ -458,15 +457,15 @@ int resource_monitor_get_array_int(int id, int resource_id, resource_monitor_att * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_array_int64(int id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t **array, int *length); +int resource_monitor_get_array_int64(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t **array, int *length); /** - * @brief Gets the uint array of resource attribute. + * @brief Gets the uint32 array of resource attribute. * @since_tizen 7.0 * @remarks The @a array should be released using free(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] array Array retrieved from resource attribute * @param[out] length Length of array * @return @c 0 on success, otherwise a negative error value @@ -476,15 +475,15 @@ int resource_monitor_get_array_int64(int id, int resource_id, resource_monitor_a * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_array_uint(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t **array, int *length); +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); /** * @brief Gets the uint64 array of resource attribute. * @since_tizen 7.0 * @remarks The @a array should be released using free(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] array Array retrieved from resource attribute * @param[out] length Length of array * @return @c 0 on success, otherwise a negative error value @@ -494,15 +493,15 @@ int resource_monitor_get_array_uint(int id, int resource_id, resource_monitor_at * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_array_uint64(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t **array, int *length); +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); /** * @brief Gets the double array of resource attribute. * @since_tizen 7.0 * @remarks The @a array should be released using free(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] array Array retrieved from resource attribute * @param[out] length Length of array * @return @c 0 on success, otherwise a negative error value @@ -512,15 +511,15 @@ int resource_monitor_get_array_uint64(int id, int resource_id, resource_monitor_ * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_array_double(int id, int resource_id, resource_monitor_attr_id_e attr_id, double **array, int *length); +int resource_monitor_get_array_double(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, double **array, int *length); /** * @brief Gets the string array of resource attribute. * @since_tizen 7.0 - * @remarks The @a array should be released using free(). - * @param[in] id Resource monitor id - * @param[in] resource_id Resource id - * @param[in] attr_id Resource attribute id + * @remarks The @a array and each data in the array should be released using free(). + * @param[in] monitor_id Resource monitor ID which be returned by resource_monitor_init() + * @param[in] resource_id Resource ID which be returned by resource_monitor_create_resource() + * @param[in] attr_id Resource attribute ID * @param[out] array Array retrieved from resource attribute * @param[out] length Length of array * @return @c 0 on success, otherwise a negative error value @@ -530,7 +529,7 @@ int resource_monitor_get_array_double(int id, int resource_id, resource_monitor_ * @retval #RESOURCE_MONITOR_ERROR_NO_DATA Empty Data * @retval #RESOURCE_MONITOR_ERROR_OUT_OF_MEMORY Out of Memory */ -int resource_monitor_get_array_string(int id, int resource_id, resource_monitor_attr_id_e attr_id, char ***array, int *length); +int resource_monitor_get_array_string(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, char ***array, int *length); /** * @} diff --git a/src/resource-monitor.c b/src/resource-monitor.c index 8c5ae2d..6bcaf35 100644 --- a/src/resource-monitor.c +++ b/src/resource-monitor.c @@ -27,112 +27,112 @@ int resource_monitor_init(void) return pass_resource_monitor_init(); } -int resource_monitor_exit(int id) +int resource_monitor_exit(int monitor_id) { - return pass_resource_monitor_exit(id); + return pass_resource_monitor_exit(monitor_id); } -int resource_monitor_get_resource_count(int id, resource_monitor_type_e resource_type, int *resource_count) +int resource_monitor_get_resource_count(int monitor_id, resource_monitor_type_e resource_type, int *resource_count) { - return pass_resource_monitor_get_resource_count(id, resource_type, resource_count); + return pass_resource_monitor_get_resource_count(monitor_id, resource_type, resource_count); } -int resource_monitor_create_resource(int id, resource_monitor_type_e resource_type) +int resource_monitor_create_resource(int monitor_id, resource_monitor_type_e resource_type) { - return pass_resource_monitor_create_resource(id, resource_type); + return pass_resource_monitor_create_resource(monitor_id, resource_type); } -int resource_monitor_delete_resource(int id, int resource_id) +int resource_monitor_delete_resource(int monitor_id, int resource_id) { - return pass_resource_monitor_delete_resource(id, resource_id); + return pass_resource_monitor_delete_resource(monitor_id, resource_id); } -int resource_monitor_set_resource_ctrl(int id, int resource_id, resource_monitor_ctrl_id_e ctrl_id, int value) +int resource_monitor_set_resource_ctrl(int monitor_id, int resource_id, resource_monitor_ctrl_id_e ctrl_id, int value) { - return pass_resource_monitor_set_resource_ctrl(id, resource_id, (u_int64_t)ctrl_id, value); + return pass_resource_monitor_set_resource_ctrl(monitor_id, resource_id, (u_int64_t)ctrl_id, value); } -int resource_monitor_set_resource_attr(int id, int resource_id, resource_monitor_attr_id_e attr_mask) +int resource_monitor_set_resource_attr(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_mask) { - return pass_resource_monitor_set_resource_attr(id, resource_id, (u_int64_t)attr_mask); + return pass_resource_monitor_set_resource_attr(monitor_id, resource_id, (u_int64_t)attr_mask); } -int resource_monitor_unset_resource_attr(int id, int resource_id, resource_monitor_attr_id_e attr_mask) +int resource_monitor_unset_resource_attr(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_mask) { - return pass_resource_monitor_unset_resource_attr(id, resource_id, (u_int64_t)attr_mask); + return pass_resource_monitor_unset_resource_attr(monitor_id, resource_id, (u_int64_t)attr_mask); } -int resource_monitor_is_resource_attr_supported(int id, int resource_id, resource_monitor_attr_id_e attr_id, bool *supported) +int resource_monitor_is_resource_attr_supported(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, bool *supported) { - return pass_resource_monitor_is_resource_attr_supported(id, resource_id, (u_int64_t)attr_id, supported); + return pass_resource_monitor_is_resource_attr_supported(monitor_id, resource_id, (u_int64_t)attr_id, supported); } -int resource_monitor_update(int id) +int resource_monitor_update(int monitor_id) { - return pass_resource_monitor_update(id); + return pass_resource_monitor_update(monitor_id); } -int resource_monitor_update_resource(int id, int resource_id) +int resource_monitor_update_resource(int monitor_id, int resource_id) { - return resource_monitor_update_resource(id, resource_id); + return resource_monitor_update_resource(monitor_id, resource_id); } -int resource_monitor_get_value_int(int id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t *value) +int resource_monitor_get_value_int(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t *value) { - return pass_resource_monitor_get_value_int(id, resource_id, (u_int64_t)attr_id, value); + return pass_resource_monitor_get_value_int(monitor_id, resource_id, (u_int64_t)attr_id, value); } -int resource_monitor_get_value_int64(int id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t *value) +int resource_monitor_get_value_int64(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t *value) { - return pass_resource_monitor_get_value_int64(id, resource_id, (u_int64_t)attr_id, value); + return pass_resource_monitor_get_value_int64(monitor_id, resource_id, (u_int64_t)attr_id, value); } -int resource_monitor_get_value_uint(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t *value) +int resource_monitor_get_value_uint32(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t *value) { - return pass_resource_monitor_get_value_uint(id, resource_id, (u_int64_t)attr_id, value); + return pass_resource_monitor_get_value_uint(monitor_id, resource_id, (u_int64_t)attr_id, value); } -int resource_monitor_get_value_uint64(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t *value) +int resource_monitor_get_value_uint64(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t *value) { - return pass_resource_monitor_get_value_uint64(id, resource_id, (u_int64_t)attr_id, value); + return pass_resource_monitor_get_value_uint64(monitor_id, resource_id, (u_int64_t)attr_id, value); } -int resource_monitor_get_value_double(int id, int resource_id, resource_monitor_attr_id_e attr_id, double *value) +int resource_monitor_get_value_double(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, double *value) { - return pass_resource_monitor_get_value_double(id, resource_id, (u_int64_t)attr_id, value); + return pass_resource_monitor_get_value_double(monitor_id, resource_id, (u_int64_t)attr_id, value); } -int resource_monitor_get_value_string(int id, int resource_id, resource_monitor_attr_id_e attr_id, char **value) +int resource_monitor_get_value_string(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, char **value) { - return pass_resource_monitor_get_value_string(id, resource_id, (u_int64_t)attr_id, value); + return pass_resource_monitor_get_value_string(monitor_id, resource_id, (u_int64_t)attr_id, value); } -int resource_monitor_get_array_int(int id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t **array, int *length) +int resource_monitor_get_array_int(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int32_t **array, int *length) { - return pass_resource_monitor_get_array_int(id, resource_id, (u_int64_t)attr_id, array, length); + return pass_resource_monitor_get_array_int(monitor_id, resource_id, (u_int64_t)attr_id, array, length); } -int resource_monitor_get_array_int64(int id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t **array, int *length) +int resource_monitor_get_array_int64(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, int64_t **array, int *length) { - return pass_resource_monitor_get_array_int64(id, resource_id, (u_int64_t)attr_id, array, length); + return pass_resource_monitor_get_array_int64(monitor_id, resource_id, (u_int64_t)attr_id, array, length); } -int resource_monitor_get_array_uint(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int32_t **array, int *length) +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) { - return pass_resource_monitor_get_array_uint(id, resource_id, (u_int64_t)attr_id, array, length); + return pass_resource_monitor_get_array_uint(monitor_id, resource_id, (u_int64_t)attr_id, array, length); } -int resource_monitor_get_array_uint64(int id, int resource_id, resource_monitor_attr_id_e attr_id, u_int64_t **array, int *length) +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) { - return pass_resource_monitor_get_array_uint64(id, resource_id, (u_int64_t)attr_id, array, length); + return pass_resource_monitor_get_array_uint64(monitor_id, resource_id, (u_int64_t)attr_id, array, length); } -int resource_monitor_get_array_double(int id, int resource_id, resource_monitor_attr_id_e attr_id, double **array, int *length) +int resource_monitor_get_array_double(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, double **array, int *length) { - return pass_resource_monitor_get_array_double(id, resource_id, (u_int64_t)attr_id, array, length); + return pass_resource_monitor_get_array_double(monitor_id, resource_id, (u_int64_t)attr_id, array, length); } -int resource_monitor_get_array_string(int id, int resource_id, resource_monitor_attr_id_e attr_id, char ***array, int *length) +int resource_monitor_get_array_string(int monitor_id, int resource_id, resource_monitor_attr_id_e attr_id, char ***array, int *length) { - return pass_resource_monitor_get_array_string(id, resource_id, (u_int64_t)attr_id, array, length); + return pass_resource_monitor_get_array_string(monitor_id, resource_id, (u_int64_t)attr_id, array, length); } diff --git a/tools/system-resource-monitor/system-resource-monitor.c b/tools/system-resource-monitor/system-resource-monitor.c index b0fa746..97d2bba 100644 --- a/tools/system-resource-monitor/system-resource-monitor.c +++ b/tools/system-resource-monitor/system-resource-monitor.c @@ -350,7 +350,7 @@ static inline void get_resource_attr_value(struct resource_data *res, int i) res->attrs[i].unit, res->attrs[i].desc); break; case DATA_TYPE_UINT: - ret = resource_monitor_get_value_uint( + ret = resource_monitor_get_value_uint32( res->mon_id, res->res_id, res->attrs[i].id, &(res->attrs[i].value_uint32));