From: Chanwoo Choi Date: Fri, 1 Apr 2022 05:34:13 +0000 (+0900) Subject: lib: resource-monitor: Rename to libpass-resource-monitor from tmonitor X-Git-Tag: accepted/tizen/unified/20220405.003743 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20220405.003743;p=platform%2Fcore%2Fsystem%2Fpass.git lib: resource-monitor: Rename to libpass-resource-monitor from tmonitor Change-Id: If008aa6ab64b04226f97709ea48e13e459cc9a61 Signed-off-by: Chanwoo Choi --- diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4f6a41d..78a3b9c 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,6 +1,7 @@ -PROJECT(libpass C) +PROJECT(libpass-resource-monitor C) -SET(NAME pass) +SET(NAME_PASS pass) +SET(NAME_PASS_RESOURCE_MONITOR pass-resource-monitor) SET(VERSION_MAJOR 0) SET(VERSION "${VERSION_MAJOR}.1.0") @@ -30,20 +31,20 @@ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functi SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -lrt") SET(CMAKE_EXE_LINKER_FLAGS "-pie") -SET(SRCS ./tmonitor/tmonitor.c) +SET(SRCS ./resource-monitor/resource-monitor.c) ADD_LIBRARY( ${PROJECT_NAME} SHARED ${SRCS}) TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${pkgs_LDFLAGS} -ldl -Wl,-z,nodelete,--no-undefined) SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) -SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${NAME}) +SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${NAME_PASS_RESOURCE_MONITOR}) CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc.in ${CMAKE_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc @ONLY) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}) -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tmonitor/ - DESTINATION ${INCLUDEDIR}/${NAME}/ +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resource-monitor/ + DESTINATION ${INCLUDEDIR}/${NAME_PASS}/ FILES_MATCHING PATTERN "*.h") INSTALL(FILES ${CMAKE_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) diff --git a/lib/tmonitor/tmonitor.c b/lib/resource-monitor/resource-monitor.c similarity index 80% rename from lib/tmonitor/tmonitor.c rename to lib/resource-monitor/resource-monitor.c index bfd9653..af25357 100644 --- a/lib/tmonitor/tmonitor.c +++ b/lib/resource-monitor/resource-monitor.c @@ -1,5 +1,5 @@ /* - * PASS (Power Aware System Service) - Tizen Monitor Library + * PASS (Power Aware System Service) - Resource Monitor Library * * Copyright (c) 2022 Samsung Electronics Co., Ltd. * @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -35,6 +34,8 @@ #include #include +#include "resource-monitor.h" + #define REQUEST_SERVER_IP "127.0.0.1" #define REQUEST_SERVER_PORT 10001 @@ -44,44 +45,44 @@ extern char *program_invocation_name; #define EXPORT __attribute__ ((visibility("default"))) #endif -struct tmonitor_client { +struct pass_resource_monitor_client { int id; int period; int (*func)(void *data, void *user_data); void *user_data; }; -static GList *g_tmonitor_client_head; +static GList *g_pass_resource_monitor_client_head; static GMutex g_mutex; -void add_client_to_list(struct tmonitor_client *client) +void add_client_to_list(struct pass_resource_monitor_client *client) { if (!client) return; g_mutex_lock(&g_mutex); - g_tmonitor_client_head = - g_list_append(g_tmonitor_client_head, (gpointer)client); + g_pass_resource_monitor_client_head = + g_list_append(g_pass_resource_monitor_client_head, (gpointer)client); g_mutex_unlock(&g_mutex); } -void remove_client_from_list(struct tmonitor_client *client) +void remove_client_from_list(struct pass_resource_monitor_client *client) { if (!client) return; g_mutex_lock(&g_mutex); - g_tmonitor_client_head = - g_list_remove(g_tmonitor_client_head, (gpointer)client); + g_pass_resource_monitor_client_head = + g_list_remove(g_pass_resource_monitor_client_head, (gpointer)client); g_mutex_unlock(&g_mutex); } -static struct tmonitor_client *find_client_by_id(int id) +static struct pass_resource_monitor_client *find_client_by_id(int id) { - struct tmonitor_client *client; + struct pass_resource_monitor_client *client; GList *node; - for (node = g_tmonitor_client_head; + for (node = g_pass_resource_monitor_client_head; node != NULL; node = node->next) { client = node->data; @@ -126,13 +127,13 @@ static int handle_resource_attr(int request, int id, int resource_id, u_int64_t } EXPORT -int tmonitor_init(void) +int pass_resource_monitor_init(void) { - struct tmonitor_client *client; + struct pass_resource_monitor_client *client; struct sockaddr_in server_addr; int ret = -EIO; - client = malloc(sizeof(struct tmonitor_client)); + client = malloc(sizeof(struct pass_resource_monitor_client)); if (!client) { _E("[libpass] failed to allocate memory"); return -ENOMEM; @@ -172,9 +173,9 @@ err_out_free: } EXPORT -int tmonitor_exit(int id) +int pass_resource_monitor_exit(int id) { - struct tmonitor_client *client; + struct pass_resource_monitor_client *client; client = find_client_by_id(id); if (!client) { @@ -190,7 +191,7 @@ int tmonitor_exit(int id) } EXPORT -int tmonitor_get_resource_count(int id, int resource_type) +int pass_resource_monitor_get_resource_count(int id, int resource_type) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -224,7 +225,7 @@ int tmonitor_get_resource_count(int id, int resource_type) } EXPORT -int tmonitor_create_resource(int id, int resource_type) +int pass_resource_monitor_create_resource(int id, int resource_type) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -257,7 +258,7 @@ int tmonitor_create_resource(int id, int resource_type) } EXPORT -int tmonitor_delete_resource(int id, int resource_id) +int pass_resource_monitor_delete_resource(int id, int resource_id) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -290,7 +291,7 @@ int tmonitor_delete_resource(int id, int resource_id) } EXPORT -int tmonitor_set_resource_ctrl(int id, int resource_id, u_int64_t ctrl_id, int value) +int pass_resource_monitor_set_resource_ctrl(int id, int resource_id, u_int64_t ctrl_id, int value) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -324,19 +325,19 @@ int tmonitor_set_resource_ctrl(int id, int resource_id, u_int64_t ctrl_id, int v } EXPORT -int tmonitor_set_resource_attr(int id, int resource_id, u_int64_t attr_mask) +int pass_resource_monitor_set_resource_attr(int id, int resource_id, u_int64_t attr_mask) { return handle_resource_attr(REQUEST_SET_RESOURCE_ATTR, id, resource_id, attr_mask); } EXPORT -int tmonitor_unset_resource_attr(int id, int resource_id, u_int64_t attr_mask) +int pass_resource_monitor_unset_resource_attr(int id, int resource_id, u_int64_t attr_mask) { return handle_resource_attr(REQUEST_UNSET_RESOURCE_ATTR, id, resource_id, attr_mask); } EXPORT -bool tmonitor_is_resource_attr_supported(int id, int resource_id, u_int64_t attr_id) +bool pass_resource_monitor_is_resource_attr_supported(int id, int resource_id, u_int64_t attr_id) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -370,7 +371,7 @@ bool tmonitor_is_resource_attr_supported(int id, int resource_id, u_int64_t attr } EXPORT -int tmonitor_update(int id) +int pass_resource_monitor_update(int id) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -403,7 +404,7 @@ int tmonitor_update(int id) } EXPORT -int tmonitor_update_resource(int id, int resource_id) +int pass_resource_monitor_update_resource(int id, int resource_id) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -436,7 +437,7 @@ int tmonitor_update_resource(int id, int resource_id) } -static int tmonitor_get_json(int id, char *json_string, int request_type, ...) +static int pass_resource_monitor_get_json(int id, char *json_string, int request_type, ...) { int buffer_len, response_req, ret, resource_id; u_int64_t attr_id; @@ -499,19 +500,19 @@ static int tmonitor_get_json(int id, char *json_string, int request_type, ...) } EXPORT -int tmonitor_get_resource_json(int id, int resource_id, char *json_string) +int pass_resource_monitor_get_resource_json(int id, int resource_id, char *json_string) { - return tmonitor_get_json(id, json_string, REQUEST_GET_RESOURCE_JSON, resource_id); + return pass_resource_monitor_get_json(id, json_string, REQUEST_GET_RESOURCE_JSON, resource_id); } EXPORT -int tmonitor_get_value_json(int id, int resource_id, u_int64_t attr_id, char *json_string) +int pass_resource_monitor_get_value_json(int id, int resource_id, u_int64_t attr_id, char *json_string) { - return tmonitor_get_json(id, json_string, REQUEST_GET_VALUE_JSON, resource_id, attr_id); + return pass_resource_monitor_get_json(id, json_string, REQUEST_GET_VALUE_JSON, resource_id, attr_id); } EXPORT -int tmonitor_get_value_int(int id, int resource_id, u_int64_t attr_id, int32_t *value) +int pass_resource_monitor_get_value_int(int id, int resource_id, u_int64_t attr_id, int32_t *value) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -545,7 +546,7 @@ int tmonitor_get_value_int(int id, int resource_id, u_int64_t attr_id, int32_t * } EXPORT -int tmonitor_get_value_int64(int id, int resource_id, u_int64_t attr_id, int64_t *value) +int pass_resource_monitor_get_value_int64(int id, int resource_id, u_int64_t attr_id, int64_t *value) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -579,7 +580,7 @@ int tmonitor_get_value_int64(int id, int resource_id, u_int64_t attr_id, int64_t } EXPORT -int tmonitor_get_value_uint(int id, int resource_id, u_int64_t attr_id, u_int32_t *value) +int pass_resource_monitor_get_value_uint(int id, int resource_id, u_int64_t attr_id, u_int32_t *value) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -613,7 +614,7 @@ int tmonitor_get_value_uint(int id, int resource_id, u_int64_t attr_id, u_int32_ } EXPORT -int tmonitor_get_value_uint64(int id, int resource_id, u_int64_t attr_id, u_int64_t *value) +int pass_resource_monitor_get_value_uint64(int id, int resource_id, u_int64_t attr_id, u_int64_t *value) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -647,7 +648,7 @@ int tmonitor_get_value_uint64(int id, int resource_id, u_int64_t attr_id, u_int6 } EXPORT -int tmonitor_get_value_double(int id, int resource_id, u_int64_t attr_id, double *value) +int pass_resource_monitor_get_value_double(int id, int resource_id, u_int64_t attr_id, double *value) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -681,7 +682,7 @@ int tmonitor_get_value_double(int id, int resource_id, u_int64_t attr_id, double } EXPORT -int tmonitor_get_value_string(int id, int resource_id, u_int64_t attr_id, char *value) +int pass_resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr_id, char *value) { char buffer[GENERIC_BUFF_MAX + 1]; int buffer_len; @@ -715,7 +716,7 @@ int tmonitor_get_value_string(int id, int resource_id, u_int64_t attr_id, char * } static int -tmonitor_get_array(int id, int res_id, u_int64_t attr_id, int data_type, void **array, int *length) +pass_resource_monitor_get_array(int id, int res_id, u_int64_t attr_id, int data_type, void **array, int *length) { char *array_item, *array_str, *buffer; int array_len, array_type; @@ -889,37 +890,37 @@ out_free: } EXPORT -int tmonitor_get_array_int(int id, int res_id, u_int64_t attr_id, int32_t **array, int *length) +int pass_resource_monitor_get_array_int(int id, int res_id, u_int64_t attr_id, int32_t **array, int *length) { - return tmonitor_get_array(id, res_id, attr_id, DATA_TYPE_INT, (void **)array, length); + return pass_resource_monitor_get_array(id, res_id, attr_id, DATA_TYPE_INT, (void **)array, length); } EXPORT -int tmonitor_get_array_int64(int id, int res_id, u_int64_t attr_id, int64_t **array, int *length) +int pass_resource_monitor_get_array_int64(int id, int res_id, u_int64_t attr_id, int64_t **array, int *length) { - return tmonitor_get_array(id, res_id, attr_id, DATA_TYPE_INT64, (void **)array, length); + return pass_resource_monitor_get_array(id, res_id, attr_id, DATA_TYPE_INT64, (void **)array, length); } EXPORT -int tmonitor_get_array_uint(int id, int res_id, u_int64_t attr_id, u_int32_t **array, int *length) +int pass_resource_monitor_get_array_uint(int id, int res_id, u_int64_t attr_id, u_int32_t **array, int *length) { - return tmonitor_get_array(id, res_id, attr_id, DATA_TYPE_UINT, (void **)array, length); + return pass_resource_monitor_get_array(id, res_id, attr_id, DATA_TYPE_UINT, (void **)array, length); } EXPORT -int tmonitor_get_array_uint64(int id, int res_id, u_int64_t attr_id, u_int64_t **array, int *length) +int pass_resource_monitor_get_array_uint64(int id, int res_id, u_int64_t attr_id, u_int64_t **array, int *length) { - return tmonitor_get_array(id, res_id, attr_id, DATA_TYPE_UINT64, (void **)array, length); + return pass_resource_monitor_get_array(id, res_id, attr_id, DATA_TYPE_UINT64, (void **)array, length); } EXPORT -int tmonitor_get_array_double(int id, int res_id, u_int64_t attr_id, double **array, int *length) +int pass_resource_monitor_get_array_double(int id, int res_id, u_int64_t attr_id, double **array, int *length) { - return tmonitor_get_array(id, res_id, attr_id, DATA_TYPE_DOUBLE, (void **)array, length); + return pass_resource_monitor_get_array(id, res_id, attr_id, DATA_TYPE_DOUBLE, (void **)array, length); } EXPORT -int tmonitor_get_array_string(int id, int res_id, u_int64_t attr_id, char ***array, int *length) +int pass_resource_monitor_get_array_string(int id, int res_id, u_int64_t attr_id, char ***array, int *length) { - return tmonitor_get_array(id, res_id, attr_id, DATA_TYPE_STRING, (void **)array, length); + return pass_resource_monitor_get_array(id, res_id, attr_id, DATA_TYPE_STRING, (void **)array, length); } diff --git a/lib/tmonitor/tmonitor.h b/lib/resource-monitor/resource-monitor.h similarity index 70% rename from lib/tmonitor/tmonitor.h rename to lib/resource-monitor/resource-monitor.h index cee45ea..3b1b6cb 100644 --- a/lib/tmonitor/tmonitor.h +++ b/lib/resource-monitor/resource-monitor.h @@ -1,5 +1,5 @@ /* - * PASS (Power Aware System Service) - Tizen Monitor Header File + * PASS (Power Aware System Service) - Resource Monitor Header File * * Copyright (c) 2022 Samsung Electronics Co., Ltd. * @@ -16,8 +16,8 @@ * limitations under the License. */ -#ifndef __TMONITOR__ -#define __TMONITOR__ +#ifndef __RESOURCE_MONITOR__ +#define __RESOURCE_MONITOR__ #include #include @@ -131,137 +131,137 @@ extern "C" { #define PROCESS_GROUP_CTRL_ROOT_PID BIT(0) /** - * @brief Initialize the tizen monitor - * @return @c positive integer as tizen monitor id on success, otherwise a negative error value + * @brief Initialize the resource monitor + * @return @c positive integer as resource monitor id on success, otherwise a negative error value */ -int tmonitor_init(void); +int pass_resource_monitor_init(void); /** * @brief Exit the tizem monitor - * @param[in] Id of tizen monitor which be returnted by tmonitor_init + * @param[in] Id of resource monitor which be returnted by pass_resource_monitor_init * @return @c 0 on success, otherwise a negative error value */ -int tmonitor_exit(int id); +int pass_resource_monitor_exit(int id); /** * @brief Get the count of supported resources according to resource type - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource type * @return @c positive integer as resource count on success, otherwise a negative error value */ -int tmonitor_get_resource_count(int id, int resource_type); +int pass_resource_monitor_get_resource_count(int id, int resource_type); /** * @brief Create resource for given resource_type - * @param[in] Tizen monitor id which be returnted by tmonitor_init + * @param[in] Resource monitor id which be returnted by pass_resource_monitor_init * @param[in] Resource type * @return @c positive integer as resource id on success, otherwise a negative error value */ -int tmonitor_create_resource(int id, int resource_type); +int pass_resource_monitor_create_resource(int id, int resource_type); /** * @brief Delete resource of given resource id - * @param[in] Tizen monitor id which be returnted by tmonitor_init + * @param[in] Resource monitor id which be returnted by pass_resource_monitor_init * @param[in] Resource id * @return @c 0 on success, otherwise a negative error value */ -int tmonitor_delete_resource(int id, int resource_id); +int pass_resource_monitor_delete_resource(int id, int resource_id); /** * @brief Set the resource control with value which is diffierential according to resource control id - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Resource control id * @param[in] Value for resource control id * @return @c 0 on success, otherwise a negative error value */ -int tmonitor_set_resource_ctrl(int id, int resource_id, u_int64_t ctrl_id, int value); +int pass_resource_monitor_set_resource_ctrl(int id, int resource_id, u_int64_t ctrl_id, int value); /** * @brief Set the interested attributes for monitoring - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Attribute mask including the various attributes * @return @c 0 on success, otherwise a negative error value */ -int tmonitor_set_resource_attr(int id, int resource_id, u_int64_t attr_mask); +int pass_resource_monitor_set_resource_attr(int id, int resource_id, u_int64_t attr_mask); /** * @brief Unset the interested attributes for monitoring - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Attribute mask including the various attributes * @return @c 0 on success, otherwise a negative error value */ -int tmonitor_unset_resource_attr(int id, int resource_id, u_int64_t attr_mask); +int pass_resource_monitor_unset_resource_attr(int id, int resource_id, u_int64_t attr_mask); /** * @brief Check whether a resouce attribute is supported or not - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Resource attribute id * @return @c 0 on success, otherwise a negative error value */ -bool tmonitor_is_resource_attr_supported(int id, int resource_id, u_int64_t attr_id); +bool pass_resource_monitor_is_resource_attr_supported(int id, int resource_id, u_int64_t attr_id); /** * @brief Update value of the interested attributes for all created resource - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @return @c 0 on success, otherwise a negative error value */ -int tmonitor_update(int id); +int pass_resource_monitor_update(int id); /** * @brief Update value of the interested attributes for a resource - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @return @c 0 on success, otherwise a negative error value */ -int tmonitor_update_resource(int id, int resource_id); +int pass_resource_monitor_update_resource(int id, int resource_id); /** * @brief Get all value in interesting attributes of resource by the JSON string format - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @param[out] JSON type string for resource * @return @c positive integer as resource count on success, otherwise a negative error value */ -int tmonitor_get_resource_json(int id, int resource_id, char *json_string); +int pass_resource_monitor_get_resource_json(int id, int resource_id, char *json_string); /** * @brief Get [int/int64/uint/uint64/double/string] value of resource attribute - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Resource attribute id * @param[out] Value retrieved from resource attribute * @return @ 0 on success, otherwise a negative error value */ -int tmonitor_get_value_json(int id, int resource_id, u_int64_t attr, char *json_string); -int tmonitor_get_value_int(int id, int resource_id, u_int64_t attr, int32_t *value); -int tmonitor_get_value_int64(int id, int resource_id, u_int64_t attr, int64_t *value); -int tmonitor_get_value_uint(int id, int resource_id, u_int64_t attr, u_int32_t *value); -int tmonitor_get_value_uint64(int id, int resource_id, u_int64_t attr, u_int64_t *value); -int tmonitor_get_value_double(int id, int resource_id, u_int64_t attr, double *value); -int tmonitor_get_value_string(int id, int resource_id, u_int64_t attr, char *value); +int pass_resource_monitor_get_value_json(int id, int resource_id, u_int64_t attr, char *json_string); +int pass_resource_monitor_get_value_int(int id, int resource_id, u_int64_t attr, int32_t *value); +int pass_resource_monitor_get_value_int64(int id, int resource_id, u_int64_t attr, int64_t *value); +int pass_resource_monitor_get_value_uint(int id, int resource_id, u_int64_t attr, u_int32_t *value); +int pass_resource_monitor_get_value_uint64(int id, int resource_id, u_int64_t attr, u_int64_t *value); +int pass_resource_monitor_get_value_double(int id, int resource_id, u_int64_t attr, double *value); +int pass_resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char *value); /** * @brief Get [int/int64/uint/uint64/double/string] array of resource attribute - * @param[in] Tizen monitor id + * @param[in] Resource monitor id * @param[in] Resource id * @param[in] Resource attribute id * @param[out] Array retrieved from resource attribute * @param[out] Length of array * @return @ 0 on success, otherwise a negative error value */ -int tmonitor_get_array_int(int id, int res_id, u_int64_t attr, int32_t **array, int *length); -int tmonitor_get_array_int64(int id, int res_id, u_int64_t attr, int64_t **array, int *length); -int tmonitor_get_array_uint(int id, int res_id, u_int64_t attr, u_int32_t **array, int *length); -int tmonitor_get_array_uint64(int id, int res_id, u_int64_t attr, u_int64_t **array, int *length); -int tmonitor_get_array_double(int id, int res_id, u_int64_t attr, double **array, int *length); -int tmonitor_get_array_string(int id, int res_id, u_int64_t attr, char ***array, int *length); +int pass_resource_monitor_get_array_int(int id, int res_id, u_int64_t attr, int32_t **array, int *length); +int pass_resource_monitor_get_array_int64(int id, int res_id, u_int64_t attr, int64_t **array, int *length); +int pass_resource_monitor_get_array_uint(int id, int res_id, u_int64_t attr, u_int32_t **array, int *length); +int pass_resource_monitor_get_array_uint64(int id, int res_id, u_int64_t attr, u_int64_t **array, int *length); +int pass_resource_monitor_get_array_double(int id, int res_id, u_int64_t attr, double **array, int *length); +int pass_resource_monitor_get_array_string(int id, int res_id, u_int64_t attr, char ***array, int *length); #ifdef __cplusplus } #endif -#endif /* __TMONITOR__ */ +#endif /* __RESOURCE_MONITOR__ */ diff --git a/packaging/libpass.manifest b/packaging/libpass-resource-monitor.manifest similarity index 100% rename from packaging/libpass.manifest rename to packaging/libpass-resource-monitor.manifest diff --git a/packaging/libpass.pc.in b/packaging/libpass-resource-monitor.pc.in similarity index 81% rename from packaging/libpass.pc.in rename to packaging/libpass-resource-monitor.pc.in index 0f02466..5320335 100644 --- a/packaging/libpass.pc.in +++ b/packaging/libpass-resource-monitor.pc.in @@ -1,10 +1,10 @@ # Package Information for pkg-config -package_name=pass +package_name=pass-resource-monitor prefix=@PREFIX@ exec_prefix=@EXEC_PREFIX@ libdir=@LIBDIR@ -includedir=/usr/include/${package_name} +includedir=/usr/include/pass Name: ${package_name} Description: ${package_name} library diff --git a/packaging/pass.spec b/packaging/pass.spec index dd933af..a9820c8 100644 --- a/packaging/pass.spec +++ b/packaging/pass.spec @@ -3,7 +3,7 @@ %define daemon_name pass %define haltest_name pass-haltests %define unittest_name pass-unittest -%define libpass_name libpass +%define libpass_resource_monitor_name libpass-resource-monitor Name: %{daemon_name} Summary: Power Aware System Service @@ -13,7 +13,7 @@ Group: System/Kernel License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest -Source2: %{libpass_name}.manifest +Source2: %{libpass_resource_monitor_name}.manifest BuildRequires: cmake BuildRequires: pkgconfig(dlog) @@ -54,20 +54,20 @@ Requires: pass = %{version}-%{release} %description -n %{unittest_name} PASS unit test package with gtest -%package -n %{libpass_name} +%package -n %{libpass_resource_monitor_name} Summary: Tizen Monitor Library package Group: Development/Libraries Requires: pass = %{version}-%{release} -%description -n %{libpass_name} +%description -n %{libpass_resource_monitor_name} Tizen Monitor Library package -%package -n %{libpass_name}-devel +%package -n %{libpass_resource_monitor_name}-devel Summary: Tizen Monitor Headler Files Group: Development/Libraries Requires: pass = %{version}-%{release} -%description -n %{libpass_name}-devel +%description -n %{libpass_resource_monitor_name}-devel Tizen Monitor Headler Files %prep @@ -126,16 +126,16 @@ systemctl daemon-reload %defattr(-,root,root,-) %{_bindir}/pass-unittests -%files -n %{libpass_name} +%files -n %{libpass_resource_monitor_name} %license LICENSE -%manifest %{libpass_name}.manifest +%manifest %{libpass_resource_monitor_name}.manifest %defattr(-,root,root,-) %{_libdir}/*.so* -%files -n %{libpass_name}-devel +%files -n %{libpass_resource_monitor_name}-devel %license LICENSE -%manifest %{libpass_name}.manifest +%manifest %{libpass_resource_monitor_name}.manifest %defattr(-,root,root,-) %{_includedir}/%{name}/*.h -%{_libdir}/pkgconfig/%{libpass_name}.pc +%{_libdir}/pkgconfig/%{libpass_resource_monitor_name}.pc %{_libdir}/*.so* diff --git a/src/resource/resource-battery.c b/src/resource/resource-battery.c index d6e5b53..584fe2f 100644 --- a/src/resource/resource-battery.c +++ b/src/resource/resource-battery.c @@ -28,7 +28,7 @@ #include #include -#include +#include static int battery_get_info(const struct resource *res, const struct resource_attribute *attr, diff --git a/src/resource/resource-bus.c b/src/resource/resource-bus.c index 499fd5a..c7e9ab7 100644 --- a/src/resource/resource-bus.c +++ b/src/resource/resource-bus.c @@ -30,7 +30,7 @@ #include #include -#include +#include struct bus_context { char *device_name; diff --git a/src/resource/resource-cpu.c b/src/resource/resource-cpu.c index 2575ff5..c25a6c9 100644 --- a/src/resource/resource-cpu.c +++ b/src/resource/resource-cpu.c @@ -30,7 +30,7 @@ #include #include -#include +#include struct cpu_context { char *device_name; diff --git a/src/resource/resource-display.c b/src/resource/resource-display.c index 30c8f6c..33b8aee 100644 --- a/src/resource/resource-display.c +++ b/src/resource/resource-display.c @@ -31,7 +31,7 @@ #include #include -#include +#include #define DBUS_ENLIGHTENMENT_NAME "org.enlightenment.wm" #define DBUS_ENLIGHTENMENT_PATH "/org/enlightenment/wm" diff --git a/src/resource/resource-gpu.c b/src/resource/resource-gpu.c index ac232e7..b736650 100644 --- a/src/resource/resource-gpu.c +++ b/src/resource/resource-gpu.c @@ -30,7 +30,7 @@ #include #include -#include +#include struct gpu_context { char *device_name; diff --git a/src/resource/resource-memory.c b/src/resource/resource-memory.c index 7ad1061..f0b8782 100644 --- a/src/resource/resource-memory.c +++ b/src/resource/resource-memory.c @@ -31,7 +31,7 @@ #include #include -#include +#include #define PROC_MEM_INFO_MEM_AVAILABLE "MemAvailable" #define PROC_MEM_INFO_MEM_FREE "MemFree" diff --git a/src/resource/resource-process-group.c b/src/resource/resource-process-group.c index 90dec08..a56636d 100644 --- a/src/resource/resource-process-group.c +++ b/src/resource/resource-process-group.c @@ -21,7 +21,7 @@ #include #include -#include +#include #define PROC_DIR_PATH "/proc/" diff --git a/src/resource/resource-process.c b/src/resource/resource-process.c index 0e050af..5702c10 100644 --- a/src/resource/resource-process.c +++ b/src/resource/resource-process.c @@ -26,7 +26,7 @@ #include #include -#include +#include struct process_context { pid_t tgid; diff --git a/src/resource/resource-system.c b/src/resource/resource-system.c index 8eada2e..6f9f2a8 100644 --- a/src/resource/resource-system.c +++ b/src/resource/resource-system.c @@ -31,7 +31,7 @@ #include #include -#include +#include struct system_resouce_data { struct cpu_stat prev_avg;