media_server_LDADD = $(SQLITE3_LIBS) \
$(COMMON_LDADD) \
$(PHONESTATUS_LIBS) \
- $(SYSTEM_INFO_LIBS)
+ $(SYSTEM_INFO_LIBS) -lcapi-system-resource
media_server_LDADD += $(SECURITY_LIBS) \
$(USB_DEVICE_LIBS) \
media_scanner_v2_LDADD += $(USB_DEVICE_LIBS) \
$(POWER_DEFS_LIBS) \
- $(POWER_TV_LIBS)
+ $(POWER_TV_LIBS) -lcapi-system-resource
endif
######################################################
#mediadb_udpate
int ret = SQLITE_OK;
char *db_path = NULL;
char *sql = NULL;
-
+ MSAPI_DBG_ERR("need_write[%d]", need_write);
ret = ms_user_get_media_db_path(uid, &db_path);
MSAPI_RETVM_IF(ret != MS_MEDIA_ERR_NONE, MS_MEDIA_ERR_DB_INTERNAL, "ms_user_get_media_db_path failed");
/* Set for localized collate */
sqlite3_collation_needed(*db_handle, NULL, __media_db_collation_cb);
-
+ MSAPI_DBG_ERR("Finish");
return MS_MEDIA_ERR_NONE;
}
BuildRequires: pkgconfig(cynara-session)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(capi-system-device)
+BuildRequires: pkgconfig(capi-system-resource)
%if 0%{?gtests:1}
BuildRequires: pkgconfig(gmock)
%endif
*/
#include <malloc.h>
-
+#include <cpu-boosting.h>
#include "media-util.h"
#include "media-server-ipc.h"
#include "media-common-utils.h"
ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
int end_flag = NORMAL_EVENT;
+ resource_pid_t stResource = {};
+ stResource.pid = getpid();
+
+ if(0 != resource_set_cpu_boosting(stResource, CPU_BOOSTING_LEVEL_MEDIUM, (cpu_boosting_flag_e)0, -1)) {
+ MS_DBG_ERR("Start CPU Boost 0 Failed[%d]", stResource.pid);
+ }
+ else {
+ MS_DBG_ERR("Start CPU Boost 0, pid[%d]", stResource.pid);
+ }
+
while (1) {
__msc_set_storage_extract_status(MS_STORAGE_SCAN_DONE);
extract_data = g_async_queue_pop(storage_extract_queue);
if (extract_data->pid == POWEROFF) {
MS_DBG_ERR("power off");
MS_SAFE_FREE(extract_data);
+ resource_clear_cpu_boosting(stResource);
return NULL;
}
_POWEROFF:
MS_SAFE_FREE(extract_data);
ms_disconnect_db(handle);
+ resource_clear_cpu_boosting(stResource);
return NULL;
}
#include <malloc.h>
#include <dirent.h>
-
+#include <cpu-boosting.h>
#include "media-util.h"
#include "media-server-ipc.h"
#include "media-common-utils.h"
if (msg_type == MS_MSG_DIRECTORY_SCANNING || msg_type == MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE) {
g_mutex_lock(&scan_req_mutex2);
/* check cancel path */
- //MS_DBG_ERR("__msc_check_stop_status...");
+ MS_DBG_ERR("__msc_check_stop_status...");
if ((cancel_scan_item != NULL) && (cancel_scan_item->path != NULL)) {
MS_DBG_SWARN("check blocked storage [%s][%s]", cancel_scan_item->path, start_path);
if ((strncmp(cancel_scan_item->path, start_path, strlen(cancel_scan_item->path)) == 0)
sleep_count = 0;
dir = opendir(current_path);
+ MS_DBG_ERR("opendir[%s]", current_path);
if (dir == NULL) {
MS_DBG_ERR("g_dir_open fails [%s]", current_path);
MS_SAFE_FREE(current_path);
if (ret != MS_MEDIA_ERR_NONE)
MS_DBG_INFO("ret : %d", ret);
+ MS_DBG_ERR("End scan");
+
return ret;
}
if (ret != MS_MEDIA_ERR_NONE)
MS_DBG_INFO("ret : %d", ret);
+ MS_DBG_ERR("End scan");
+
return ret;
}
int err = MS_MEDIA_ERR_NONE;
char *start_path = NULL;
+ resource_pid_t stResource = {};
+ stResource.pid = getpid();
+
+ if(0 != resource_set_cpu_boosting(stResource, CPU_BOOSTING_LEVEL_MEDIUM, (cpu_boosting_flag_e)0, -1)) {
+ MS_DBG_ERR("Start CPU Boost 0 Failed[%d]", stResource.pid);
+ }
+ else {
+ MS_DBG_ERR("Start CPU Boost 0, pid[%d]", stResource.pid);
+ }
+
if (scan_data->msg_type != MS_MSG_STORAGE_INVALID) {
MS_DBG_WARN("INSERT");
start_path = g_strdup(scan_data->msg);
msc_remove_extract_request(scan_data);
}
+ MS_DBG_ERR("start to sync[%d]", stResource.pid);
sync();
+ MS_DBG_ERR("end sync[%d]", stResource.pid);
+ resource_clear_cpu_boosting(stResource);
return err;
}
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <cpu-boosting.h>
#include "media-common-utils.h"
#include "media-common-external-storage.h"
int err = -1;
int fd = -1;
+ resource_pid_t stResource = {};
+ stResource.pid = getpid();
+ if(0 != resource_set_cpu_boosting(stResource, CPU_BOOSTING_LEVEL_MEDIUM, (cpu_boosting_flag_e)0, -1)) {
+ MS_DBG_ERR("Start CPU Boost 0 Failed[%d]", stResource.pid);
+ } else {
+ MS_DBG_ERR("Start CPU Boost 0, pid[%d]", stResource.pid);
+ }
+
MS_DBG_INFO("Scanner-V2 start");
__msc_add_event_receiver();
err = mkfifo(MS_SCANNER_FIFO_PATH_REQ, MS_SCANNER_FIFO_MODE);
if (err != 0) {
MS_DBG_STRERROR("mkfifo failed");
+ resource_clear_cpu_boosting(stResource);
return MS_MEDIA_ERR_INTERNAL;
}
fd = open(MS_SCANNER_FIFO_PATH_REQ, O_RDWR);
if (fd < 0) {
MS_DBG_STRERROR("fifo open failed");
+ resource_clear_cpu_boosting(stResource);
return MS_MEDIA_ERR_INTERNAL;
}
msc_send_ready();
MS_DBG_INFO("Scanner-V2 is running");
+ resource_clear_cpu_boosting(stResource);
+
/*Set VIP Process*/
ms_set_vip_process();
ms_unload_functions();
EXIT:
+ resource_clear_cpu_boosting(stResource);
MS_DBG_INFO("Scanner-V2 is shutting down");
return 0;
}
#include <malloc.h>
#include <vconf.h>
#include <iniparser.h>
+#include <cpu-boosting.h>
#include "media-util.h"
#include "media-common-utils.h"
int ret = 0;
int sockfd = -1;
+ resource_pid_t stResource = {};
+ stResource.pid = getpid();
+ if(0 != resource_set_cpu_boosting(stResource, CPU_BOOSTING_LEVEL_MEDIUM, (cpu_boosting_flag_e)0, -1)) {
+ MS_DBG_ERR("Start CPU Boost 0 Failed[%d]", stResource.pid);
+ } else {
+ MS_DBG_ERR("Start CPU Boost 0, pid[%d]", stResource.pid);
+ }
+
ret = ms_load_functions();
if (ret != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("ms_load_functions failed [%d]", ret);
+ resource_clear_cpu_boosting(stResource);
return -1;
}
if (ms_cynara_initialize() != MS_MEDIA_ERR_NONE) {
ms_unload_functions();
MS_DBG_ERR("Failed to initialize cynara");
+ resource_clear_cpu_boosting(stResource);
return -1;
}
if (ms_ipc_create_server_socket(MS_SCANNER_PORT, &sockfd) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("Failed to create socket");
+ resource_clear_cpu_boosting(stResource);
return -1;
}
/*Set VIP Process*/
ms_set_vip_process();
#endif
+ resource_clear_cpu_boosting(stResource);
g_main_loop_run(mainloop);