change the log macro to be simply 54/11454/2
authorjy910.yun <jy910.yun@samsung.com>
Mon, 28 Oct 2013 08:50:08 +0000 (17:50 +0900)
committerjy910.yun <jy910.yun@samsung.com>
Mon, 28 Oct 2013 08:54:07 +0000 (17:54 +0900)
- there are many log macro in system-server:PRT_TRACE, PRT_ERR, ERR and so on.
- from now on, system-server uses just _D,_E,_I,_W,_SD,_SE,_SI and _SW.

Change-Id: I1101a3ae4a19cee74d258dae5c7f1f13d8e22e5e
Signed-off-by: jy910.yun <jy910.yun@samsung.com>
24 files changed:
packaging/system-server.changes
src/battery/lowbat-handler.c
src/bs/bs.c
src/core/core.c
src/core/device-change-handler.c
src/core/launch.c
src/core/log.h
src/core/main.c
src/core/noti.c
src/core/predefine.c
src/core/queue.c
src/core/sig-handler.c
src/core/sysnoti.c
src/cpu/cpu-handler.c
src/mmc/mmc-handler.c
src/proc/lowmem-handler.c
src/proc/pmon-handler.c
src/proc/procmgr.c
src/shared/log.h
src/ta/ta-handler.c
src/time/time-handler.c
src/usb/usb-handler.c
src/vibrator/vibrator.c
sys_pci_noti/sys_pci_noti.c

index 31be7ce..1f04aa7 100644 (file)
@@ -1,12 +1,15 @@
+* Mon Oct 28 2013 jy910.yun <jy910.yun@samsung.com> accepted/tizen/20130912.195534@b3501d1
+- change the log macro to be simply
+
 * Mon Oct 27 2013 Jiyoung Yun <jy910.yun@samsung.com> accepted/tizen/20130912.195534@09ee5a9
 - refactoring system-server code structure
 
-* Thu Aug 22 2013 Maciej Wereski <m.wereski@partner.samsung.com> accepted/tizen/20130710.221248@1177917
-- Move rc.shutdown from system-plugin-slp
-
 * Sun Aug 25 2013 Chengwei Yang <chengwei.yang@intel.com>
 - Remove debian packaging stuff
 
+* Thu Aug 22 2013 Maciej Wereski <m.wereski@partner.samsung.com> accepted/tizen/20130710.221248@1177917
+- Move rc.shutdown from system-plugin-slp
+
 * Thu Aug 22 2013 Maciej Wereski <m.wereski@partner.samsung.com> accepted/tizen/20130710.221248@a1019c4
 - fix typo in udev rules
 
index 07b30bd..c063ae7 100755 (executable)
@@ -90,7 +90,7 @@ static void print_lowbat_state(unsigned int bat_percent)
 #if 0
        int i;
        for (i = 0; i < BAT_MON_SAMPLES; i++)
-               PRT_TRACE("\t%d", recent_bat_percent[i]);
+               _D("\t%d", recent_bat_percent[i]);
 #endif
 }
 
@@ -125,7 +125,7 @@ static int battery_charge_act(void *data)
 int ss_lowbat_set_charge_on(int onoff)
 {
        if(vconf_set_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, onoff)!=0) {
-               PRT_TRACE_ERR("fail to set charge vconf value");
+               _E("fail to set charge vconf value");
                return -1;
        }
        return 0;
@@ -135,7 +135,7 @@ int ss_lowbat_is_charge_in_now()
 {
        int val = 0;
        if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &val) < 0) {
-               PRT_TRACE_ERR("fail to read charge now from kernel");
+               _E("fail to read charge now from kernel");
                ss_lowbat_set_charge_on(0);
                return 0;
        }
@@ -161,22 +161,22 @@ static int lowbat_process(int bat_percent, void *ad)
        if (new_bat_capacity < 0)
                return -1;
        if (new_bat_capacity != cur_bat_capacity) {
-               PRT_TRACE("[BAT_MON] cur = %d new = %d", cur_bat_capacity, new_bat_capacity);
+               _D("[BAT_MON] cur = %d new = %d", cur_bat_capacity, new_bat_capacity);
                if (vconf_set_int(VCONFKEY_SYSMAN_BATTERY_CAPACITY, new_bat_capacity) == 0)
                        cur_bat_capacity = new_bat_capacity;
        }
 
 
        if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &vconf_state) < 0) {
-               PRT_TRACE_ERR("vconf_get_int() failed");
+               _E("vconf_get_int() failed");
                return -1;
        }
 
        if (new_bat_capacity <= BATTERY_REAL_POWER_OFF) {
                if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &val) < 0) {
-                       PRT_TRACE_ERR("fail to read charge now from kernel");
+                       _E("fail to read charge now from kernel");
                }
-               PRT_TRACE("charge_now status %d",val);
+               _D("charge_now status %d",val);
                if (val == 1) {
                        new_bat_state = BATTERY_POWER_OFF;
                        if (vconf_state != VCONFKEY_SYSMAN_BAT_POWER_OFF)
@@ -247,7 +247,7 @@ static int lowbat_process(int bat_percent, void *ad)
                }
        }
 
-       PRT_TRACE("[BATMON] Unknown battery state cur:%d new:%d",cur_bat_state,new_bat_state);
+       _D("[BATMON] Unknown battery state cur:%d new:%d",cur_bat_state,new_bat_state);
        cur_bat_state = new_bat_state;
 
        if (new_bat_capacity != cur_bat_capacity)
@@ -275,7 +275,7 @@ static void __ss_change_lowbat_level(int bat_percent)
                return;
 
        if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_LEVEL_STATUS, &prev) < 0) {
-               PRT_TRACE_ERR("vconf_get_int() failed");
+               _E("vconf_get_int() failed");
                return;
        }
 
@@ -305,7 +305,7 @@ static int __check_lowbat_percent(int *pct)
                ecore_timer_interval_set(lowbat_timer, BAT_MON_INTERVAL_MIN);
                bat_err_count++;
                if (bat_err_count > MAX_BATTERY_ERROR) {
-                       PRT_TRACE_ERR
+                       _E
                            ("[BATMON] Cannot read battery gage. stop read fuel gage");
                        return -ENODEV;
                }
@@ -355,9 +355,9 @@ static int check_battery()
        int ret = -1;
 
        if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_PRESENT, &ret) < 0) {
-               PRT_TRACE_ERR("[BATMON] battery check : %d", ret);
+               _E("[BATMON] battery check : %d", ret);
        }
-       PRT_TRACE("[BATMON] battery check : %d", ret);
+       _D("[BATMON] battery check : %d", ret);
 
        return ret;
 }
index 33ec8cd..b1cb978 100644 (file)
@@ -84,7 +84,7 @@ static int make_noti_file(const char *path, const char *file)
        struct group *group_entry;
        mode_t old_mask;
 
-       PRT_TRACE("Make Noti File");
+       _D("Make Noti File");
        snprintf(buf, sizeof(buf), "%s/%s", path, file);        /* buf - full path to file */
        if (access(buf, F_OK) == 0)                             /* if file exists then return -1 */
                return -1;
@@ -115,7 +115,7 @@ static int make_coredump_dir(void)
        gid_t group_id;
        struct group *group_entry;
 
-       PRT_TRACE("Make core dump directory");
+       _D("Make core dump directory");
        if (access(CRASH_COREDUMP_PATH, F_OK) == 0)                             /* if file exists then return -1 */
                return -1;
 
@@ -139,7 +139,7 @@ static int make_info_dir(void)
        gid_t group_id;
        struct group *group_entry;
 
-       PRT_TRACE("Make crash info directory");
+       _D("Make crash info directory");
        if (access(CRASH_INFO_PATH, F_OK) == 0)                         /* if file exists then return -1 */
                return -1;
 
@@ -164,7 +164,7 @@ static int clean_coredump_dir(void)
        int dfd;
        dir = opendir(CRASH_COREDUMP_PATH);
        if (!dir) {
-               PRT_TRACE_ERR("opendir failed");
+               _E("opendir failed");
                return 0;
        }
        dfd = dirfd(dir);
@@ -177,7 +177,7 @@ static int clean_coredump_dir(void)
                        if ((name[1] == '.') && (name[2] == 0)) continue;
                }
                if (unlinkat(dfd, name, 0) < 0) {
-                       PRT_TRACE_ERR("clean_coredump_dir (%s)",name);
+                       _E("clean_coredump_dir (%s)",name);
                        continue;
                }
        }
@@ -192,7 +192,7 @@ static int clean_dump_dir(void)
 
        dir = opendir(CRASH_DUMP_PATH);
        if (!dir) {
-               PRT_TRACE_ERR("opendir failed");
+               _E("opendir failed");
                return 0;
        }
        while ((dp = readdir(dir)) != NULL) {
@@ -205,7 +205,7 @@ static int clean_dump_dir(void)
                        }
                        snprintf(dirname, sizeof(dirname), "%s/%s", CRASH_DUMP_PATH, name);
                        if (ecore_file_recursive_rm(dirname) == EINA_FALSE) {
-                               PRT_TRACE_ERR("clean_dump_dir (%s)",dirname);
+                               _E("clean_dump_dir (%s)",dirname);
                                continue;
                        }
                }
@@ -220,7 +220,7 @@ static int clean_info_dir(void)
        int dfd;
        dir = opendir(CRASH_INFO_PATH);
        if (!dir) {
-               PRT_TRACE_ERR("opendir failed");
+               _E("opendir failed");
                return 0;
        }
        dfd = dirfd(dir);
@@ -233,7 +233,7 @@ static int clean_info_dir(void)
                        if ((name[1] == '.') && (name[2] == 0)) continue;
                }
                if (unlinkat(dfd, name, 0) < 0) {
-                       PRT_TRACE_ERR("clean_info_dir (%s)",name);
+                       _E("clean_info_dir (%s)",name);
                        continue;
                }
        }
@@ -247,48 +247,48 @@ static int crash_arg_parser(char *linebuffer, struct crash_arg *arg)
        int verify_arg_num = 0;
 
        if (linebuffer == NULL || arg == NULL) {
-               PRT_TRACE_ERR("crash_arg_parser input arguments is NULL");
+               _E("crash_arg_parser input arguments is NULL");
                return -1;
        }
        ptr = strtok(linebuffer, CRASH_DELIMITER);
        if (ptr == NULL) {
-               PRT_TRACE_ERR("can't strtok linebuffer ptr(%s)", ptr);
+               _E("can't strtok linebuffer ptr(%s)", ptr);
                return -1;
        }
        snprintf(arg->crash_mode, CRASH_MODE_MAX, "%s",  ptr);
        ptr = strtok(NULL, CRASH_DELIMITER);
        if (ptr == NULL) {
-               PRT_TRACE_ERR("can't strtok linebuffer ptr(%s)", ptr);
+               _E("can't strtok linebuffer ptr(%s)", ptr);
                return -1;
        }
        snprintf(arg->crash_processname, CRASH_PROCESSNAME_MAX, "%s",  ptr);
        ptr = strtok(NULL, CRASH_DELIMITER);
        if (ptr == NULL) {
-               PRT_TRACE_ERR("can't strtok linebuffer ptr(%s)", ptr);
+               _E("can't strtok linebuffer ptr(%s)", ptr);
                return -1;
        }
        snprintf(arg->crash_timestr, CRASH_TIME_MAX, "%s", ptr);
        ptr = strtok(NULL, CRASH_DELIMITER);
        if (ptr == NULL) {
-               PRT_TRACE_ERR("can't strtok linebuffer ptr(%s)", ptr);
+               _E("can't strtok linebuffer ptr(%s)", ptr);
                return -1;
        }
        snprintf(arg->crash_pid, CRASH_PID_MAX, "%s", ptr);
        ptr = strtok(NULL, CRASH_DELIMITER);
        if (ptr == NULL) {
-               PRT_TRACE_ERR("can't strtok linebuffer ptr(%s)", ptr);
+               _E("can't strtok linebuffer ptr(%s)", ptr);
                return -1;
        }
        snprintf(arg->crash_exepath, CRASH_EXEPATH_MAX, "%s", ptr);
        ptr = strtok(NULL, CRASH_DELIMITER);
        if (ptr == NULL) {
-               PRT_TRACE_ERR("can't strtok linebuffer ptr(%s)", ptr);
+               _E("can't strtok linebuffer ptr(%s)", ptr);
                return -1;
        }
        snprintf(arg->crash_verify, CRASH_VERIFY_MAX, "%s", ptr);
        verify_num = strlen(arg->crash_processname) + strlen(arg->crash_exepath);
        verify_arg_num = atoi(arg->crash_verify);
-       PRT_TRACE("vnum %d vanum %d", verify_num, verify_arg_num);
+       _D("vnum %d vanum %d", verify_num, verify_arg_num);
        if (verify_num == verify_arg_num)
                return 1;
        else
@@ -311,7 +311,7 @@ static void launch_crash_worker(const char *filename, int popup_on)
        while (fgets(linebuffer, CRASH_ARG_MAX, fp) != NULL) {
                len = strlen(linebuffer);
                if (!len || linebuffer[len - 1] != '\n') {
-                       PRT_TRACE_ERR("crash inoti msg  must be terminated with new line character\n");
+                       _E("crash inoti msg  must be terminated with new line character\n");
                        break;
                }
                /* change last caracter from \n to \0 */
@@ -321,8 +321,8 @@ static void launch_crash_worker(const char *filename, int popup_on)
                snprintf(crash_worker_args, sizeof(crash_worker_args), "%s %s %s %s %s",
                                parsing_arg.crash_mode, parsing_arg.crash_processname,
                                parsing_arg.crash_timestr, parsing_arg.crash_pid, parsing_arg.crash_exepath);
-               PRT_TRACE("crash_worker args(%s)", crash_worker_args);
-               PRT_TRACE("(%s%s%s)", parsing_arg.crash_mode,
+               _D("crash_worker args(%s)", crash_worker_args);
+               _D("(%s%s%s)", parsing_arg.crash_mode,
                                parsing_arg.crash_processname, parsing_arg.crash_timestr);
                ret = ss_launch_evenif_exist (CRASH_WORKER_PATH, crash_worker_args);
                if (ret > 0) {
@@ -341,7 +341,7 @@ static void launch_crash_worker(const char *filename, int popup_on)
                }
 
                if (popup_pid < 0) {
-                       PRT_TRACE_ERR("popup failed)\n");
+                       _E("popup failed)\n");
                        break;
                }
        }
@@ -412,7 +412,7 @@ static int _check_disk_available(void)
 int ss_bs_init(void)
 {
        if (make_noti_file(CRASH_NOTI_DIR, CRASH_NOTI_FILE) < 0) {
-               PRT_TRACE_ERR("make_noti_file() failed");
+               _E("make_noti_file() failed");
                launch_crash_worker(CRASH_NOTI_PATH, CRASH_POPUP_OFF);
        }
        if (make_info_dir() < 0) {
@@ -428,13 +428,13 @@ int ss_bs_init(void)
                clean_dump_dir();
 
        if (ecore_file_init() == 0) {
-               PRT_TRACE_ERR("ecore_file_init() failed");
+               _E("ecore_file_init() failed");
                launch_crash_worker(CRASH_NOTI_PATH, CRASH_POPUP_OFF);
        }
 
        crash_file_monitor = ecore_file_monitor_add(CRASH_NOTI_PATH,(void *) __crash_file_cb, NULL);
        if (!crash_file_monitor) {
-               PRT_TRACE_ERR("ecore_file_monitor_add() failed");
+               _E("ecore_file_monitor_add() failed");
                launch_crash_worker(CRASH_NOTI_PATH, CRASH_POPUP_OFF);
                return -1;
        }
index 3474d2c..bb1baaf 100644 (file)
@@ -49,7 +49,7 @@ static int _ss_core_action_run(void *user_data,
        ret = act_entry->predefine_action(rq_entry->argc, rq_entry->argv);
        if (ret <= 0) {
                if (ret < 0)
-                       PRT_TRACE_ERR("[SYSMAN] predefine action failed");
+                       _E("[SYSMAN] predefine action failed");
                goto fast_done;
        } else {
                snprintf(tmp, sizeof(tmp), "/proc/%d/status", ret);
@@ -74,7 +74,7 @@ static int core_pipe_cb(void *userdata, Ecore_Fd_Handler * fd_handler)
        int retry_count = 0;
        int r = -1;
        if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ)) {
-               PRT_TRACE_ERR
+               _E
                    ("ecore_main_fd_handler_active_get error , return\n");
                return 1;
        }
@@ -83,13 +83,13 @@ static int core_pipe_cb(void *userdata, Ecore_Fd_Handler * fd_handler)
                r = read(core_pipe[0], &p_msg, sizeof(struct _internal_msg));
                if (r < 0) {
                        if (errno == EINTR) {
-                               PRT_TRACE_ERR("Re-read for error(EINTR)");
+                               _E("Re-read for error(EINTR)");
                                retry_count++;
                                continue;
                        } else {
                                __pipe_stop(core_pipe[0]);
                                __pipe_stop(core_pipe[1]);
-                               PRT_TRACE_ERR("restart pipe fd");
+                               _E("restart pipe fd");
                                __pipe_start(ad);
                        }
                } else {
@@ -136,7 +136,7 @@ int ss_core_init(struct ss_main_data *ad)
        __pipe_stop(core_pipe[1]);
 
        if (__pipe_start(ad) == -1) {
-               PRT_TRACE_ERR("fail pipe control fd init");
+               _E("fail pipe control fd init");
                return -1;
        }
        return 0;
@@ -145,14 +145,14 @@ int ss_core_init(struct ss_main_data *ad)
 static int __pipe_start(struct ss_main_data *ad)
 {
        if (pipe(core_pipe) < 0) {
-               PRT_TRACE_ERR("pipe cannot create");
+               _E("pipe cannot create");
                exit(EXIT_FAILURE);
        }
 
        g_pipe_efd = ecore_main_fd_handler_add(core_pipe[0], ECORE_FD_READ,
                                  core_pipe_cb, ad, NULL, NULL);
        if (!g_pipe_efd) {
-               PRT_TRACE_ERR("error ecore_main_fd_handler_add");
+               _E("error ecore_main_fd_handler_add");
                return -1;
        }
        return 0;
index 36ec7a7..648a923 100755 (executable)
@@ -128,12 +128,12 @@ static int check_lowbat_charge_device(int bInserted)
                                                        bundle_add(b, "_SYSPOPUP_CONTENT_", "warning");
                                                ret = syspopup_launch("lowbat-syspopup", b);
                                                if (ret < 0) {
-                                                       PRT_TRACE_EM("popup lauch failed\n");
+                                                       _I("popup lauch failed\n");
                                                }
                                                bundle_free(b);
                                        }
                                } else {
-                                       PRT_TRACE_ERR("failed to get vconf key");
+                                       _E("failed to get vconf key");
                                        return -1;
                                }
                        }
@@ -156,15 +156,15 @@ static void usb_chgdet_cb(struct ss_main_data *ad)
        ss_lowbat_monitor(NULL);
        ss_action_entry_call_internal(PREDEF_USBCON, 0);
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_USB_ONLINE, &val) == 0) {
-               PRT_TRACE("jack - usb changed %d",val);
+               _D("jack - usb changed %d",val);
                check_lowbat_charge_device(val);
                if (val==1) {
                        snprintf(params, sizeof(params), "%d", CB_NOTI_BATT_CHARGE);
                        ss_launch_if_noexist("/usr/bin/sys_device_noti", params);
-                       PRT_TRACE("usb device notification");
+                       _D("usb device notification");
                }
        } else {
-               PRT_TRACE_ERR("fail to get usb_online status");
+               _E("fail to get usb_online status");
        }
 }
 
@@ -195,7 +195,7 @@ static void ta_chgdet_cb(struct ss_main_data *ad)
        ss_lowbat_monitor(NULL);
 
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_TA_ONLINE, &val) == 0) {
-               PRT_TRACE("jack - ta changed %d",val);
+               _D("jack - ta changed %d",val);
                check_lowbat_charge_device(val);
                vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS, val);
                if (val == 0) {
@@ -204,31 +204,31 @@ static void ta_chgdet_cb(struct ss_main_data *ad)
                        pm_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
                        snprintf(params, sizeof(params), "%d", CB_NOTI_BATT_CHARGE);
                        ss_launch_if_noexist("/usr/bin/sys_device_noti", params);
-                       PRT_TRACE("ta device notification");
+                       _D("ta device notification");
                }
                __sync_usb_status();
        }
        else
-               PRT_TRACE_ERR("failed to get ta status\n");
+               _E("failed to get ta status\n");
 }
 
 static void earjack_chgdet_cb(struct ss_main_data *ad)
 {
-       PRT_TRACE("jack - earjack changed\n");
+       _D("jack - earjack changed\n");
        ss_action_entry_call_internal(PREDEF_EARJACKCON, 0);
 }
 
 static void earkey_chgdet_cb(struct ss_main_data *ad)
 {
        int val;
-       PRT_TRACE("jack - earkey changed\n");
+       _D("jack - earkey changed\n");
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_EARKEY_ONLINE, &val) == 0)
                vconf_set_int(VCONFKEY_SYSMAN_EARJACKKEY, val);
 }
 
 static void tvout_chgdet_cb(struct ss_main_data *ad)
 {
-       PRT_TRACE("jack - tvout changed\n");
+       _D("jack - tvout changed\n");
        pm_change_state(LCD_NORMAL);
 }
 
@@ -240,20 +240,20 @@ static void hdmi_chgdet_cb(struct ss_main_data *ad)
        pm_change_state(LCD_NORMAL);
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_HDMI_SUPPORT, &val) == 0) {
                if (val!=1) {
-                       PRT_TRACE_ERR("target is not support HDMI");
+                       _E("target is not support HDMI");
                        vconf_set_int(VCONFKEY_SYSMAN_HDMI, HDMI_NOT_SUPPORTED);
                        return;
                }
        }
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_HDMI_ONLINE, &val) == 0) {
-               PRT_TRACE("jack - hdmi changed %d",val);
+               _D("jack - hdmi changed %d",val);
                vconf_set_int(VCONFKEY_SYSMAN_HDMI,val);
                if(val == 1)
                        pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0);
                else
                        pm_unlock_state(LCD_NORMAL, PM_SLEEP_MARGIN);
        } else {
-               PRT_TRACE_ERR("failed to get hdmi_online status");
+               _E("failed to get hdmi_online status");
        }
 }
 
@@ -262,7 +262,7 @@ static void keyboard_chgdet_cb(struct ss_main_data *ad)
        int val = -1;
 
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_KEYBOARD_ONLINE, &val) == 0) {
-               PRT_TRACE("jack - keyboard changed %d",val);
+               _D("jack - keyboard changed %d",val);
                if(val != 1)
                        val = 0;
                vconf_set_int(VCONFKEY_SYSMAN_SLIDING_KEYBOARD, val);
@@ -292,7 +292,7 @@ static void mmc_chgdet_cb(void *data)
                if (!inserted)
                        return;
                inserted = false;
-               PRT_TRACE("mmc removed");
+               _D("mmc removed");
                ss_mmc_removed();
        } else {
                /* when inserted mmc, emul kernel notify twice(insert, changed)
@@ -300,7 +300,7 @@ static void mmc_chgdet_cb(void *data)
                if (inserted)
                        return;
                inserted = true;
-               PRT_TRACE("mmc added");
+               _D("mmc added");
                ret = ss_mmc_inserted();
                if (ret == -1) {
                        vconf_get_int(VCONFKEY_SYSMAN_MMC_MOUNT,&val);
@@ -308,26 +308,26 @@ static void mmc_chgdet_cb(void *data)
                                bundle *b = NULL;
                                b = bundle_create();
                                if (b == NULL) {
-                                       PRT_TRACE_ERR("error bundle_create()");
+                                       _E("error bundle_create()");
                                        return;
                                }
                                bundle_add(b, "_SYSPOPUP_CONTENT_", "mounterr");
                                ret = syspopup_launch("mmc-syspopup", b);
                                if (ret < 0) {
-                                       PRT_TRACE_ERR("popup launch failed");
+                                       _E("popup launch failed");
                                }
                                bundle_free(b);
                        } else if (val == VCONFKEY_SYSMAN_MMC_MOUNT_COMPLETED) {
                                bundle *b = NULL;
                                b = bundle_create();
                                if (b == NULL) {
-                                       PRT_TRACE_ERR("error bundle_create()");
+                                       _E("error bundle_create()");
                                        return;
                                }
                                bundle_add(b, "_SYSPOPUP_CONTENT_", "mountrdonly");
                                ret = syspopup_launch("mmc-syspopup", b);
                                if (ret < 0) {
-                                       PRT_TRACE_ERR("popup launch failed");
+                                       _E("popup launch failed");
                                }
                                bundle_free(b);
                        }
@@ -364,16 +364,16 @@ static void charge_cb(struct ss_main_data *ad)
 
        if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &charge_now) != 0 ||
            device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &capacity) != 0)
-               PRT_TRACE_ERR("fail to get battery node value");
+               _E("fail to get battery node value");
        if (charge_now == 0 && capacity == 0) {
-               PRT_TRACE_ERR("target will be shut down");
+               _E("target will be shut down");
                ss_action_entry_call_internal(PREDEF_LOWBAT, 1, POWER_OFF_BAT_ACT);
                return;
        }
 
        if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_HEALTH, &val) == 0) {
                if (val==BATTERY_OVERHEAT || val==BATTERY_COLD) {
-                       PRT_TRACE_ERR("Battery health status is not good (%d)", val);
+                       _E("Battery health status is not good (%d)", val);
 
                        if (__check_abnormal_popup_launch() != 0)
                                return;
@@ -385,7 +385,7 @@ static void charge_cb(struct ss_main_data *ad)
                        return;
                }
        } else {
-               PRT_TRACE_ERR("failed to get battery health status");
+               _E("failed to get battery health status");
        }
        device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_FULL, &val);
        if (val==0) {
@@ -397,7 +397,7 @@ static void charge_cb(struct ss_main_data *ad)
        } else {
                if (val==1 && bat_full_noti==0) {
                        bat_full_noti = 1;
-                       PRT_TRACE("battery full noti");
+                       _D("battery full noti");
                        snprintf(params, sizeof(params), "%d %d", CB_NOTI_BATT_FULL, CB_NOTI_ON);
                        ss_launch_if_noexist("/usr/bin/sys_device_noti", params);
                }
@@ -425,45 +425,45 @@ static void cb_xxxxx_signaled(void *data, DBusMessage * msg)
 
 static void usb_host_chgdet_cb(keynode_t *in_key, struct ss_main_data *ad)
 {
-       PRT_TRACE("ENTER: usb_host_chgdet_cb()");
+       _D("ENTER: usb_host_chgdet_cb()");
        int status;
        int ret = vconf_get_int(VCONFKEY_SYSMAN_USB_HOST_STATUS, &status);
        if (ret != 0) {
-               PRT_TRACE_ERR("vconf get failed(VCONFKEY_SYSMAN_USB_HOST_STATUS)\n");
+               _E("vconf get failed(VCONFKEY_SYSMAN_USB_HOST_STATUS)\n");
                return ;
        }
 
        if(VCONFKEY_SYSMAN_USB_HOST_CONNECTED == status) {
                int pid = ss_launch_if_noexist(USBCON_EXEC_PATH, NULL);
                if (pid < 0) {
-                       PRT_TRACE("usb-server launching failed\n");
+                       _D("usb-server launching failed\n");
                        return;
                }
        }
-       PRT_TRACE("EXIT: usb_host_chgdet_cb()");
+       _D("EXIT: usb_host_chgdet_cb()");
 }
 
 static void usb_host_add_cb()
 {
-       PRT_TRACE("ENTER: usb_host_add_cb()\n");
+       _D("ENTER: usb_host_add_cb()\n");
        int status;
        int ret = vconf_get_int(VCONFKEY_SYSMAN_USB_HOST_STATUS, &status);
        if (ret != 0) {
-               PRT_TRACE("vconf get failed ()\n");
+               _D("vconf get failed ()\n");
                return;
        }
 
        if (-1 == status) { /* '-1' means that USB host mode is not loaded yet */
-               PRT_TRACE("This usb device is connected defaultly\n");
+               _D("This usb device is connected defaultly\n");
 
                ret = system(STORE_DEFAULT_USB_INFO);
-               PRT_TRACE("Return value of usb-devices: %d\n", ret);
+               _D("Return value of usb-devices: %d\n", ret);
                if (0 != access(DEFAULT_USB_INFO_PATH, F_OK)) {
                        ret = system(STORE_DEFAULT_USB_INFO);
-                       PRT_TRACE("Return value of usb-devices: %d\n", ret);
+                       _D("Return value of usb-devices: %d\n", ret);
                }
        }
-       PRT_TRACE("EXIT: usb_host_add_cb()\n");
+       _D("EXIT: usb_host_add_cb()\n");
 }
 
 static int uevent_control_stop(int ufd)
@@ -493,40 +493,40 @@ static int uevent_control_start(void)
 
        udev = udev_new();
        if (!udev) {
-               PRT_TRACE_ERR("error create udev");
+               _E("error create udev");
                return -1;
        }
 
        mon = udev_monitor_new_from_netlink(udev, "kernel");
        if (mon == NULL) {
-               PRT_TRACE_ERR("error udev_monitor create");
+               _E("error udev_monitor create");
                uevent_control_stop(-1);
                return -1;
        }
 
        udev_monitor_set_receive_buffer_size(mon, 1024);
        if (udev_monitor_filter_add_match_subsystem_devtype(mon, "platform", NULL) < 0) {
-               PRT_TRACE_ERR("error apply subsystem filter");
+               _E("error apply subsystem filter");
                uevent_control_stop(-1);
                return -1;
        }
 
        ufd = udev_monitor_get_fd(mon);
        if (ufd == -1) {
-               PRT_TRACE_ERR("error udev_monitor_get_fd");
+               _E("error udev_monitor_get_fd");
                uevent_control_stop(ufd);
                return -1;
        }
 
        ufdh = ecore_main_fd_handler_add(ufd, ECORE_FD_READ, uevent_control_cb, NULL, NULL, NULL);
        if (!ufdh) {
-               PRT_TRACE_ERR("error ecore_main_fd_handler_add");
+               _E("error ecore_main_fd_handler_add");
                uevent_control_stop(ufd);
                return -1;
        }
 
        if (udev_monitor_enable_receiving(mon) < 0) {
-               PRT_TRACE_ERR("error unable to subscribe to udev events");
+               _E("error unable to subscribe to udev events");
                uevent_control_stop(ufd);
                return -1;
        }
@@ -564,7 +564,7 @@ static int uevent_control_cb(void *data, Ecore_Fd_Handler *fd_handler)
                return -1;
        }
 
-       PRT_TRACE("UEVENT DETECTED (%s)",env_value);
+       _D("UEVENT DETECTED (%s)",env_value);
        ss_action_entry_call_internal(PREDEF_DEVICE_CHANGED,1,env_value);
 
        udev_device_unref(dev);
@@ -577,7 +577,7 @@ static int uevent_control_cb(void *data, Ecore_Fd_Handler *fd_handler)
 int changed_device_def_predefine_action(int argc, char **argv)
 {
        if (argc != 1 || argv[0] == NULL) {
-               PRT_TRACE_ERR("param is failed");
+               _E("param is failed");
                return -1;
        }
 
@@ -602,7 +602,7 @@ int changed_device_def_predefine_action(int argc, char **argv)
 static void pci_keyboard_add_cb(struct ss_main_data *ad)
 {
        char params[BUFF_MAX];
-       PRT_TRACE("pci- keyboard inserted\n");
+       _D("pci- keyboard inserted\n");
        pm_change_state(LCD_NORMAL);
 
        snprintf(params, sizeof(params), "%d", CB_NOTI_PCI_INSERTED);
@@ -612,7 +612,7 @@ static void pci_keyboard_add_cb(struct ss_main_data *ad)
 static void pci_keyboard_remove_cb(struct ss_main_data *ad)
 {
        char params[BUFF_MAX];
-       PRT_TRACE("pci- keyboard removed\n");
+       _D("pci- keyboard removed\n");
        pm_change_state(LCD_NORMAL);
 
        snprintf(params, sizeof(params), "%d", CB_NOTI_PCI_REMOVED);
@@ -623,7 +623,7 @@ int ss_device_change_init(struct ss_main_data *ad)
        ss_action_entry_add_internal(PREDEF_DEVICE_CHANGED, changed_device_def_predefine_action, NULL, NULL);
 
        if (uevent_control_start() == -1) {
-               PRT_TRACE_ERR("fail uevent control init");
+               _E("fail uevent control init");
                return -1;
        }
        /* for simple noti change cb */
@@ -646,14 +646,14 @@ int ss_device_change_init(struct ss_main_data *ad)
        ss_noti_add("device_pci_keyboard_remove", (void *)pci_keyboard_remove_cb, (void *)ad);
 
        if (vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_HOST_STATUS, usb_host_chgdet_cb, NULL) < 0) {
-               PRT_TRACE_ERR("vconf key notify failed(VCONFKEY_SYSMAN_USB_HOST_STATUS)");
+               _E("vconf key notify failed(VCONFKEY_SYSMAN_USB_HOST_STATUS)");
        }
        /* dbus noti change cb */
 #ifdef ENABLE_EDBUS_USE
        e_dbus_init();
        conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
        if (!conn)
-               PRT_TRACE_ERR("check system dbus running!\n");
+               _E("check system dbus running!\n");
 
        e_dbus_signal_handler_add(conn, NULL, "/system/uevent/xxxxx",
                                  "system.uevent.xxxxx",
index aeab227..01c3140 100644 (file)
@@ -134,7 +134,7 @@ int launch_app_with_nice(const char *file, char *const argv[], pid_t *pid, int _
        int _pid;
 
        if (file == NULL || access(file, X_OK) != 0) {
-               PRT_TRACE_ERR("launch app error: Invalid input");
+               _E("launch app error: Invalid input");
                errno = EINVAL;
                return -1;
        }
@@ -145,7 +145,7 @@ int launch_app_with_nice(const char *file, char *const argv[], pid_t *pid, int _
        _pid = fork();
 
        if (_pid == -1) {
-               PRT_TRACE_ERR("fork error: %s", strerror(errno));
+               _E("fork error: %s", strerror(errno));
                /* keep errno */
                return -1;
        }
@@ -162,12 +162,12 @@ int launch_app_with_nice(const char *file, char *const argv[], pid_t *pid, int _
        ret = nice(_nice);
 
        if (ret == -1 && errno != 0)
-               PRT_TRACE_ERR("nice error: %s", strerror(errno));
+               _E("nice error: %s", strerror(errno));
 
        ret = execvp(file, argv);
 
        /* If failed... */
-       PRT_TRACE_ERR("exec. error: %s", strerror(errno));
+       _E("exec. error: %s", strerror(errno));
        return -2;
 }
 
@@ -180,7 +180,7 @@ int launch_app_cmd_with_nice(const char *cmdline, int _nice)
 
        nargs = parse_cmd(cmdline, argv, MAX_ARGS + 1);
        if (nargs == -1) {
-               PRT_TRACE_ERR("launch app error: Invalid input");
+               _E("launch app error: Invalid input");
                errno = EINVAL;
                return -1;
        }
@@ -229,7 +229,7 @@ int ss_launch_if_noexist(const char *execpath, const char *arg, ...)
        buf = malloc(buf_size);
        if (buf == NULL) {
                /* Do something for not enought memory error */
-               PRT_TRACE_ERR("Malloc failed");
+               _E("Malloc failed");
                return -1;
        }
 
@@ -274,7 +274,7 @@ int ss_launch_evenif_exist(const char *execpath, const char *arg, ...)
        buf = malloc(buf_size);
        if (buf == NULL) {
                // Do something for not enought memory error
-               PRT_TRACE_ERR("Malloc failed");
+               _E("Malloc failed");
                return -1;
        }
 
@@ -322,7 +322,7 @@ int ss_launch_after_kill_if_exist(const char *execpath, const char *arg, ...)
        buf = malloc(buf_size);
        if (buf == NULL) {
                /* Do something for not enought memory error */
-               PRT_TRACE_ERR("Malloc Failed");
+               _E("Malloc Failed");
                return -1;
        }
 
index 4cc97c6..51492bb 100644 (file)
@@ -1,11 +1,13 @@
 /*
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ * deviced
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
 #ifndef __LOG_H__
 #define __LOG_H__
 
-#include <stdio.h>
-
-#if defined(ENABLE_DLOG_OUT)
-#define LOG_TAG                "SYSTEM_SERVER"
-#include <dlog.h>
-#define DLOG_ERR               DLOG_ERROR
-#define __LOG(prio, fmt, arg...) \
-       do { SLOG(prio, LOG_TAG, fmt, ##arg); } while (0)
-#define __LOGD(prio, fmt, arg...) \
-       do { SLOG(prio, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); } while (0)
-#define __PRT(prio, fmt, arg...) \
-       do { fprintf(((D##prio) == DLOG_ERR ? stderr : stdout), fmt"\n", ##arg); } while (0)
-#define __PRTD(prio, fmt, arg...) \
-       do { \
-               fprintf(((D##prio) == DLOG_ERR ? stderr : stdout), \
-                               "%s: %s(%d) > "fmt"\n", __MODULE__, __func__, __LINE__, ##arg); \
-       } while (0)
-#else
-#include <syslog.h>
-#define __LOG(prio, fmt, arg...) \
-       do { syslog(prio, fmt, ##arg); } while (0)
-#define __LOGD(prio, fmt, arg...) \
-       do { syslog(prio, "%s: %s(%d) > "fmt"\n", __MODULE__, __func__, __LINE__, ##arg); } while (0)
-#define __PRT(prio, fmt, arg...) \
-       do { fprintf(((prio) == LOG_ERR ? stderr : stdout), fmt"\n", ##arg); } while (0)
-#define __PRTD(prio, fmt, arg...) \
-       do { \
-               fprintf(((prio) == LOG_ERR ? stderr : stdout), \
-                                "%s: %s(%d) > "fmt"\n", __MODULE__, __func__, __LINE__, ##arg); \
-       } while (0)
-#endif
-
-#ifdef DEBUG
-extern int g_trace_depth;
-#define __PRT_TRACE(prio, fmt, arg...) \
-       do { __LOGD(prio, fmt, ##arg); } while (0)
-/*     do { \
-               int ___i;\
-               for(___i=0;___i<g_trace_depth;___i++)\
-               {\
-                       fprintf(stdout, "  "); \
-               }\
-               fprintf(stdout,\
-                       "[%s:%d] "fmt"\n", __FUNCTION__, __LINE__,##arg); \
-               __LOGD(prio, fmt, ##arg); \
-       } while (0) */
-#define __PRT_TRACE_ERR(prio, fmt, arg...) \
-       do { __LOGD(prio, fmt, ##arg); } while (0)
-/*     do { \
-               int ___i;\
-               for(___i=0;___i<g_trace_depth;___i++)\
-               {\
-                       fprintf(stdout, "  "); \
-               }\
-               printf(\
-                       "%c[1;31m[%s:%d] "fmt"%c[0m\n",27, __FUNCTION__, __LINE__,##arg,27); \
-               __LOGD(prio, fmt, ##arg); \
-       } while (0)*/
-#define __PRT_TRACE_EM(prio, fmt, arg...) \
-       do { __LOGD(prio, fmt, ##arg); } while (0)
-/*     do { \
-               int ___i;\
-               for(___i=0;___i<g_trace_depth;___i++)\
-               {\
-                       fprintf(stdout, "  "); \
-               }\
-               printf(\
-                       "%c[1;34m[%s:%d] "fmt"%c[0m\n",27, __FUNCTION__, __LINE__,##arg,27); \
-               __LOGD(prio, fmt, ##arg); \
-       } while (0)*/
+#ifndef FEATURE_DEVICE_DAEMON_DLOG
+#define FEATURE_DEVICE_DAEMON_DLOG
 #endif
 
-#define _NOUT(prio, fmt, arg...) do { } while (0)
-
-#ifdef DEBUG
-#  define _LOGD __LOGD
-#  define _LOG  __LOGD
-#  define _PRTD __PRTD
-#  define _PRT  __PRTD
-#  define _PRT_TRACE __PRT_TRACE
-#  define _PRT_TRACE_ERR __PRT_TRACE_ERR
-#  define _PRT_TRACE_EM __PRT_TRACE_EM
-#else
-#  define _LOGD _NOUT
-#  define _LOG  __LOG
-#  define _PRTD _NOUT
-#  define _PRT  __PRT
-#  define _PRT_TRACE _NOUT
-#  define _PRT_TRACE_ERR _NOUT
-#  define _PRT_TRACE_EM _NOUT
-#endif
-
-#define PRT_INFO(fmt, arg...) _PRT(LOG_INFO, fmt, ##arg)
-#define PRT_ERR(fmt, arg...) _PRT(LOG_ERR, fmt, ##arg)
-#define PRT_DBG(fmt, arg...) _PRTD(LOG_DEBUG, fmt, ##arg)
-#define PRT_TRACE(fmt, arg...) _PRT_TRACE(LOG_DEBUG, fmt, ##arg)
-#define PRT_TRACE_ERR(fmt, arg...) _PRT_TRACE_ERR(LOG_ERR, fmt, ##arg)
-#define PRT_TRACE_EM(fmt, arg...) _PRT_TRACE_EM(LOG_DEBUG, fmt, ##arg)
-
-#if defined(SYSLOG_OUT)
-#  define SYSLOG_INFO(fmt, arg...) _LOG(LOG_INFO, fmt, ##arg)
-#  define SYSLOG_ERR(fmt, arg...) _LOG(LOG_ERR, fmt, ##arg)
-#  define SYSLOG_DBG(fmt, arg...) _LOGD(LOG_DEBUG, fmt, ##arg)
-#  define INFO SYSLOG_INFO
-#  define ERR SYSLOG_ERR
-#  define DBG SYSLOG_DBG
-#elif defined(ENABLE_DLOG_OUT)
-#  define INFO SLOGI
-#  define ERR SLOGE
-#  define DBG SLOGD
+#ifdef FEATURE_DEVICE_DAEMON_DLOG
+#define LOG_TAG "SYSTEM_SERVER"
+#include <dlog.h>
+#define _D(fmt, arg...) \
+       do { SLOGD(fmt, ##arg); } while(0)
+#define _I(fmt, arg...) \
+       do { SLOGI(fmt, ##arg); } while(0)
+#define _W(fmt, arg...) \
+       do { SLOGW(fmt, ##arg); } while(0)
+#define _E(fmt, arg...) \
+       do { SLOGE(fmt, ##arg); } while(0)
+#define _SD(fmt, arg...) \
+       do { SECURE_SLOGD(fmt, ##arg); } while(0)
+#define _SI(fmt, arg...) \
+       do { SECURE_SLOGI(fmt, ##arg); } while(0)
+#define _SW(fmt, arg...) \
+       do { SECURE_SLOGW(fmt, ##arg); } while(0)
+#define _SE(fmt, arg...) \
+       do { SECURE_SLOGE(fmt, ##arg); } while(0)
 #else
-#  define INFO PRT_INFO
-#  define ERR PRT_ERR
-#  define DBG PRT_DBG
+#define _D(x, ...)     do { } while (0)
+#define _I(x, ...)     do { } while (0)
+#define _W(x, ...)     do { } while (0)
+#define _E(x, ...)     do { } while (0)
+#define _SD(fmt, args...)      do { } while (0)
+#define _SI(fmt, args...)      do { } while (0)
+#define _SW(fmt, args...)      do { } while (0)
+#define _SE(fmt, args...)      do { } while (0)
 #endif
 
 #endif
index abd8917..ae84823 100644 (file)
@@ -59,7 +59,7 @@ static void system_server_init(struct ss_main_data *ad)
 {
        ad->sysnoti_fd = ss_sysnoti_init();
        if (ss_noti_init() < 0)
-               PRT_TRACE_ERR("init noti error");
+               _E("init noti error");
 
        ss_queue_init();
        ss_core_init(ad);
@@ -82,7 +82,7 @@ static void system_server_init(struct ss_main_data *ad)
 #define SS_PIDFILE_PATH                "/var/run/.system_server.pid"
 static void sig_quit(int signo)
 {
-       PRT_TRACE_ERR("received SIGTERM signal %d", signo);
+       _E("received SIGTERM signal %d", signo);
        if (is_power_off() == 1)
                reboot(RB_POWER_OFF);
 }
@@ -92,12 +92,12 @@ static int system_main(int argc, char **argv)
 
        init_ad(&ad);
        if ((ad.noti_fd = heynoti_init()) < 0) {
-               PRT_TRACE_ERR("Hey Notification Initialize failed");
+               _E("Hey Notification Initialize failed");
                fini(&ad);
                return 0;
        }
        if (heynoti_attach_handler(ad.noti_fd) != 0) {
-               PRT_TRACE_ERR("fail to attach hey noti handler");
+               _E("fail to attach hey noti handler");
                fini(&ad);
                return 0;
        }
index 9de6a7c..afb78b2 100644 (file)
@@ -34,12 +34,12 @@ int ss_noti_init()
 {
        noti_fd = heynoti_init();
        if (noti_fd < 0) {
-               PRT_TRACE_ERR("heynoti_init error");
+               _E("heynoti_init error");
                return -1;
        }
 
        if (heynoti_attach_handler(noti_fd) < 0) {
-               PRT_TRACE_ERR("heynoti_attach_handler error");
+               _E("heynoti_attach_handler error");
                return -1;
        }
 
index 50e2660..07f3102 100644 (file)
@@ -102,7 +102,7 @@ static int __predefine_get_pid(const char *execpath)
 
        dp = opendir("/proc");
        if (!dp) {
-               PRT_TRACE_ERR("open /proc");
+               _E("open /proc");
                return -1;
        }
 
@@ -154,17 +154,17 @@ static void make_memps_log(char *file, pid_t pid, char *victim_name)
        now = time(NULL);
        cur_tm = (struct tm *)malloc(sizeof(struct tm));
        if (cur_tm == NULL) {
-               PRT_TRACE_ERR("Fail to memory allocation");
+               _E("Fail to memory allocation");
                return;
        }
 
        if (localtime_r(&now, cur_tm) == NULL) {
-               PRT_TRACE_ERR("Fail to get localtime");
+               _E("Fail to get localtime");
                free(cur_tm);
                return;
        }
 
-       PRT_TRACE("%s_%s_%d_%.4d%.2d%.2d_%.2d%.2d%.2d.log", file, victim_name,
+       _D("%s_%s_%d_%.4d%.2d%.2d_%.2d%.2d%.2d.log", file, victim_name,
                 pid, (1900 + cur_tm->tm_year), 1 + cur_tm->tm_mon,
                 cur_tm->tm_mday, cur_tm->tm_hour, cur_tm->tm_min,
                 cur_tm->tm_sec);
@@ -225,7 +225,7 @@ static int lowmem_get_victim_pid()
        int fd;
 
        if (device_get_property(DEVICE_TYPE_MEMORY, PROP_MEMORY_VICTIM_TASK, &pid) < 0) {
-               PRT_TRACE_ERR("Get victim task failed");
+               _E("Get victim task failed");
                return -1;
        }
 
@@ -245,17 +245,17 @@ int lowmem_def_predefine_action(int argc, char **argv)
                if (pid > 0 && pid != sysman_get_pid(LOWMEM_EXEC_PATH) && pid != sysman_get_pid(MEMPS_EXEC_PATH)) {
                        if ((sysman_get_cmdline_name(pid, appname, PATH_MAX)) ==
                            0) {
-                               PRT_TRACE_EM
+                               _I
                                    ("we will kill, lowmem lv2 = %d (%s)\n",
                                     pid, appname);
        
                                make_memps_log(MEMPS_LOG_FILE, pid, appname);
 
                                if(get_app_oomadj(pid, &oom_adj) < 0) {
-                                       PRT_TRACE_ERR("Failed to get oom_adj");
+                                       _E("Failed to get oom_adj");
                                        return -1;
                                }
-                               PRT_TRACE("%d will be killed with %d oom_adj value", pid, oom_adj);
+                               _D("%d will be killed with %d oom_adj value", pid, oom_adj);
 
                                kill(pid, SIGTERM);
 
@@ -270,12 +270,12 @@ int lowmem_def_predefine_action(int argc, char **argv)
                                ret = syspopup_launch("lowmem-syspopup", b);
                                bundle_free(b);
                                if (ret < 0) {
-                                       PRT_TRACE_EM("popup lauch failed\n");
+                                       _I("popup lauch failed\n");
                                        return -1;
                                }
                                
                                if (set_app_oomadj(ret, OOMADJ_SU) < 0) {       
-                                       PRT_TRACE_ERR("Failed to set oom_adj");
+                                       _E("Failed to set oom_adj");
                                }
                        }
                }
@@ -306,12 +306,12 @@ int usbcon_def_predefine_action(int argc, char **argv)
                pm_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
                pid = ss_launch_if_noexist(USBCON_EXEC_PATH, NULL);
                if (pid < 0) {
-                       PRT_TRACE_ERR("usb predefine action failed\n");
+                       _E("usb predefine action failed\n");
                        return -1;
                }
                return pid;
        }
-       PRT_TRACE_ERR("failed to get usb status\n");
+       _E("failed to get usb status\n");
        return -1;
 }
 
@@ -319,7 +319,7 @@ int earjackcon_def_predefine_action(int argc, char **argv)
 {
        int val;
 
-       PRT_TRACE_EM("earjack_normal predefine action\n");
+       _I("earjack_normal predefine action\n");
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_EARJACK_ONLINE, &val) == 0) {
                return vconf_set_int(VCONFKEY_SYSMAN_EARJACK, val);
        }
@@ -346,7 +346,7 @@ int lowbat_popup(void *data)
 
                ret = syspopup_launch("lowbat-syspopup", b);
                if (ret < 0) {
-                       PRT_TRACE_EM("popup lauch failed\n");
+                       _I("popup lauch failed\n");
                        bundle_free(b);
                        return 1;
                }
@@ -354,7 +354,7 @@ int lowbat_popup(void *data)
                lowbat_popup_option = 0;
                bundle_free(b);
        } else {
-               PRT_TRACE_EM("boot-animation running yet");
+               _I("boot-animation running yet");
                return 1;
        }
 
@@ -369,7 +369,7 @@ int predefine_control_launch(char *name, bundle *b)
        //lowbat-popup
        if (strncmp(name, LOWBAT_POPUP_NAME, strlen(LOWBAT_POPUP_NAME)) == 0) {
                if (launched_poweroff == 1) {
-                       PRT_TRACE_ERR("will be foreced power off");
+                       _E("will be foreced power off");
                        internal_poweroff_def_predefine_action(0,NULL);
                        return 0;
                }
@@ -379,7 +379,7 @@ int predefine_control_launch(char *name, bundle *b)
 
                pid = __predefine_get_pid(LOWBAT_EXEC_PATH);
                if (pid > 0) {
-                       PRT_TRACE_ERR("pre launched %s destroy", LOWBAT_EXEC_PATH);
+                       _E("pre launched %s destroy", LOWBAT_EXEC_PATH);
                        kill(pid, SIGTERM);
                }
                if (syspopup_launch(name, b) < 0)
@@ -446,13 +446,13 @@ int lowbat_def_predefine_action(int argc, char **argv)
        ret = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &state);
        if (state == 1 || ret != 0) {
                if (predefine_control_launch("lowbat-syspopup", b) < 0) {
-                               PRT_TRACE_ERR("popup lauch failed\n");
+                               _E("popup lauch failed\n");
                                bundle_free(b);
                                lowbat_popup_option = 0;
                                return -1;
                }
        } else {
-               PRT_TRACE_EM("boot-animation running yet");
+               _I("boot-animation running yet");
                lowbat_popup_id = ecore_timer_add(1, lowbat_popup, NULL);
        }
        bundle_free(b);
@@ -484,7 +484,7 @@ Eina_Bool powerdown_ap_by_force(void *data)
                gettimeofday(&now, NULL);
        }
 
-       PRT_TRACE("Power off by force\n");
+       _D("Power off by force\n");
        /* give a chance to be terminated for each process */
        power_off = 1;
        sync();
@@ -508,7 +508,7 @@ static void powerdown_ap(TapiHandle *handle, const char *noti_id, void *data, vo
                tel_deinit(tapi_handle);
                tapi_handle = NULL;
        }
-       PRT_TRACE("Power off \n");
+       _D("Power off \n");
 
        /* Getting poweroff duration */
        buf = getenv("PWROFF_DUR");
@@ -532,7 +532,7 @@ static void powerdown_ap(TapiHandle *handle, const char *noti_id, void *data, vo
 }
 static void powerdown_res_cb(TapiHandle *handle, int result, void *data, void *user_data)
 {
-       PRT_TRACE("poweroff command request : %d",result);
+       _D("poweroff command request : %d",result);
 }
 
 int poweroff_def_predefine_action(int argc, char **argv)
@@ -543,7 +543,7 @@ int poweroff_def_predefine_action(int argc, char **argv)
 
        while (retry_count < MAX_RETRY) {
                if (ss_action_entry_call_internal(PREDEF_INTERNAL_POWEROFF, 0) < 0) {
-                       PRT_TRACE_ERR("failed to request poweroff to system_server \n");
+                       _E("failed to request poweroff to system_server \n");
                        retry_count++;
                        continue;
                }
@@ -565,7 +565,7 @@ int internal_poweroff_def_predefine_action(int argc, char **argv)
                ret = tel_register_noti_event(tapi_handle, TAPI_NOTI_MODEM_POWER, powerdown_ap, NULL);
 
                if (ret != TAPI_API_SUCCESS) {
-                       PRT_TRACE_ERR
+                       _E
                            ("tel_register_event is not subscribed. error %d\n", ret);
                        powerdown_ap_by_force(NULL);
                        return 0;
@@ -573,7 +573,7 @@ int internal_poweroff_def_predefine_action(int argc, char **argv)
 
                ret = tel_process_power_command(tapi_handle, TAPI_PHONE_POWER_OFF, powerdown_res_cb, NULL);
                if (ret != TAPI_API_SUCCESS) {
-                       PRT_TRACE_ERR("tel_process_power_command() error %d\n", ret);
+                       _E("tel_process_power_command() error %d\n", ret);
                        powerdown_ap_by_force(NULL);
                        return 0;
                }
@@ -588,13 +588,13 @@ static void enter_flight_mode_cb(TapiHandle *handle, int result, void *data, voi
 {
        int bCurFlightMode = 0;
        if (result != TAPI_POWER_FLIGHT_MODE_ENTER) {
-               PRT_TRACE_ERR("flight mode enter failed %d",result);
+               _E("flight mode enter failed %d",result);
        } else {
-               PRT_TRACE("enter flight mode result : %d",result);
+               _D("enter flight mode result : %d",result);
                if (vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE,&bCurFlightMode) == 0) {
-                       PRT_TRACE("Flight Mode is %d", bCurFlightMode);
+                       _D("Flight Mode is %d", bCurFlightMode);
                } else {
-                       PRT_TRACE_ERR("failed to get vconf key");
+                       _E("failed to get vconf key");
                }
        }
 }
@@ -603,13 +603,13 @@ static void leave_flight_mode_cb(TapiHandle *handle, int result, void *data, voi
 {
        int bCurFlightMode = 0;
        if (result != TAPI_POWER_FLIGHT_MODE_LEAVE) {
-               PRT_TRACE_ERR("flight mode leave failed %d",result);
+               _E("flight mode leave failed %d",result);
        } else {
-               PRT_TRACE("leave flight mode result : %d",result);
+               _D("leave flight mode result : %d",result);
                if (vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE,&bCurFlightMode) == 0) {
-                       PRT_TRACE("Flight Mode is %d", bCurFlightMode);
+                       _D("Flight Mode is %d", bCurFlightMode);
                } else {
-                       PRT_TRACE_ERR("failed to get vconf key");
+                       _E("failed to get vconf key");
                }
        }
 }
@@ -622,7 +622,7 @@ int entersleep_def_predefine_action(int argc, char **argv)
        sync();
 
        ret = tel_set_flight_mode(tapi_handle, TAPI_POWER_FLIGHT_MODE_ENTER, enter_flight_mode_cb, NULL);
-       PRT_TRACE_ERR("request for changing into flight mode : %d\n", ret);
+       _E("request for changing into flight mode : %d\n", ret);
 
        system("/etc/rc.d/rc.entersleep");
        pm_change_state(POWER_OFF);
@@ -638,7 +638,7 @@ int leavesleep_def_predefine_action(int argc, char **argv)
        sync();
 
        ret = tel_set_flight_mode(tapi_handle, TAPI_POWER_FLIGHT_MODE_LEAVE, leave_flight_mode_cb, NULL);
-       PRT_TRACE_ERR("request for changing into flight mode : %d\n", ret);
+       _E("request for changing into flight mode : %d\n", ret);
 
        return 0;
 }
@@ -670,7 +670,7 @@ static void restart_ap(TapiHandle *handle, const char *noti_id, void *data, void
                tapi_handle = NULL;
        }
 
-       PRT_INFO("Restart\n");
+       _I("Restart\n");
        vconf_ignore_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, (void*)poweroff_control_cb);
        power_off = 1;
        sync();
@@ -708,7 +708,7 @@ static void restart_ap_by_force(void *data)
                tapi_handle = NULL;
        }
 
-       PRT_INFO("Restart\n");
+       _I("Restart\n");
        power_off = 1;
        sync();
 
@@ -741,7 +741,7 @@ int restart_def_predefine_action(int argc, char **argv)
        ret =
            tel_register_noti_event(tapi_handle, TAPI_NOTI_MODEM_POWER, restart_ap, NULL);
        if (ret != TAPI_API_SUCCESS) {
-               PRT_TRACE_ERR
+               _E
                    ("tel_register_event is not subscribed. error %d\n", ret);
                restart_ap_by_force((void *)-1);
                return 0;
@@ -750,7 +750,7 @@ int restart_def_predefine_action(int argc, char **argv)
 
        ret = tel_process_power_command(tapi_handle, TAPI_PHONE_POWER_OFF, powerdown_res_cb, NULL);
        if (ret != TAPI_API_SUCCESS) {
-               PRT_TRACE_ERR("tel_process_power_command() error %d\n", ret);
+               _E("tel_process_power_command() error %d\n", ret);
                restart_ap_by_force((void *)-1);
                return 0;
        }
@@ -768,7 +768,7 @@ int launching_predefine_action(int argc, char **argv)
 
        /* current just launching poweroff-popup */
        if (predefine_control_launch("poweroff-syspopup", NULL) < 0) {
-               PRT_TRACE_ERR("poweroff-syspopup launch failed");
+               _E("poweroff-syspopup launch failed");
                return -1;
        }
        return 0;
@@ -779,7 +779,7 @@ int flight_mode_def_predefine_action(int argc, char **argv)
        int bCurFlightMode;
        int err = TAPI_API_SUCCESS;
        if (argc != 1 || argv[0] == NULL) {
-               PRT_TRACE_ERR("FlightMode Set predefine action failed");
+               _E("FlightMode Set predefine action failed");
                return -1;
        }
        bCurFlightMode = atoi(argv[0]);
@@ -789,7 +789,7 @@ int flight_mode_def_predefine_action(int argc, char **argv)
                err = tel_set_flight_mode(tapi_handle, TAPI_POWER_FLIGHT_MODE_ENTER, enter_flight_mode_cb, NULL);
        }
        if (err != TAPI_API_SUCCESS)
-               PRT_TRACE_ERR("FlightMode tel api action failed %d",err);
+               _E("FlightMode tel api action failed %d",err);
        return 0;
 
 }
@@ -804,13 +804,13 @@ static void ss_action_entry_load_from_sodir()
 
        dp = opendir(PREDEFINE_SO_DIR);
        if (!dp) {
-               ERR("fail open %s", PREDEFINE_SO_DIR);
+               _E("fail open %s", PREDEFINE_SO_DIR);
                return;
        }
 
        msg = malloc(sizeof(struct sysnoti));
        if (msg == NULL) {
-               ERR("Malloc failed");
+               _E("Malloc failed");
                closedir(dp);
                return;
        }
@@ -840,10 +840,10 @@ static void __tel_init_cb(keynode_t *key_nodes,void *data)
                vconf_ignore_key_changed(VCONFKEY_TELEPHONY_READY, (void*)__tel_init_cb);
                tapi_handle = tel_init(NULL);
                if (tapi_handle == NULL) {
-                       PRT_TRACE_ERR("tapi init error");
+                       _E("tapi init error");
                }
        } else {
-               PRT_TRACE_ERR("tapi is not ready yet");
+               _E("tapi is not ready yet");
        }
 }
 static void poweroff_control_cb(keynode_t *in_key, struct ss_main_data *ad)
@@ -874,13 +874,13 @@ void ss_predefine_internal_init(void)
                if (bTelReady == 1) {
                        tapi_handle = tel_init(NULL);
                        if (tapi_handle == NULL) {
-                               PRT_TRACE_ERR("tapi init error");
+                               _E("tapi init error");
                        }
                } else {
                        vconf_notify_key_changed(VCONFKEY_TELEPHONY_READY, (void *)__tel_init_cb, NULL);
                }
        } else {
-               PRT_TRACE_ERR("failed to get tapi vconf key");
+               _E("failed to get tapi vconf key");
        }
 #ifdef NOUSE
        ss_action_entry_add_internal(PREDEF_CALL, call_predefine_action, NULL,
@@ -909,7 +909,7 @@ void ss_predefine_internal_init(void)
                                        NULL, NULL);
 
        if (vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, (void *)poweroff_control_cb, NULL) < 0) {
-               PRT_TRACE_ERR("Vconf notify key chaneged failed: KEY(%s)", VCONFKEY_SYSMAN_POWER_OFF_STATUS);
+               _E("Vconf notify key chaneged failed: KEY(%s)", VCONFKEY_SYSMAN_POWER_OFF_STATUS);
        }
        ss_action_entry_load_from_sodir();
 
index d8f0bce..c77c7ca 100644 (file)
@@ -53,7 +53,7 @@ int ss_action_entry_add_internal(char *type,
        data = malloc(sizeof(struct ss_action_entry));
 
        if (data == NULL) {
-               PRT_TRACE_ERR("Malloc failed");
+               _E("Malloc failed");
                return -1;
        }
 
@@ -74,12 +74,12 @@ int ss_action_entry_add_internal(char *type,
 
        predef_act_list = eina_list_prepend(predef_act_list, data);
 
-       PRT_TRACE_ERR("[SYSMAN] add predefine action entry suceessfully - %s",
+       _E("[SYSMAN] add predefine action entry suceessfully - %s",
                  data->type);
        return 0;
  err:
        if (data->type != NULL)
-               PRT_TRACE_ERR("[SYSMAN] add predefine action entry -%s",
+               _E("[SYSMAN] add predefine action entry -%s",
                              data->type);
        free(data);
        return -1;
@@ -92,7 +92,7 @@ int ss_action_entry_add(struct sysnoti *msg)
        data = malloc(sizeof(struct ss_action_entry));
 
        if (data == NULL) {
-               PRT_TRACE_ERR("Malloc failed");
+               _E("Malloc failed");
                return -1;
        }
 
@@ -101,13 +101,13 @@ int ss_action_entry_add(struct sysnoti *msg)
 
        data->handle = dlopen(msg->path, RTLD_LAZY);
        if (!data->handle) {
-               PRT_TRACE_ERR("cannot find such library");
+               _E("cannot find such library");
                goto err;
        }
 
        data->predefine_action = dlsym(data->handle, SS_PREDEFINE_ACT_FUNC_STR);
        if (data->predefine_action == NULL) {
-               PRT_TRACE_ERR("cannot find predefine_action symbol : %s",
+               _E("cannot find predefine_action symbol : %s",
                              SS_PREDEFINE_ACT_FUNC_STR);
                goto err;
        }
@@ -120,11 +120,11 @@ int ss_action_entry_add(struct sysnoti *msg)
 
        predef_act_list = eina_list_prepend(predef_act_list, data);
 
-       PRT_TRACE_ERR("[SYSMAN]add predefine action entry suceessfully - %s",
+       _E("[SYSMAN]add predefine action entry suceessfully - %s",
                  data->type);
        return 0;
  err:
-       PRT_TRACE_ERR("[SYSMAN] FAIL predefine action entry - %s", msg->type);
+       _E("[SYSMAN] FAIL predefine action entry - %s", msg->type);
        free(data);
        return -1;
 }
@@ -156,9 +156,9 @@ int ss_action_entry_call_internal(char *type, int argc, ...)
 
                        int ret;
                        ret=ss_run_queue_add(data, argc, argv);
-                       PRT_TRACE_ERR("ss_run_queue_add : %d",ret);
+                       _E("ss_run_queue_add : %d",ret);
                        ret=ss_core_action_run();
-                       PRT_TRACE_ERR("ss_core_action_run : %d",ret);
+                       _E("ss_core_action_run : %d",ret);
                        return 0;
                }
        }
@@ -176,21 +176,21 @@ int ss_action_entry_call(struct sysnoti *msg, int sockfd)
                if ((data != NULL) && (!strcmp(data->type, msg->type))) {
                        if (data->is_accessible != NULL
                            && data->is_accessible(sockfd) == 0) {
-                               PRT_TRACE_ERR
+                               _E
                                    ("%d cannot call that predefine module",
                                     msg->pid);
                                return -1;
                        }
                        int ret;
                        ret=ss_run_queue_add(data, msg->argc, msg->argv);
-                       PRT_TRACE_ERR("ss_run_queue_add : %d",ret);
+                       _E("ss_run_queue_add : %d",ret);
                        ret=ss_core_action_run();
-                       PRT_TRACE_ERR("ss_core_action_run : %d",ret);
+                       _E("ss_core_action_run : %d",ret);
                        return 0;
                }
        }
 
-       PRT_TRACE_EM("[SYSMAN] cannot found action");
+       _I("[SYSMAN] cannot found action");
        return -1;
 }
 
@@ -202,7 +202,7 @@ int ss_run_queue_add(struct ss_action_entry *act_entry, int argc, char **argv)
        rq_entry = malloc(sizeof(struct ss_run_queue_entry));
 
        if (rq_entry == NULL) {
-               PRT_TRACE_ERR("Malloc failed");
+               _E("Malloc failed");
                return -1;
        }
 
@@ -219,7 +219,7 @@ int ss_run_queue_add(struct ss_action_entry *act_entry, int argc, char **argv)
 
        run_queue = eina_list_prepend(run_queue, rq_entry);
 
-       PRT_TRACE_EM("[SYSMAN] new action called : %s", act_entry->type);
+       _I("[SYSMAN] new action called : %s", act_entry->type);
        return 0;
 }
 
@@ -263,7 +263,7 @@ int ss_run_queue_del(struct ss_run_queue_entry *entry)
        EINA_LIST_FOREACH_SAFE(run_queue, tmp, tmp_next, rq_entry) {
                if ((rq_entry != NULL) && (rq_entry == entry)) {
                        run_queue = eina_list_remove(run_queue, rq_entry);
-                       PRT_TRACE_EM("[SYSMAN] action deleted : %s",
+                       _I("[SYSMAN] action deleted : %s",
                                     rq_entry->action_entry->type);
                        for (i = 0; i < rq_entry->argc; i++) {
                                if (rq_entry->argv[i])
@@ -286,7 +286,7 @@ int ss_run_queue_del_bypid(int pid)
        EINA_LIST_FOREACH_SAFE(run_queue, tmp, tmp_next, rq_entry) {
                if ((rq_entry != NULL) && (rq_entry->forked_pid == pid)) {
                        run_queue = eina_list_remove(run_queue, rq_entry);
-                       PRT_TRACE_EM("[SYSMAN] action deleted : %s",
+                       _I("[SYSMAN] action deleted : %s",
                                     rq_entry->action_entry->type);
                        for (i = 0; i < rq_entry->argc; i++) {
                                if (rq_entry->argv[i])
index 0e5c3f1..cb8bf96 100644 (file)
 #include <sys/wait.h>
 #include "core.h"
 
-#define PRT_TRACE_ERR(format, args...) do { \
+#define _E(format, args...) do { \
        char buf[255];\
        snprintf(buf, 255, format, ##args);\
        write(2, buf, strlen(buf));\
 } while (0);
 
-#define PRT_TRACE(format, args...) do { \
+#define _D(format, args...) do { \
        char buf[255];\
        snprintf(buf, 255, format, ##args);\
        write(1, buf, strlen(buf));\
@@ -42,11 +42,11 @@ static void sig_child_handler(int signo, siginfo_t *info, void *data)
 
        pid = waitpid(info->si_pid, &status, 0);
        if (pid == -1) {
-               PRT_TRACE_ERR("SIGCHLD received\n");
+               _E("SIGCHLD received\n");
                return;
        }
 
-       PRT_TRACE("sig child actend call - %d\n", info->si_pid);
+       _D("sig child actend call - %d\n", info->si_pid);
 
        ss_core_action_clear(info->si_pid);
 }
index a1f740c..e6e3699 100755 (executable)
@@ -51,7 +51,7 @@ static void print_sysnoti_msg(const char *title, struct sysnoti *msg)
        if (sysman_get_cmdline_name(msg->pid, exe_name, PATH_MAX) < 0)
                snprintf(exe_name, sizeof(exe_name), "Unknown (maybe dead)");
 
-       PRT_TRACE_ERR("pid : %d name: %s cmd : %d type : %s path : %s",
+       _E("pid : %d name: %s cmd : %d type : %s path : %s",
                        msg->pid, exe_name, msg->cmd, msg->type, msg->path);
 }
 
@@ -63,12 +63,12 @@ static inline int recv_int(int fd)
                r = read(fd, &val, sizeof(int));
                if (r < 0) {
                        if(errno == EINTR) {
-                               PRT_TRACE_ERR("Re-read for error(EINTR)");
+                               _E("Re-read for error(EINTR)");
                                retry_count++;
                                continue;
                        }
                        else {
-                               PRT_TRACE_ERR("Read fail for int");
+                               _E("Read fail for int");
                                return -1;
                        }
                } else {
@@ -88,34 +88,34 @@ static inline char *recv_str(int fd)
                r = read(fd, &len, sizeof(int));
                if (r < 0) {
                        if(errno == EINTR) {
-                               PRT_TRACE_ERR("Re-read for error(EINTR)");
+                               _E("Re-read for error(EINTR)");
                                retry_count++;
                                continue;
                        }
                        else {
-                               PRT_TRACE_ERR("Read fail for str length");
+                               _E("Read fail for str length");
                                return NULL;
                        }
                } else
                        break;
        }
        if (retry_count == RETRY_READ_COUNT) {
-               PRT_TRACE_ERR("Read retry failed");
+               _E("Read retry failed");
                return NULL;
        }
        if (len <= 0) {
-               PRT_TRACE_ERR("str is null");
+               _E("str is null");
                return NULL;
        }
 
        if (len >= INT_MAX) {
-               PRT_TRACE_ERR("size is over INT_MAX");
+               _E("size is over INT_MAX");
                return NULL;
        }
 
        str = (char *)malloc(len + 1);
        if (str == NULL) {
-               PRT_TRACE_ERR("Not enough memory");
+               _E("Not enough memory");
                return NULL;
        }
 
@@ -124,12 +124,12 @@ static inline char *recv_str(int fd)
                r = read(fd, str, len);
                if(r < 0) {
                        if(errno == EINTR) {
-                               PRT_TRACE_ERR("Re-read for error(EINTR)");
+                               _E("Re-read for error(EINTR)");
                                retry_count++;
                                continue;                       
                        }                                               
                        else {      
-                               PRT_TRACE_ERR("Read fail for str");
+                               _E("Read fail for str");
                                free(str);
                                str = NULL;
                                return NULL;
@@ -138,7 +138,7 @@ static inline char *recv_str(int fd)
                        break;
        }
        if (retry_count == RETRY_READ_COUNT) {
-               PRT_TRACE_ERR("Read retry failed");
+               _E("Read retry failed");
                free(str);
                str = NULL;
                return NULL;
@@ -190,7 +190,7 @@ static bool check_sync_request(struct sysnoti *msg)
        if (sysman_get_cmdline_name(msg->pid, path, PATH_MAX) < 0)
                return true;
 
-       PRT_TRACE_ERR("path : %s, type : %s", path, msg->type);
+       _E("path : %s, type : %s", path, msg->type);
        if (!strcmp(path, POWER_MANAGER_STR) &&
                        (!strcmp(msg->type, INACTIVE_STR) || !strcmp(msg->type, ACTIVE_STR)))
                return false;
@@ -209,7 +209,7 @@ static int sysnoti_cb(void *data, Ecore_Fd_Handler * fd_handler)
        bool sync;
 
        if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ)) {
-               PRT_TRACE_ERR
+               _E
                    ("ecore_main_fd_handler_active_get error , return\n");
                return 1;
        }
@@ -217,7 +217,7 @@ static int sysnoti_cb(void *data, Ecore_Fd_Handler * fd_handler)
        fd = ecore_main_fd_handler_fd_get(fd_handler);
        msg = malloc(sizeof(struct sysnoti));
        if (msg == NULL) {
-               PRT_TRACE_ERR("%s : Not enough memory", __FUNCTION__);
+               _E("%s : Not enough memory", __FUNCTION__);
                return 1;
        }
 
@@ -225,12 +225,12 @@ static int sysnoti_cb(void *data, Ecore_Fd_Handler * fd_handler)
        client_sockfd = accept(fd, (struct sockaddr *)&client_address, (socklen_t *)&client_len);
 
        if (client_sockfd == -1) {
-               PRT_TRACE_ERR("socket accept error");
+               _E("socket accept error");
                free(msg);
                return -1;
        }
        if (read_message(client_sockfd, msg) < 0) {
-               PRT_TRACE_ERR("%s : recv error msg", __FUNCTION__);
+               _E("%s : recv error msg", __FUNCTION__);
                print_sysnoti_msg(__FUNCTION__, msg);
                free_message(msg);
                write(client_sockfd, &ret, sizeof(int));
@@ -244,7 +244,7 @@ static int sysnoti_cb(void *data, Ecore_Fd_Handler * fd_handler)
 
        print_sysnoti_msg(__FUNCTION__, msg);
        if (msg->argc > SYSMAN_MAXARG) {
-               PRT_TRACE_ERR("%s : error argument", __FUNCTION__);
+               _E("%s : error argument", __FUNCTION__);
                free_message(msg);
                if (sync)
                        write(client_sockfd, &ret, sizeof(int));
@@ -314,11 +314,11 @@ static int ss_sysnoti_server_init(void)
 
        fd = socket(AF_UNIX, SOCK_STREAM, 0);
        if (fd < 0) {
-               PRT_ERR("%s: socket create failed\n", __FUNCTION__);
+               _E("%s: socket create failed\n", __FUNCTION__);
                return -1;
        }
        if((fsetxattr(fd, "security.SMACK64IPOUT", "@", 2, 0)) < 0 ) {
-               PRT_ERR("%s: Socket SMACK labeling failed\n", __FUNCTION__);
+               _E("%s: Socket SMACK labeling failed\n", __FUNCTION__);
                if(errno != EOPNOTSUPP) {
                        close(fd);
                        return -1;
@@ -326,7 +326,7 @@ static int ss_sysnoti_server_init(void)
        }
 
        if((fsetxattr(fd, "security.SMACK64IPIN", "*", 2, 0)) < 0 ) {
-               PRT_ERR("%s: Socket SMACK labeling failed\n", __FUNCTION__);
+               _E("%s: Socket SMACK labeling failed\n", __FUNCTION__);
                if(errno != EOPNOTSUPP) {
                        close(fd);
                        return -1;
@@ -339,20 +339,20 @@ static int ss_sysnoti_server_init(void)
                sizeof(serveraddr.sun_path));
 
        if (bind(fd, (struct sockaddr *)&serveraddr, sizeof(struct sockaddr)) < 0) {
-               PRT_ERR("%s: socket bind failed\n", __FUNCTION__);
+               _E("%s: socket bind failed\n", __FUNCTION__);
                close(fd);
                return -1;
        }
 
        if (chmod(SYSNOTI_SOCKET_PATH, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0)      /* 0777 */
-               PRT_ERR("failed to change the socket permission");
+               _E("failed to change the socket permission");
 
        if (listen(fd, 5) < 0) {
-               PRT_ERR("failed to listen");
+               _E("failed to listen");
                close(fd);
                return -1;
        }
-       PRT_INFO("socket create & listen ok\n");
+       _I("socket create & listen ok\n");
 
        return fd;
 }
@@ -371,7 +371,7 @@ static int __sysnoti_start(void)
        sysnoti_efd = ecore_main_fd_handler_add(fd, ECORE_FD_READ, sysnoti_cb, NULL, NULL,
                                  NULL);
        if (!sysnoti_efd) {
-               PRT_TRACE_ERR("error ecore_main_fd_handler_add");
+               _E("error ecore_main_fd_handler_add");
                return -1;
        }
        return fd;
index 53eec05..b4b381e 100644 (file)
@@ -57,13 +57,13 @@ int set_max_frequency_action(int argc, char **argv)
 
        r = __add_entry_to_max_cpu_freq_list(atoi(argv[0]), atoi(argv[1]));
        if (r < 0) {
-               PRT_TRACE_ERR("Add entry failed");
+               _E("Add entry failed");
                return -1;
        }
 
        r = __write_max_cpu_freq(cur_max_cpu_freq);
        if (r < 0) {
-               PRT_TRACE_ERR("Write entry failed");
+               _E("Write entry failed");
                return -1;
        }
 
@@ -79,13 +79,13 @@ int set_min_frequency_action(int argc, char **argv)
 
        r = __add_entry_to_min_cpu_freq_list(atoi(argv[0]), atoi(argv[1]));
        if (r < 0) {
-               PRT_TRACE_ERR("Add entry failed");
+               _E("Add entry failed");
                return -1;
        }
        
        r = __write_min_cpu_freq(cur_min_cpu_freq);
        if (r < 0) {
-               PRT_TRACE_ERR("Write entry failed");
+               _E("Write entry failed");
                return -1;
        }
 
@@ -100,7 +100,7 @@ int release_max_frequency_action(int argc, char **argv)
        
        r = __remove_entry_from_max_cpu_freq_list(atoi(argv[0]));
        if (r < 0) {
-               PRT_TRACE_ERR("Remove entry failed");
+               _E("Remove entry failed");
                return -1;
        }
 
@@ -109,7 +109,7 @@ int release_max_frequency_action(int argc, char **argv)
 
        r = __write_max_cpu_freq(cur_max_cpu_freq);
        if (r < 0) {
-               PRT_TRACE_ERR("Write freq failed");
+               _E("Write freq failed");
                return -1;
        }
 
@@ -125,7 +125,7 @@ int release_min_frequency_action(int argc, char **argv)
 
        r = __remove_entry_from_min_cpu_freq_list(atoi(argv[0]));
        if (r < 0) {
-               PRT_TRACE_ERR("Remove entry failed");
+               _E("Remove entry failed");
                return -1;
        }
 
@@ -134,7 +134,7 @@ int release_min_frequency_action(int argc, char **argv)
 
        r = __write_min_cpu_freq(cur_min_cpu_freq);
        if (r < 0) {
-               PRT_TRACE_ERR("Write entry failed");
+               _E("Write entry failed");
                return -1;
        }
 
@@ -153,18 +153,18 @@ static int power_saving_cb(keynode_t *key_nodes, void *data)
                        if (power_saving_cpu_stat == 1) {
                                ret = __add_entry_to_max_cpu_freq_list(getpid(), POWER_SAVING_CPUFREQ);
                                if (ret < 0) {
-                                       PRT_TRACE_ERR("Add entry failed");
+                                       _E("Add entry failed");
                                        return -1;
                                }
                        }
                } else {
-                       PRT_TRACE_ERR("failed to get vconf key");
+                       _E("failed to get vconf key");
                        return -1;
                }
        } else {
                ret = __remove_entry_from_max_cpu_freq_list(getpid());
                if (ret < 0) {
-                       PRT_TRACE_ERR("Remove entry failed");
+                       _E("Remove entry failed");
                        return -1;
                }
                if (cur_max_cpu_freq == INT_MIN)
@@ -172,7 +172,7 @@ static int power_saving_cb(keynode_t *key_nodes, void *data)
        }
        ret = __write_max_cpu_freq(cur_max_cpu_freq);
        if (ret < 0) {
-               PRT_TRACE_ERR("Write failed");
+               _E("Write failed");
                return -1;
        }
 
@@ -191,13 +191,13 @@ static int power_saving_cpu_cb(keynode_t *key_nodes, void *data)
                        if (power_saving_cpu_stat == 1) {
                                ret = __add_entry_to_max_cpu_freq_list(getpid(), POWER_SAVING_CPUFREQ);
                                if (ret < 0) {
-                                       PRT_TRACE_ERR("Add entry failed");
+                                       _E("Add entry failed");
                                        return -1;
                                }
                        } else {
                                ret = __remove_entry_from_max_cpu_freq_list(getpid());
                                if (ret < 0) {
-                                       PRT_TRACE_ERR("Remove entry failed");
+                                       _E("Remove entry failed");
                                        return -1;
                                }
                                if (cur_max_cpu_freq == INT_MAX)
@@ -205,12 +205,12 @@ static int power_saving_cpu_cb(keynode_t *key_nodes, void *data)
                        }
                        ret = __write_max_cpu_freq(cur_max_cpu_freq);
                        if (ret < 0) {
-                               PRT_TRACE_ERR("Write failed");
+                               _E("Write failed");
                                return -1;
                        }
                }
        } else {
-               PRT_TRACE_ERR("failed to get vconf key");
+               _E("failed to get vconf key");
                return -1;
        }
 
@@ -240,13 +240,13 @@ static void __set_freq_limit()
 
        ret = device_get_property(DEVICE_TYPE_CPU, PROP_CPU_CPUINFO_MAX_FREQ, &max_cpu_freq_limit);
        if (ret < 0) {
-               PRT_TRACE_ERR("get cpufreq cpuinfo max readerror: %s", strerror(errno));
+               _E("get cpufreq cpuinfo max readerror: %s", strerror(errno));
                max_cpu_freq_limit = DEFAULT_MAX_CPU_FREQ;
        }
 
        ret = device_get_property(DEVICE_TYPE_CPU, PROP_CPU_CPUINFO_MIN_FREQ, &min_cpu_freq_limit);
        if (ret < 0) {
-               PRT_TRACE_ERR("get cpufreq cpuinfo min readerror: %s", strerror(errno));
+               _E("get cpufreq cpuinfo min readerror: %s", strerror(errno));
                min_cpu_freq_limit = DEFAULT_MIN_CPU_FREQ;
        }
 
@@ -257,21 +257,21 @@ static void __set_freq_limit()
                                if (power_saving_cpu_stat == 1) {
                                        ret = __add_entry_to_max_cpu_freq_list(getpid(), POWER_SAVING_CPUFREQ);
                                        if (ret < 0) {
-                                               PRT_TRACE_ERR("Add entry failed");
+                                               _E("Add entry failed");
                                                return;
                                        }
                                        ret = __write_max_cpu_freq(cur_max_cpu_freq);
                                        if (ret < 0) {
-                                               PRT_TRACE_ERR("Write entry failed");
+                                               _E("Write entry failed");
                                                return;
                                        }
                                }
                        } else {
-                               PRT_TRACE_ERR("failed to get vconf key");
+                               _E("failed to get vconf key");
                        }
                }
        } else {
-               PRT_TRACE_ERR("failed to get vconf key");
+               _E("failed to get vconf key");
        }
 }
 
@@ -345,7 +345,7 @@ static int __add_entry_to_max_cpu_freq_list(int pid, int freq)
        
        r = __remove_entry_from_max_cpu_freq_list(pid);
        if (r < 0) {
-               PRT_TRACE_ERR("Remove duplicated entry failed");
+               _E("Remove duplicated entry failed");
        }
 
        if (freq < cur_max_cpu_freq) {
@@ -354,7 +354,7 @@ static int __add_entry_to_max_cpu_freq_list(int pid, int freq)
 
        entry = malloc(sizeof(struct cpu_freq_entry));
        if (!entry) {
-               PRT_TRACE_ERR("Malloc failed");
+               _E("Malloc failed");
                return -1;
        }
        
@@ -363,7 +363,7 @@ static int __add_entry_to_max_cpu_freq_list(int pid, int freq)
 
        max_cpu_freq_list = eina_list_prepend(max_cpu_freq_list, entry);
        if (!max_cpu_freq_list) {
-               PRT_TRACE_ERR("eina_list_prepend failed");
+               _E("eina_list_prepend failed");
                return -1;
        }
 
@@ -377,7 +377,7 @@ static int __add_entry_to_min_cpu_freq_list(int pid, int freq)
        
        r = __remove_entry_from_min_cpu_freq_list(pid);
        if (r < 0) {
-               PRT_TRACE_ERR("Remove duplicated entry failed");
+               _E("Remove duplicated entry failed");
        }
 
        if (freq > cur_min_cpu_freq) {
@@ -386,7 +386,7 @@ static int __add_entry_to_min_cpu_freq_list(int pid, int freq)
 
        entry = malloc(sizeof(struct cpu_freq_entry));
        if (!entry) {
-               PRT_TRACE_ERR("Malloc failed");
+               _E("Malloc failed");
                return -1;
        }
        
@@ -395,7 +395,7 @@ static int __add_entry_to_min_cpu_freq_list(int pid, int freq)
 
        min_cpu_freq_list = eina_list_prepend(min_cpu_freq_list, entry);
        if (!min_cpu_freq_list) {
-               PRT_TRACE_ERR("eina_list_prepend failed");
+               _E("eina_list_prepend failed");
                return -1;
        }
        
@@ -408,7 +408,7 @@ static int __write_max_cpu_freq(int freq)
 
        ret = device_set_property(DEVICE_TYPE_CPU, PROP_CPU_SCALING_MAX_FREQ, freq);
        if (ret < 0) {
-               PRT_TRACE_ERR("set cpufreq max freq write error: %s", strerror(errno));
+               _E("set cpufreq max freq write error: %s", strerror(errno));
                return -1;
        }
        
@@ -421,7 +421,7 @@ static int __write_min_cpu_freq(int freq)
 
        ret = device_set_property(DEVICE_TYPE_CPU, PROP_CPU_SCALING_MIN_FREQ, freq);
        if (ret < 0) {
-               PRT_TRACE_ERR("set cpufreq min freq write error: %s", strerror(errno));
+               _E("set cpufreq min freq write error: %s", strerror(errno));
                return -1;
        }
        
index 831dc0b..01283e4 100644 (file)
@@ -141,7 +141,7 @@ static void __attribute__ ((constructor)) smack_check(void)
 
        if (ret == 0 && sfs.f_type == SMACKFS_MAGIC)
                smack = 1;
-       PRT_TRACE_ERR("smackfs check %d", smack);
+       _E("smackfs check %d", smack);
 }
 
 static int exec_process(const char **argv)
@@ -162,7 +162,7 @@ static int exec_process(const char **argv)
                        signal(i, SIG_DFL);
                r = execv(argv[0], argv);
                if (r == -1) {
-                       PRT_TRACE_ERR("execv() error");
+                       _E("execv() error");
                        exit(EXIT_FAILURE);
                }
        }
@@ -183,7 +183,7 @@ int get_mmcblk_num(void)
        int mmc_dev_changed = 0;
 
        if ((dp = opendir("/sys/block")) == NULL) {
-               PRT_TRACE_ERR("Can not open directory..\n");
+               _E("Can not open directory..\n");
                return -1;
        }
        chdir("/sys/block");
@@ -201,7 +201,7 @@ int get_mmcblk_num(void)
 
                                fd = open(buf, O_RDONLY);
                                if (fd == -1) {
-                                       PRT_TRACE_ERR("%s open error: %s", buf,
+                                       _E("%s open error: %s", buf,
                                                      strerror(errno));
                                        continue;
                                }
@@ -209,13 +209,13 @@ int get_mmcblk_num(void)
                                if ((r >= 0) && (r < 10))
                                        buf[r] = '\0';
                                else
-                                       PRT_TRACE_ERR("%s read error: %s", buf,
+                                       _E("%s read error: %s", buf,
                                                      strerror(errno));
                                close(fd);
                                if (strncmp("SD", buf, 2) == 0) {
                                        char *str_mmcblk_num = strndup((dir->d_name) + 6, 1);
                                        if (str_mmcblk_num == NULL) {
-                                               PRT_TRACE_ERR("Memory Allocation Failed");
+                                               _E("Memory Allocation Failed");
                                                closedir(dp);
                                                return -1;
                                        }
@@ -224,20 +224,20 @@ int get_mmcblk_num(void)
 
                                        free(str_mmcblk_num);
                                        closedir(dp);
-                                       PRT_TRACE("%d \n", mmcblk_num);
+                                       _D("%d \n", mmcblk_num);
 
                                        snprintf(buf, 255, "/sys/block/%s/device/cid", dir->d_name);
 
                                        fd = open(buf, O_RDONLY);
                                        if (fd == -1) {
-                                               PRT_TRACE_ERR("%s open error", buf, strerror(errno));
+                                               _E("%s open error", buf, strerror(errno));
                                                return mmcblk_num;
                                        }
                                        r = read(fd, buf, 255);
                                        if ((r >=0) && (r < 255)) {
                                                buf[r] = '\0';
                                        } else {
-                                               PRT_TRACE_ERR("%s read error: %s", buf,strerror(errno));
+                                               _E("%s read error: %s", buf,strerror(errno));
                                        }
                                        close(fd);
                                        pre_mmc_device_id = vconf_get_str(VCONFKEY_INTERNAL_PRIVATE_MMC_ID);
@@ -255,7 +255,7 @@ int get_mmcblk_num(void)
                                                }
                                                free(pre_mmc_device_id);
                                        } else {
-                                               PRT_TRACE_ERR("failed to get pre_mmc_device_id");
+                                               _E("failed to get pre_mmc_device_id");
                                        }
                                        return mmcblk_num;
                                }
@@ -264,7 +264,7 @@ int get_mmcblk_num(void)
                }
        }
        closedir(dp);
-       PRT_TRACE_ERR("Failed to find mmc block number\n");
+       _E("Failed to find mmc block number\n");
        return -1;
 }
 
@@ -272,7 +272,7 @@ static int __umount_fs(void)
 {
        int ret;
        if ((ret = umount2(MMC_MOUNT_POINT, MNT_DETACH)) != 0) {
-               PRT_TRACE_ERR("Failed to unmount mmc card : %s\n", strerror(errno));
+               _E("Failed to unmount mmc card : %s\n", strerror(errno));
        }
        return ret;
 }
@@ -288,17 +288,17 @@ static int __check_mmc_fs_type(const char *path)
 
        inserted_type = FS_TYPE_NONE;
        if ((fd = open(path, O_RDONLY)) < 0) {
-               PRT_TRACE_ERR("can't open the '%s': %s", path, strerror(errno));
+               _E("can't open the '%s': %s", path, strerror(errno));
                return -1;
        }
 
        while (len != 0 && (ret = read(fd, tmpbuf, len)) != 0) {
                if (ret == -1) {
                        if (errno == EINTR) {
-                               PRT_TRACE_ERR("check_mmc_fs error(%d)", errno);
+                               _E("check_mmc_fs error(%d)", errno);
                                continue;
                        }
-                       PRT_TRACE_ERR("Can't read the '%s': %s", path, strerror(errno));
+                       _E("Can't read the '%s': %s", path, strerror(errno));
                        inserted_type = FS_TYPE_FAT;
                        goto check_return;
                }
@@ -306,7 +306,7 @@ static int __check_mmc_fs_type(const char *path)
                tmpbuf += ret;
                cnr += ret;
        }
-       PRT_TRACE("mmc search path: %s, %s", path, buf);
+       _D("mmc search path: %s, %s", path, buf);
 
        /* check fs type with magic code */
        for (i = 0; i < ARRAY_SIZE(fs_types); i++)
@@ -317,10 +317,10 @@ static int __check_mmc_fs_type(const char *path)
                ret = read(fd, buf, 2);
                if (ret < 0)
                        goto check_return;
-               PRT_TRACE("mmc search magic : 0x%2x, 0x%2x", buf[0],buf[1]);
+               _D("mmc search magic : 0x%2x, 0x%2x", buf[0],buf[1]);
                if (!memcmp(buf, fs_types[i].magic, fs_types[i].magic_sz)) {
                        inserted_type =  fs_types[i].type;
-                       PRT_TRACE("mmc type : %s", fs_types[i].name);
+                       _D("mmc type : %s", fs_types[i].name);
                        goto check_return;
                }
        }
@@ -338,7 +338,7 @@ static int get_format_type(const char *path)
        unsigned int size;
 
        if (__check_mmc_fs_type(path) != 0) {
-               PRT_TRACE_ERR("fail to check mount point %s", path);
+               _E("fail to check mount point %s", path);
                return -1;
        }
        if (inserted_type == FS_TYPE_EXT4)
@@ -376,16 +376,16 @@ static int check_mount_state(void)
        snprintf(mount_path, sizeof(mount_path), "%s", MMC_MOUNT_POINT);
 
        if (stat(mount_path, &mount_stat) != 0 || stat(parent_path, &parent_stat) != 0) {
-               PRT_TRACE_ERR("get stat error");
+               _E("get stat error");
                return 0;
        }
 
        if (mount_stat.st_dev == parent_stat.st_dev) {
-               PRT_TRACE_ERR("state : UNMOUNT");
+               _E("state : UNMOUNT");
                return 0;
        }
 
-       PRT_TRACE_ERR("state : MOUNT");
+       _E("state : MOUNT");
        return 1;
 }
 
@@ -413,27 +413,27 @@ static int format_mmc(const char *path, int fs)
        int r;
 
        if (path == NULL) {
-               PRT_TRACE_ERR("Invalid parameter");
+               _E("Invalid parameter");
                return -1;
        }
 
        argv = get_argument(path, fs);
        if (argv == NULL) {
-               PRT_TRACE_ERR("get_argument fail");
+               _E("get_argument fail");
                return -1;
        }
 
        mkfs_pid = exec_process(argv);
        if (mkfs_pid < 0) {
-               PRT_TRACE_ERR("%s fail");
+               _E("%s fail");
                return -1;
        }
 
        snprintf(buf, sizeof(buf), "%s%d", "/proc/", mkfs_pid);
-       PRT_TRACE_ERR("child process : %s", buf);
+       _E("child process : %s", buf);
        while (1) {
                sleep(1);
-               PRT_TRACE_ERR("formatting....");
+               _E("formatting....");
                if (access(buf, R_OK) != 0)
                        break;
        }
@@ -448,10 +448,10 @@ static int format_exec(int blknum)
        int fs, r;
 
        if (check_mount_state() == 1) {
-               PRT_TRACE_ERR("Mounted, will be unmounted");
+               _E("Mounted, will be unmounted");
                r = __umount_fs();
                if (r != 0) {
-                       PRT_TRACE_ERR("unmount_mmc fail");
+                       _E("unmount_mmc fail");
                        vconf_set_int(VCONFKEY_SYSMAN_MMC_FORMAT, VCONFKEY_SYSMAN_MMC_FORMAT_FAILED);
                        return -1;
                }
@@ -460,27 +460,27 @@ static int format_exec(int blknum)
        snprintf(dev_mmcblk, sizeof(dev_mmcblk), "%s%d", MMC_DEV, blknum);
        snprintf(dev_mmcblkp, sizeof(dev_mmcblkp), "%sp1", dev_mmcblk);
        if (access(dev_mmcblkp, R_OK) < 0) {
-               PRT_TRACE_ERR("%s is not valid, create the primary partition", dev_mmcblkp);
+               _E("%s is not valid, create the primary partition", dev_mmcblkp);
                r = create_partition(dev_mmcblk);
                if (r < 0) {
-                       PRT_TRACE_ERR("create_partition failed");
+                       _E("create_partition failed");
                        vconf_set_int(VCONFKEY_SYSMAN_MMC_FORMAT, VCONFKEY_SYSMAN_MMC_FORMAT_FAILED);
                        heynoti_publish("mmcblk_remove");
                        return -1;
                }
        }
 
-       PRT_TRACE_ERR("insert type : %d", inserted_type);
+       _E("insert type : %d", inserted_type);
 
        r = format_mmc(dev_mmcblkp, inserted_type);
        if (r < 0) {
-               PRT_TRACE_ERR("%s format fail", dev_mmcblkp);
+               _E("%s format fail", dev_mmcblkp);
                vconf_set_int(VCONFKEY_SYSMAN_MMC_FORMAT, VCONFKEY_SYSMAN_MMC_FORMAT_FAILED);
                heynoti_publish("mmcblk_remove");
                return -1;
        }
 
-       PRT_TRACE_ERR("Format Successful");
+       _E("Format Successful");
        vconf_set_int(VCONFKEY_SYSMAN_MMC_FORMAT, VCONFKEY_SYSMAN_MMC_FORMAT_COMPLETED);
        return 0;
 }
@@ -508,16 +508,16 @@ static int mmc_check_process_launch(int argc,  char **argv)
 
        params = get_check_argument((const char*)argv[1]);
        if ((pid = exec_process(params)) < 0) {
-               PRT_TRACE_ERR("mmc checker failed");
+               _E("mmc checker failed");
                goto run_mount;
        }
 
        snprintf(buf, sizeof(buf), "%s%d", "/proc/", pid);
-       PRT_TRACE_ERR("child process : %s", buf);
+       _E("child process : %s", buf);
 
        while (1) {
                sleep(1);
-               PRT_TRACE_ERR("mmc checking ....");
+               _E("mmc checking ....");
                if (access(buf, R_OK) != 0)
                        break;
        }
@@ -532,17 +532,17 @@ int ss_mmc_unmounted(int argc, char **argv)
        int option = -1;
        int mmc_err = 0;
        if (argc < 1) {
-               PRT_TRACE_ERR("Option is wong");
+               _E("Option is wong");
                return -1;
        }
        if ((option = atoi(argv[0])) < 0) {
-               PRT_TRACE_ERR("Option is wong : %d", option);
+               _E("Option is wong : %d", option);
                return -1;
        }
 
        if (umount2(MMC_MOUNT_POINT, option) != 0) {
                mmc_err = errno;
-               PRT_TRACE_ERR("Failed to unmount mmc card\n");
+               _E("Failed to unmount mmc card\n");
                vconf_set_int(VCONFKEY_SYSMAN_MMC_UNMOUNT,
                              VCONFKEY_SYSMAN_MMC_UNMOUNT_FAILED);
                vconf_set_int(VCONFKEY_SYSMAN_MMC_ERR_STATUS,
@@ -579,13 +579,13 @@ static int __ss_check_smack_popup(void)
        ret = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &val);
        if (val == 1 || ret != 0) {
                if ((mmc_popup_pid = syspopup_launch("mmc-syspopup", b)) < 0) {
-                       PRT_TRACE_EM("popup launch failed\n");
+                       _I("popup launch failed\n");
                }
        }
        bundle_free(b);
 
        if (ss_action_entry_call_internal(PREDEF_CHECK_SMACK_MMC, 0) < 0) {
-               PRT_TRACE_ERR("fail to launch mmc checker,direct mount mmc");
+               _E("fail to launch mmc checker,direct mount mmc");
        }
        return 0;
 
@@ -597,7 +597,7 @@ static int __mount_fs(char *path, const char *fs_name, const char *mount_data)
 
        do {
                if ((ret = mount(path, MMC_MOUNT_POINT, fs_name, 0, mount_data)) == 0) {
-                       PRT_TRACE_ERR("Mounted mmc card %s", fs_name);
+                       _E("Mounted mmc card %s", fs_name);
                        return 0;
                }
                usleep(100000);
@@ -616,21 +616,21 @@ static int __mmc_mount_fs(void)
 
        if (access(MMC_MOUNT_POINT, R_OK) != 0) {
                if (mkdir(MMC_MOUNT_POINT, 0755) < 0) {
-                       PRT_TRACE_ERR("Make Directory is failed");
+                       _E("Make Directory is failed");
                        return errno;
                }
        }
 
        blk_num = get_mmcblk_num();
        if (blk_num  == -1) {
-               PRT_TRACE_ERR("fail to check mmc block");
+               _E("fail to check mmc block");
                return -1;
        }
 
        snprintf(buf, sizeof(buf), "%s%dp1", MMC_DEV, blk_num);
        fd = open(buf, O_RDONLY);
        if (fd < 0) {
-               PRT_TRACE_ERR("can't open the '%s': %s", buf, strerror(errno));
+               _E("can't open the '%s': %s", buf, strerror(errno));
                snprintf(buf, sizeof(buf), "%s%d", MMC_DEV, blk_num);
        } else
                close(fd);
@@ -669,7 +669,7 @@ static int mmc_check_mount(int argc,  char **argv)
        vconf_set_int(VCONFKEY_SYSMAN_MMC_STATUS, VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED);
        vconf_set_int(VCONFKEY_SYSMAN_MMC_MOUNT, VCONFKEY_SYSMAN_MMC_MOUNT_FAILED);
        vconf_set_int(VCONFKEY_SYSMAN_MMC_ERR_STATUS, errno);
-       PRT_TRACE_ERR("Failed to mount mmc card\n");
+       _E("Failed to mount mmc card\n");
        return -1;
 
 mount_complete:
@@ -685,7 +685,7 @@ mount_fail:
        vconf_set_int(VCONFKEY_SYSMAN_MMC_ERR_STATUS, VCONFKEY_SYSMAN_MMC_EINVAL);
        return 0;
 mount_wait:
-       PRT_TRACE_ERR("wait ext4 smack rule checking");
+       _E("wait ext4 smack rule checking");
        return 0;
 }
 
@@ -700,33 +700,33 @@ static int __check_mmc_fs(void)
 
        if (access(MMC_MOUNT_POINT, R_OK) != 0) {
                if (mkdir(MMC_MOUNT_POINT, 0755) < 0) {
-                       PRT_TRACE_ERR("Make Directory is failed");
+                       _E("Make Directory is failed");
                        return errno;
                }
        }
 
        blk_num = get_mmcblk_num();
        if (blk_num  == -1) {
-               PRT_TRACE_ERR("fail to check mmc block");
+               _E("fail to check mmc block");
                return -1;
        }
 
        snprintf(buf, sizeof(buf), "%s%dp1", MMC_DEV, blk_num);
        fd = open(buf, O_RDONLY);
        if (fd < 0) {
-               PRT_TRACE_ERR("can't open the '%s': %s", buf, strerror(errno));
+               _E("can't open the '%s': %s", buf, strerror(errno));
                snprintf(buf, sizeof(buf), "%s%d", MMC_DEV, blk_num);
        }
        else
                close(fd);
 
        if (__check_mmc_fs_type(buf) != 0) {
-               PRT_TRACE_ERR("fail to check mount point %s", buf);
+               _E("fail to check mount point %s", buf);
                return -1;
        }
        snprintf(params, sizeof(params), "%d", inserted_type);
        if (ss_action_entry_call_internal(PREDEF_CHECK_MMC_PROC, 2, params, buf) < 0) {
-               PRT_TRACE_ERR("fail to launch mmc checker,direct mount mmc");
+               _E("fail to launch mmc checker,direct mount mmc");
                ret = mmc_check_mount(0, NULL);
        }
        return ret;
@@ -740,13 +740,13 @@ int ss_mmc_inserted(void)
        vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc_status);
 
        if (mmc_status == VCONFKEY_SYSMAN_MMC_MOUNTED) {
-               PRT_DBG("Mmc is already mounted.\n");
+               _D("Mmc is already mounted.\n");
                vconf_set_int(VCONFKEY_SYSMAN_MMC_MOUNT, VCONFKEY_SYSMAN_MMC_MOUNT_ALREADY);
                return 0;
        }
 
        if ((ret = __check_mmc_fs()) != 0)
-               PRT_TRACE_ERR("fail to check mmc");
+               _E("fail to check mmc");
        return ret;
 }
 
@@ -762,7 +762,7 @@ int ss_mmc_removed(void)
 
 static int ss_mmc_format(int argc, char **argv)
 {
-       PRT_TRACE_ERR("mmc format called");
+       _E("mmc format called");
        __umount_fs();
 
        vconf_set_int(VCONFKEY_SYSMAN_MMC_FORMAT_PROGRESS, VCONFKEY_SYSMAN_MMC_FORMAT_PROGRESS_NOW);
@@ -770,7 +770,7 @@ static int ss_mmc_format(int argc, char **argv)
        vconf_set_int(VCONFKEY_SYSMAN_MMC_FORMAT_PROGRESS, VCONFKEY_SYSMAN_MMC_FORMAT_PROGRESS_NONE);
 
        if (__check_mmc_fs() != 0)
-               PRT_TRACE_ERR("fail to check mmc");
+               _E("fail to check mmc");
 
        return 0;
 }
@@ -779,11 +779,11 @@ static int ss_mmc_check_smack(int argc, char **argv)
 {
        int pid;
        system(FS_EXT4_SMACK_LABEL);
-       PRT_TRACE_ERR("smack labeling script is run");
+       _E("smack labeling script is run");
        vconf_set_int(VCONFKEY_SYSMAN_MMC_STATUS, VCONFKEY_SYSMAN_MMC_MOUNTED);
        vconf_set_int(VCONFKEY_SYSMAN_MMC_MOUNT, VCONFKEY_SYSMAN_MMC_MOUNT_COMPLETED);
        if (mmc_popup_pid > 0) {
-               PRT_TRACE_ERR("will be killed mmc-popup(%d)", mmc_popup_pid);
+               _E("will be killed mmc-popup(%d)", mmc_popup_pid);
                kill(mmc_popup_pid, SIGTERM);
        }
        return 0;
@@ -799,6 +799,6 @@ int ss_mmc_init(void)
        ss_action_entry_add_internal(PREDEF_CHECK_MMC_PROC, mmc_check_process_launch, NULL, NULL);
        /* mmc card mount */
        if (__check_mmc_fs() != 0)
-               PRT_TRACE_ERR("fail to check mmc");
+               _E("fail to check mmc");
        return 0;
 }
index c76b605..3e61878 100644 (file)
@@ -80,7 +80,7 @@ static int remove_shm()
 
        maxid = shmctl(0, SHM_INFO, (struct shmid_ds *)(void *)&shm_info);
        if (maxid < 0) {
-               PRT_TRACE_ERR("shared mem error\n");
+               _E("shared mem error\n");
                return -1;
        }
 
@@ -89,7 +89,7 @@ static int remove_shm()
                if (shmid < 0)
                        continue;
                if (shmseg.shm_nattch == 0) {
-                       PRT_TRACE("shared memory killer ==> %d killed\n",
+                       _D("shared memory killer ==> %d killed\n",
                                  shmid);
                        shmctl(shmid, IPC_RMID, NULL);
                }
@@ -121,7 +121,7 @@ static char *convert_to_str(unsigned int mem_state)
 
 static void print_lowmem_state(unsigned int mem_state)
 {
-       PRT_TRACE("[LOW MEM STATE] %s ==> %s", convert_to_str(cur_mem_state),
+       _D("[LOW MEM STATE] %s ==> %s", convert_to_str(cur_mem_state),
                  convert_to_str(mem_state));
 }
 #define BUF_MAX 1024
@@ -136,13 +136,13 @@ static int get_lowmemnotify_info(FILE *output_fp)
        fp = fopen("/sys/class/memnotify/meminfo", "r");
        if (fp == NULL)
                return -1;
-       PRT_TRACE("make LOWMEM_LOG");
+       _D("make LOWMEM_LOG");
        fprintf(output_fp,
                "====================================================================\n");
        fprintf(output_fp, "MEMORY INFO by lowmemnotify\n");
 
        while (fgets(line, BUF_MAX, fp) != NULL) {
-               PRT_TRACE("%s",line);
+               _D("%s",line);
                fputs(line, output_fp);
        }
        fclose(fp);
@@ -166,17 +166,17 @@ static void make_LMM_log(char *file, pid_t pid, char *victim_name)
        now = time(NULL);
        cur_tm = (struct tm *)malloc(sizeof(struct tm));
        if (cur_tm == NULL) {
-               PRT_TRACE_ERR("Fail to memory allocation");
+               _E("Fail to memory allocation");
                return;
        }
 
        if (localtime_r(&now, cur_tm) == NULL) {
-               PRT_TRACE_ERR("Fail to get localtime");
+               _E("Fail to get localtime");
                free(cur_tm);
                return;
        }
 
-       PRT_TRACE("%s_%s_%d_%.4d%.2d%.2d_%.2d%.2d%.2d.log", file, victim_name,
+       _D("%s_%s_%d_%.4d%.2d%.2d_%.2d%.2d%.2d.log", file, victim_name,
                 pid, (1900 + cur_tm->tm_year), 1 + cur_tm->tm_mon,
                 cur_tm->tm_mday, cur_tm->tm_hour, cur_tm->tm_min,
                 cur_tm->tm_sec);
@@ -188,7 +188,7 @@ static void make_LMM_log(char *file, pid_t pid, char *victim_name)
 
        output_file = fopen(new_log, "w+");
        if(!output_file) {
-               PRT_TRACE_ERR("cannot open output file(%s)",new_log);
+               _E("cannot open output file(%s)",new_log);
                free(cur_tm);
                return;
        }
@@ -203,7 +203,7 @@ static int memory_low_act(void *data)
 {
        char lowmem_noti_name[NAME_MAX];
 
-       PRT_TRACE("[LOW MEM STATE] memory low state");
+       _D("[LOW MEM STATE] memory low state");
        make_LMM_log("/var/log/memps", 1, "LOWMEM_WARNING");
        remove_shm();
 
@@ -220,9 +220,9 @@ static int memory_oom_act(void *data)
        unsigned int cur_time;
        char lowmem_noti_name[NAME_MAX];
 
-       PRT_TRACE("[LOW MEM STATE] memory oom state");
+       _D("[LOW MEM STATE] memory oom state");
        cur_time = time(NULL);
-       PRT_TRACE("cur=%d, old=%d, cur-old=%d", cur_time, oom_delete_sm_time,
+       _D("cur=%d, old=%d, cur-old=%d", cur_time, oom_delete_sm_time,
                  cur_time - oom_delete_sm_time);
        if (cur_time - oom_delete_sm_time > 15) {
                remove_shm();
@@ -243,7 +243,7 @@ static int memory_oom_act(void *data)
 
 static int memory_normal_act(void *data)
 {
-       PRT_TRACE("[LOW MEM STATE] memory normal state");
+       _D("[LOW MEM STATE] memory normal state");
        vconf_set_int(VCONFKEY_SYSMAN_LOW_MEMORY,
                      VCONFKEY_SYSMAN_LOW_MEMORY_NORMAL);
        return 0;
@@ -283,14 +283,14 @@ static int lowmem_cb(void *data, Ecore_Fd_Handler * fd_handler)
        unsigned int mem_state;
 
        if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ)) {
-               PRT_TRACE_ERR
+               _E
                    ("ecore_main_fd_handler_active_get error , return\n");
                return 1;
        }
 
        fd = ecore_main_fd_handler_fd_get(fd_handler);
        if (fd < 0) {
-               PRT_TRACE_ERR("ecore_main_fd_handler_fd_get error , return");
+               _E("ecore_main_fd_handler_fd_get error , return");
                return 1;
        }
        mem_state = lowmem_read(fd);
@@ -304,12 +304,12 @@ static int lowmem_cb(void *data, Ecore_Fd_Handler * fd_handler)
 static int set_threshold()
 {
        if (device_set_property(DEVICE_TYPE_MEMORY, PROP_MEMORY_THRESHOLD_LV1, MEM_THRESHOLD_LV1) < 0) {
-               PRT_TRACE_ERR("Set memnorify threshold lv1 failed");
+               _E("Set memnorify threshold lv1 failed");
                return -1;
        }
 
        if (device_set_property(DEVICE_TYPE_MEMORY, PROP_MEMORY_THRESHOLD_LV2, MEM_THRESHOLD_LV2) < 0) {
-               PRT_TRACE_ERR("Set memnorify threshold lv2 failed");
+               _E("Set memnorify threshold lv2 failed");
                return -1;
        }
 
@@ -321,13 +321,13 @@ int ss_lowmem_init(struct ss_main_data *ad)
        char lowmem_dev_node[PATH_MAX];
 
        if (device_get_property(DEVICE_TYPE_MEMORY, PROP_MEMORY_NODE, lowmem_dev_node) < 0) {
-               PRT_TRACE_ERR("Low memory handler fd init failed");
+               _E("Low memory handler fd init failed");
                return -1;
        }
 
        lowmem_fd = open(lowmem_dev_node, O_RDONLY);
        if (lowmem_fd < 0) {
-               PRT_TRACE_ERR("ss_lowmem_init fd open failed");
+               _E("ss_lowmem_init fd open failed");
                return -1;
        }
 
@@ -335,7 +335,7 @@ int ss_lowmem_init(struct ss_main_data *ad)
        ecore_main_fd_handler_add(lowmem_fd, ECORE_FD_READ, lowmem_cb, ad, NULL,
                                  NULL);
        if (set_threshold() < 0) {
-               PRT_TRACE_ERR("Setting lowmem threshold is failed");
+               _E("Setting lowmem threshold is failed");
                return -1;
        }
 
index 6371556..0614f72 100644 (file)
@@ -55,20 +55,20 @@ static char *pmon_get_permanent_pname(int pid)
        snprintf(buf, sizeof(buf), "%s/%d", PMON_PERMANENT_DIR, pid);
        fd = open(buf, O_RDONLY);
        if (fd == -1) {
-               PRT_TRACE_ERR("file open error");
+               _E("file open error");
                return NULL;
        }
 
        if (fstat(fd, &st) < 0) {
-               PRT_TRACE_ERR("fstat error");
+               _E("fstat error");
                close(fd);
                return NULL;
        }
-       PRT_TRACE("size = %d", (int)st.st_size);
+       _D("size = %d", (int)st.st_size);
 
        cmdline = malloc(st.st_size + 1);
        if (cmdline == NULL) {
-               PRT_TRACE_ERR("Not enough memory");
+               _E("Not enough memory");
                close(fd);
                return NULL;
        }
@@ -84,7 +84,7 @@ static char *pmon_get_permanent_pname(int pid)
 
 static void print_pmon_state(unsigned int dead_pid)
 {
-       PRT_TRACE("[Process MON] %d killed", dead_pid);
+       _D("[Process MON] %d killed", dead_pid);
 }
 
 static int pmon_process(int pid, void *ad)
@@ -96,16 +96,16 @@ static int pmon_process(int pid, void *ad)
        int r;
 
        if (sysconf_is_vip(pid)) {
-               PRT_TRACE_ERR("=======================================");
-               PRT_TRACE_ERR("[Process MON] VIP process dead.");
-               PRT_TRACE_ERR("=======================================");
+               _E("=======================================");
+               _E("[Process MON] VIP process dead.");
+               _E("=======================================");
        }
        /* If there is NOT a .hibernation_start file, run following codes 
         * On hibernation processing, just ignore relaunching */
        else if (access("/tmp/.hibernation_start", R_OK) != 0) {
                cmdline = pmon_get_permanent_pname(pid);
                if (cmdline != NULL) {
-                       PRT_TRACE("[Process MON] %s relaunch", cmdline);
+                       _D("[Process MON] %s relaunch", cmdline);
                        new_pid = ss_launch_evenif_exist(cmdline, "");
                        free(cmdline);
                        if (new_pid > 0) {
@@ -115,10 +115,10 @@ static int pmon_process(int pid, void *ad)
                                int cnt;
 
                                if (access(PMON_PERMANENT_DIR, R_OK) < 0) {
-                                       PRT_TRACE("no predefined matrix dir = %s, so created", PMON_PERMANENT_DIR);
+                                       _D("no predefined matrix dir = %s, so created", PMON_PERMANENT_DIR);
                                        r = mkdir(PMON_PERMANENT_DIR, 0777);
                                        if(r < 0) {
-                                               PRT_TRACE("Make Directory is failed");
+                                               _D("Make Directory is failed");
                                                return -1;
                                        }
                                }
@@ -126,14 +126,14 @@ static int pmon_process(int pid, void *ad)
                                snprintf(filepath, sizeof(filepath), "%s/%d", PMON_PERMANENT_DIR, pid);
                                fd = open(filepath, O_RDONLY);
                                if (fd == -1) {
-                                       PRT_TRACE("Failed to open");
+                                       _D("Failed to open");
                                        return -1;
                                }
                                cnt = read(fd, buf, PATH_MAX);
                                close(fd);
 
                                if (cnt <= 0) {
-                                       PRT_TRACE("Failed to read");
+                                       _D("Failed to read");
                                        return -1;
                                }
 
@@ -141,23 +141,23 @@ static int pmon_process(int pid, void *ad)
 
                                fd = open(filepath, O_CREAT | O_WRONLY, 0644);
                                if (fd == -1) {
-                                       PRT_TRACE("Failed to open");
+                                       _D("Failed to open");
                                        return -1;
                                }
                                if (write(fd, buf, cnt) == -1) {
-                                       PRT_TRACE("Failed to write");
+                                       _D("Failed to write");
                                        close(fd);
                                        return -1;
                                }
                                close(fd);
                                if ( device_set_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_MP_PNP, new_pid) < 0) {
-                                       PRT_TRACE_ERR("Write new pid failed");
+                                       _E("Write new pid failed");
                                }
-                               PRT_TRACE("[Process MON] %d ", new_pid);
+                               _D("[Process MON] %d ", new_pid);
 
                                FILE *fp;
 
-                               PRT_TRACE
+                               _D
                                    ("[Process MON] OOMADJ_SET : pid %d, new_oomadj %d",
                                     new_pid, (-17));
                                
@@ -171,7 +171,7 @@ static int pmon_process(int pid, void *ad)
                                         PMON_PERMANENT_DIR, pid);
                                unlink(old_file);
                        } else { 
-                               PRT_TRACE_ERR("[Process MON] failed relaunching");
+                               _E("[Process MON] failed relaunching");
                        }
                }
        }
@@ -192,7 +192,7 @@ static int pmon_cb(void *data, Ecore_Fd_Handler * fd_handler)
        struct ss_main_data *ad = (struct ss_main_data *)data;
        int dead_pid;
        if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ)) {
-               PRT_TRACE_ERR
+               _E
                    ("ecore_main_fd_handler_active_get error , return\n");
                return -1;
        }
@@ -200,12 +200,12 @@ static int pmon_cb(void *data, Ecore_Fd_Handler * fd_handler)
        fd = ecore_main_fd_handler_fd_get(fd_handler);
 
        if (fd < 0) {
-               PRT_TRACE_ERR("ecore_main_fd_handler_fd_get error , return");
+               _E("ecore_main_fd_handler_fd_get error , return");
                return -1;
        }
        if (read(fd, &dead_pid, sizeof(dead_pid)) < 0) {
                __pmon_stop(fd);
-               PRT_TRACE_ERR("Reading DEAD_PID failed, restart ecore fd");
+               _E("Reading DEAD_PID failed, restart ecore fd");
                __pmon_start(ad);
                return -1;
        }
@@ -224,7 +224,7 @@ int ss_pmon_init(struct ss_main_data *ad)
                pmon_efd = NULL;
        }
        if (__pmon_start(ad) == -1) {
-               PRT_TRACE_ERR("fail pmon control fd init");
+               _E("fail pmon control fd init");
                return -1;
        }
        return 0;
@@ -236,18 +236,18 @@ static int __pmon_start(struct ss_main_data *ad)
        char pmon_dev_node[PATH_MAX];
 
        if (device_get_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_NODE, pmon_dev_node) < 0) {
-               PRT_TRACE_ERR("ss_pmon_init get dev node path failed");
+               _E("ss_pmon_init get dev node path failed");
                return -1;
        }
 
        pmon_fd = open(pmon_dev_node, O_RDONLY);
        if (pmon_fd < 0) {
-               PRT_TRACE_ERR("ss_pmon_init fd open failed");
+               _E("ss_pmon_init fd open failed");
                return -1;
        }
        pmon_efd = ecore_main_fd_handler_add(pmon_fd, ECORE_FD_READ, pmon_cb, ad, NULL, NULL);
        if (!pmon_efd) {
-               PRT_TRACE_ERR("error ecore_main_fd_handler_add");
+               _E("error ecore_main_fd_handler_add");
                return -1;
        }
        return 0;
index d951760..1302079 100755 (executable)
@@ -73,13 +73,13 @@ int set_app_oomadj(pid_t pid, int new_oomadj)
        }
        old_oomadj = atoi(buf);
        fclose(fp);
-       PRT_TRACE_EM("Process %s, pid %d, old_oomadj %d", exe_name, pid,
+       _I("Process %s, pid %d, old_oomadj %d", exe_name, pid,
                     old_oomadj);
 
        if (old_oomadj < OOMADJ_APP_LIMIT)
                return 0;
 
-       PRT_TRACE_EM("Process %s, pid %d, new_oomadj %d", exe_name, pid,
+       _I("Process %s, pid %d, new_oomadj %d", exe_name, pid,
                     new_oomadj);
        snprintf(buf, sizeof(buf), "/proc/%d/oom_adj", pid);
        fp = fopen(buf, "w");
@@ -105,7 +105,7 @@ int set_oomadj_action(int argc, char **argv)
        char buf[255];
        FILE *fp;
 
-       PRT_TRACE_EM("OOMADJ_SET : pid %d, new_oomadj %d", pid, new_oomadj);
+       _I("OOMADJ_SET : pid %d, new_oomadj %d", pid, new_oomadj);
        snprintf(buf, sizeof(buf), "/proc/%d/oom_adj", pid);
        fp = fopen(buf, "w");
        if (fp == NULL)
@@ -145,7 +145,7 @@ int check_and_set_old_backgrd()
 
        dp = opendir("/proc");
        if (!dp) {
-               PRT_TRACE_EM("BACKGRD MANAGE : fail to open /proc : %s", strerror(errno));
+               _I("BACKGRD MANAGE : fail to open /proc : %s", strerror(errno));
                return -1;
        }
 
@@ -172,7 +172,7 @@ int check_and_set_old_backgrd()
                                        break;
                        }
                        if (i >= LIMITED_BACKGRD_NUM)
-                               PRT_TRACE_EM("BACKGRB MANAGE : background applications(oom_adj %d) exceeds limitation", i);
+                               _I("BACKGRB MANAGE : background applications(oom_adj %d) exceeds limitation", i);
                        else
                                bucket[i] = pid;
                }
@@ -230,7 +230,7 @@ int set_active_action(int argc, char **argv)
                if(oomadj > OOMADJ_BACKGRD_UNLOCKED) {
                        ret = set_app_oomadj((pid_t) pid, OOMADJ_BACKGRD_LOCKED);
                } else {
-                       PRT_TRACE_EM("Unknown oomadj value (%d) !", oomadj);
+                       _I("Unknown oomadj value (%d) !", oomadj);
                        ret = -1;
                }
                break;
@@ -273,7 +273,7 @@ int set_inactive_action(int argc, char **argv)
                if(oomadj > OOMADJ_BACKGRD_UNLOCKED) {
                        ret = 0;
                } else {
-                       PRT_TRACE_EM("Unknown oomadj value (%d) !", oomadj);
+                       _I("Unknown oomadj value (%d) !", oomadj);
                        ret = -1;
                }
                break;
@@ -315,7 +315,7 @@ int set_foregrd_action(int argc, char **argv)
                if(oomadj > OOMADJ_BACKGRD_UNLOCKED) {
                        ret = set_app_oomadj((pid_t) pid, OOMADJ_FOREGRD_UNLOCKED);
                } else {                
-                       PRT_TRACE_EM("Unknown oomadj value (%d) !", oomadj);
+                       _I("Unknown oomadj value (%d) !", oomadj);
                        ret = -1;                                       
                }
                break;
@@ -358,7 +358,7 @@ int set_backgrd_action(int argc, char **argv)
                if(oomadj > OOMADJ_BACKGRD_UNLOCKED) {
                        ret = 0;
                } else {                
-                       PRT_TRACE_EM("Unknown oomadj value (%d) !", oomadj);
+                       _I("Unknown oomadj value (%d) !", oomadj);
                        ret = -1;                                       
                }
                break;
@@ -382,9 +382,9 @@ int set_process_group_action(int argc, char **argv)
                ret = device_set_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_MP_PNP, pid);
 
        if (ret == 0)
-               PRT_TRACE_ERR("%s : pid %d", argv[1], pid);
+               _E("%s : pid %d", argv[1], pid);
        else
-               PRT_TRACE_ERR("fail to set %s : pid %d",argv[1], pid);
+               _E("fail to set %s : pid %d",argv[1], pid);
        return 0;
 }
 
index 78e7e47..43a9ef2 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * deviced
+ *
  * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the License);
 #ifndef __LOG_H__
 #define __LOG_H__
 
-#include <stdio.h>
-
-#if defined(ENABLE_DLOG_OUT)
-#define LOG_TAG                "DEVICED"
-#include <dlog.h>
-#define DLOG_ERR               DLOG_ERROR
-#define __LOG(prio, fmt, arg...) \
-       do { SLOG(prio, LOG_TAG, fmt, ##arg); } while (0)
-#define __LOGD(prio, fmt, arg...) \
-       do { SLOG(prio, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); } while (0)
-#define __PRT(prio, fmt, arg...) \
-       do { fprintf(((D##prio) == DLOG_ERR ? stderr : stdout), fmt"\n", ##arg); } while (0)
-#define __PRTD(prio, fmt, arg...) \
-       do { \
-               fprintf(((D##prio) == DLOG_ERR ? stderr : stdout), \
-                               "%s: %s(%d) > "fmt"\n", __MODULE__, __func__, __LINE__, ##arg); \
-       } while (0)
-#else
-#include <syslog.h>
-#define __LOG(prio, fmt, arg...) \
-       do { syslog(prio, fmt, ##arg); } while (0)
-#define __LOGD(prio, fmt, arg...) \
-       do { syslog(prio, "%s: %s(%d) > "fmt"\n", __MODULE__, __func__, __LINE__, ##arg); } while (0)
-#define __PRT(prio, fmt, arg...) \
-       do { fprintf(((prio) == LOG_ERR ? stderr : stdout), fmt"\n", ##arg); } while (0)
-#define __PRTD(prio, fmt, arg...) \
-       do { \
-               fprintf(((prio) == LOG_ERR ? stderr : stdout), \
-                                "%s: %s(%d) > "fmt"\n", __MODULE__, __func__, __LINE__, ##arg); \
-       } while (0)
-#endif
-
-#ifdef DEBUG
-extern int g_trace_depth;
-#define __PRT_TRACE(prio, fmt, arg...) \
-       do { __LOGD(prio, fmt, ##arg); } while (0)
-/*     do { \
-               int ___i;\
-               for(___i=0;___i<g_trace_depth;___i++)\
-               {\
-                       fprintf(stdout, "  "); \
-               }\
-               fprintf(stdout,\
-                       "[%s:%d] "fmt"\n", __FUNCTION__, __LINE__,##arg); \
-               __LOGD(prio, fmt, ##arg); \
-       } while (0) */
-#define __PRT_TRACE_ERR(prio, fmt, arg...) \
-       do { __LOGD(prio, fmt, ##arg); } while (0)
-/*     do { \
-               int ___i;\
-               for(___i=0;___i<g_trace_depth;___i++)\
-               {\
-                       fprintf(stdout, "  "); \
-               }\
-               printf(\
-                       "%c[1;31m[%s:%d] "fmt"%c[0m\n",27, __FUNCTION__, __LINE__,##arg,27); \
-               __LOGD(prio, fmt, ##arg); \
-       } while (0)*/
-#define __PRT_TRACE_EM(prio, fmt, arg...) \
-       do { __LOGD(prio, fmt, ##arg); } while (0)
-/*     do { \
-               int ___i;\
-               for(___i=0;___i<g_trace_depth;___i++)\
-               {\
-                       fprintf(stdout, "  "); \
-               }\
-               printf(\
-                       "%c[1;34m[%s:%d] "fmt"%c[0m\n",27, __FUNCTION__, __LINE__,##arg,27); \
-               __LOGD(prio, fmt, ##arg); \
-       } while (0)*/
+#ifndef FEATURE_DEVICED_DLOG
+#define FEATURE_DEVICED_DLOG
 #endif
 
-#define _NOUT(prio, fmt, arg...) do { } while (0)
-
-#ifdef DEBUG
-#  define _LOGD __LOGD
-#  define _LOG  __LOGD
-#  define _PRTD __PRTD
-#  define _PRT  __PRTD
-#  define _PRT_TRACE __PRT_TRACE
-#  define _PRT_TRACE_ERR __PRT_TRACE_ERR
-#  define _PRT_TRACE_EM __PRT_TRACE_EM
-#else
-#  define _LOGD _NOUT
-#  define _LOG  __LOG
-#  define _PRTD _NOUT
-#  define _PRT  __PRT
-#  define _PRT_TRACE _NOUT
-#  define _PRT_TRACE_ERR _NOUT
-#  define _PRT_TRACE_EM _NOUT
-#endif
-
-#define PRT_INFO(fmt, arg...) _PRT(LOG_INFO, fmt, ##arg)
-#define PRT_ERR(fmt, arg...) _PRT(LOG_ERR, fmt, ##arg)
-#define PRT_DBG(fmt, arg...) _PRTD(LOG_DEBUG, fmt, ##arg)
-#define PRT_TRACE(fmt, arg...) _PRT_TRACE(LOG_DEBUG, fmt, ##arg)
-#define PRT_TRACE_ERR(fmt, arg...) _PRT_TRACE_ERR(LOG_ERR, fmt, ##arg)
-#define PRT_TRACE_EM(fmt, arg...) _PRT_TRACE_EM(LOG_DEBUG, fmt, ##arg)
-
-#if defined(SYSLOG_OUT)
-#  define SYSLOG_INFO(fmt, arg...) _LOG(LOG_INFO, fmt, ##arg)
-#  define SYSLOG_ERR(fmt, arg...) _LOG(LOG_ERR, fmt, ##arg)
-#  define SYSLOG_DBG(fmt, arg...) _LOGD(LOG_DEBUG, fmt, ##arg)
-#  define INFO SYSLOG_INFO
-#  define ERR SYSLOG_ERR
-#  define DBG SYSLOG_DBG
-#elif defined(ENABLE_DLOG_OUT)
-#  define INFO SLOGI
-#  define ERR SLOGE
-#  define DBG SLOGD
+#ifdef FEATURE_DEVICED_DLOG
+#define LOG_TAG "DEVICED"
+#include <dlog.h>
+#define _D(fmt, arg...) \
+       do { SLOGD(fmt, ##arg); } while(0)
+#define _I(fmt, arg...) \
+       do { SLOGI(fmt, ##arg); } while(0)
+#define _W(fmt, arg...) \
+       do { SLOGW(fmt, ##arg); } while(0)
+#define _E(fmt, arg...) \
+       do { SLOGE(fmt, ##arg); } while(0)
+#define _SD(fmt, arg...) \
+       do { SECURE_SLOGD(fmt, ##arg); } while(0)
+#define _SI(fmt, arg...) \
+       do { SECURE_SLOGI(fmt, ##arg); } while(0)
+#define _SW(fmt, arg...) \
+       do { SECURE_SLOGW(fmt, ##arg); } while(0)
+#define _SE(fmt, arg...) \
+       do { SECURE_SLOGE(fmt, ##arg); } while(0)
 #else
-#  define INFO PRT_INFO
-#  define ERR PRT_ERR
-#  define DBG PRT_DBG
+#define _D(x, ...)     do { } while (0)
+#define _I(x, ...)     do { } while (0)
+#define _W(x, ...)     do { } while (0)
+#define _E(x, ...)     do { } while (0)
+#define _SD(fmt, args...)      do { } while (0)
+#define _SI(fmt, args...)      do { } while (0)
+#define _SW(fmt, args...)      do { } while (0)
+#define _SE(fmt, args...)      do { } while (0)
 #endif
 
 #endif
index d28349a..e2d1ca9 100644 (file)
@@ -29,7 +29,7 @@ int ss_ta_init()
 {
        int val = -1, i = 0, pid;
 
-       PRT_TRACE("check ta connection");
+       _D("check ta connection");
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_TA_ONLINE, &val) == 0) {
                if ( val==1 ) {
                        vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS,
@@ -40,7 +40,7 @@ int ss_ta_init()
                                i++;
                                sleep(1);
                        }
-                       PRT_TRACE("ta is connected");
+                       _D("ta is connected");
                }
                else if ( val==0 )
                        vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS,
index 367554b..546aee3 100644 (file)
@@ -83,7 +83,7 @@ int handle_timezone(char *str)
                return -1;
        const char *tzpath = str;
 
-       PRT_TRACE("TZPATH = %s\n", tzpath);
+       _D("TZPATH = %s\n", tzpath);
 
        /* unlink current link
         * eg. rm /opt/etc/localtime */
@@ -92,11 +92,11 @@ int handle_timezone(char *str)
        } else {
                ret = unlink(sympath);
                if (ret < 0) {
-                       PRT_TRACE("unlink error : [%d]%s\n", ret,
+                       _D("unlink error : [%d]%s\n", ret,
                                  strerror(errno));
                        return -1;
                } else
-                       PRT_TRACE("unlink success\n");
+                       _D("unlink success\n");
 
        }
 
@@ -104,10 +104,10 @@ int handle_timezone(char *str)
         * eg. ln -s /usr/share/zoneinfo/Asia/Seoul /opt/etc/localtime */
        ret = symlink(tzpath, sympath);
        if (ret < 0) {
-               PRT_TRACE("symlink error : [%d]%s\n", ret, strerror(errno));
+               _D("symlink error : [%d]%s\n", ret, strerror(errno));
                return -1;
        } else
-               PRT_TRACE("symlink success\n");
+               _D("symlink success\n");
 
        tzset();
        return 0;
@@ -128,7 +128,7 @@ int handle_date(char *str)
        tmp = (long int)atoi(str);
        timet = (time_t) tmp;
 
-       PRT_TRACE("ctime = %s", ctime(&timet));
+       _D("ctime = %s", ctime(&timet));
        vconf_set_int(VCONFKEY_SYSTEM_TIMECHANGE, timet);
 
        return 0;
@@ -141,7 +141,7 @@ int set_datetime_action(int argc, char **argv)
        if (argc < 1)
                return -1;
        if (vconf_get_int(VCONFKEY_PM_STATE, &ret) != 0)
-               PRT_TRACE("Fail to get vconf value for pm state\n");
+               _D("Fail to get vconf value for pm state\n");
        if (ret == 1)
                pm_state = 0x1;
        else if (ret == 2)
@@ -162,7 +162,7 @@ int set_timezone_action(int argc, char **argv)
        if (argc < 1)
                return -1;
        if (vconf_get_int(VCONFKEY_PM_STATE, &ret) != 0)
-               PRT_TRACE("Fail to get vconf value for pm state\n");
+               _D("Fail to get vconf value for pm state\n");
        if (ret == 1)
                pm_state = 0x1;
        else if (ret == 2)
@@ -182,21 +182,21 @@ static int timerfd_check_start(void)
        struct itimerspec tmr;
 
        if ((tfd = timerfd_create(CLOCK_REALTIME,TFD_NONBLOCK|TFD_CLOEXEC)) == -1) {
-               PRT_TRACE_ERR("error timerfd_create() %d",errno);
+               _E("error timerfd_create() %d",errno);
                tfdh = NULL;
                return -1;
        }
 
        tfdh = ecore_main_fd_handler_add(tfd,ECORE_FD_READ,tfd_cb,NULL,NULL,NULL);
        if (!tfdh) {
-               PRT_TRACE_ERR("error ecore_main_fd_handler_add");
+               _E("error ecore_main_fd_handler_add");
                return -1;
        }
        memset(&tmr, 0, sizeof(tmr));
        tmr.it_value.tv_sec = default_time;
 
        if (timerfd_settime(tfd,TFD_TIMER_ABSTIME|TFD_TIMER_CANCELON_SET,&tmr,NULL) < 0) {
-               PRT_TRACE_ERR("error timerfd_settime() %d",errno);
+               _E("error timerfd_settime() %d",errno);
                return -1;
        }
        return 0;
@@ -222,12 +222,12 @@ static int tfd_cb(void *data, Ecore_Fd_Handler * fd_handler)
        int ret = -1;
 
        if (!ecore_main_fd_handler_active_get(fd_handler,ECORE_FD_READ)) {
-               PRT_TRACE_ERR("error ecore_main_fd_handler_get()");
+               _E("error ecore_main_fd_handler_get()");
                return -1;
        }
 
        if((tfd = ecore_main_fd_handler_fd_get(fd_handler)) == -1) {
-               PRT_TRACE_ERR("error ecore_main_fd_handler_fd_get()");
+               _E("error ecore_main_fd_handler_fd_get()");
                return -1;
        }
 
@@ -236,10 +236,10 @@ static int tfd_cb(void *data, Ecore_Fd_Handler * fd_handler)
        if (ret < 0 && errno == ECANCELED) {
                vconf_set_int(VCONFKEY_SYSMAN_STIME, VCONFKEY_SYSMAN_STIME_CHANGED);
                timerfd_check_stop(tfd);
-               PRT_TRACE("NOTIFICATION here");
+               _D("NOTIFICATION here");
                timerfd_check_start();
        } else {
-               PRT_TRACE("unexpected read (err:%d)",errno);
+               _D("unexpected read (err:%d)",errno);
        }
        return 0;
 }
@@ -251,7 +251,7 @@ int ss_time_manager_init(void)
        ss_action_entry_add_internal(PREDEF_SET_TIMEZONE, set_timezone_action,
                                     NULL, NULL);
        if (timerfd_check_start() == -1) {
-               PRT_TRACE_ERR("fail system time change detector init");
+               _E("fail system time change detector init");
                return -1;
        }
        return 0;
index f2b1238..6940005 100644 (file)
@@ -31,7 +31,7 @@ int ss_usb_init()
 {
        int val = -1, i = 0, pid;
 
-       PRT_TRACE("check usb connection");
+       _D("check usb connection");
        if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_USB_ONLINE, &val) == 0) {
                if (val==1) {
                        vconf_set_int(VCONFKEY_SYSMAN_USB_STATUS,
@@ -43,7 +43,7 @@ int ss_usb_init()
                        }
                        pid = ss_launch_if_noexist(USBCON_EXEC_PATH, NULL);
                        if (pid < 0) {
-                               PRT_TRACE_ERR("usb appl launching failed\n");
+                               _E("usb appl launching failed\n");
                                return -1;
                        }
                }
index 30ca3cd..460fce5 100644 (file)
@@ -76,7 +76,7 @@ static void stop_all_device(gpointer data, gpointer user_data)
 
        node->level = 0;
        node->play = 0;
-       PRT_TRACE_ERR("node handle : %d, level : %d, play : %d", node->handle, node->level, node->play);
+       _E("node handle : %d, level : %d, play : %d", node->handle, node->level, node->play);
 }
 #endif
 static int haptic_play(int handle)
@@ -84,10 +84,10 @@ static int haptic_play(int handle)
        struct haptic_node *node;
        int r;
 
-       PRT_TRACE("handle : %d", handle);
+       _D("handle : %d", handle);
        node = find_node(handle);
        if (node == NULL) {
-               PRT_TRACE_ERR("find_node(%d) fail", handle);
+               _E("find_node(%d) fail", handle);
                return -1;
        }
 #ifndef MERGE_BTW_APPLICATIONS
@@ -95,7 +95,7 @@ static int haptic_play(int handle)
 #endif
        r = device_set_property(DEVICE_TYPE_VIBRATOR, PROP_VIBRATOR_ENABLE, 1);
        if (r < 0) {
-               PRT_TRACE_ERR("set enable fail");
+               _E("set enable fail");
                return -1;
        }
 
@@ -109,22 +109,22 @@ static int haptic_oneshot(int handle, int duration, int level)
        struct haptic_node *node;
        int r;
 
-       PRT_TRACE("handle : %d", handle);
+       _D("handle : %d", handle);
        node = find_node(handle);
        if (node == NULL) {
-               PRT_TRACE_ERR("find_node(%d) fail", handle);
+               _E("find_node(%d) fail", handle);
                return 0;
        }
 
        r = device_set_property(DEVICE_TYPE_VIBRATOR, PROP_VIBRATOR_LEVEL, level);
        if (r < 0) {
-               PRT_TRACE_ERR("set level fail");
+               _E("set level fail");
                return -1;
        }
 
        r = device_set_property(DEVICE_TYPE_VIBRATOR, PROP_VIBRATOR_ONESHOT, duration);
        if (r < 0) {
-               PRT_TRACE_ERR("set oneshot fail");
+               _E("set oneshot fail");
                return -1;
        }
 
@@ -137,7 +137,7 @@ static void check_play_state(gpointer data, gpointer user_data)
        int *play = (int*)user_data;
 
        *play += node->play;
-       PRT_TRACE_ERR("node handle : %d, level : %d, play : %d", node->handle, node->level, node->play);
+       _E("node handle : %d, level : %d, play : %d", node->handle, node->level, node->play);
 }
 
 static int haptic_stop(int handle)
@@ -146,10 +146,10 @@ static int haptic_stop(int handle)
        int play = 0;
        int r;
 
-       PRT_TRACE("handle : %d", handle);
+       _D("handle : %d", handle);
        node = find_node(handle);
        if (node == NULL) {
-               PRT_TRACE_ERR("find_node(%d) fail", handle);
+               _E("find_node(%d) fail", handle);
                return -1;
        }
 
@@ -157,13 +157,13 @@ static int haptic_stop(int handle)
        node->play = 0;
 
        g_list_foreach(haptic_head, check_play_state, &play);
-       PRT_TRACE_ERR("play state : %d", play);
+       _E("play state : %d", play);
 
        if (!play) {
-               PRT_TRACE_ERR("not playing anymore, will be stop");
+               _E("not playing anymore, will be stop");
                r = device_set_property(DEVICE_TYPE_VIBRATOR, PROP_VIBRATOR_ENABLE, 0);
                if (r < 0) {
-                       PRT_TRACE_ERR("set enable fail");
+                       _E("set enable fail");
                        return -1;
                }
        }
@@ -176,9 +176,9 @@ static void get_current_level(gpointer data, gpointer user_data)
        struct haptic_node *node = (struct haptic_node*)data;
        int *sum = (int*)user_data;
 
-       PRT_TRACE_ERR("node handle : %d, level : %d, play : %d", node->handle, node->level, node->play);
+       _E("node handle : %d, level : %d, play : %d", node->handle, node->level, node->play);
        if (node->play == 1) {
-               PRT_TRACE_ERR("node->play : %d, sum : %d", node->play, *sum);
+               _E("node->play : %d, sum : %d", node->play, *sum);
                *sum += node->level;
        }
 }
@@ -189,28 +189,28 @@ static int haptic_change_level(int handle, int level)
        int sum = 0;
        int r;
 
-       PRT_TRACE_ERR("handle : %d, level : %d", handle, level);
+       _E("handle : %d, level : %d", handle, level);
        node = find_node(handle);
        if (node == NULL) {
-               PRT_TRACE_ERR("find_node(%d) fail", handle);
+               _E("find_node(%d) fail", handle);
                return -1;
        }
 
        node->level = level;
 #ifdef MERGE_BTW_APPLICATIONS
        g_list_foreach(haptic_head, get_current_level, &sum);
-       PRT_TRACE_ERR("current sum level : %d", sum);
+       _E("current sum level : %d", sum);
 #else
        sum = level;
        if (!node->play) {
-               PRT_TRACE_ERR("This handle is stoped by another handle");
+               _E("This handle is stoped by another handle");
                return 0;
        }
 #endif
 
        r = device_set_property(DEVICE_TYPE_VIBRATOR, PROP_VIBRATOR_LEVEL, sum);
        if (r < 0) {
-               PRT_TRACE_ERR("set level fail");
+               _E("set level fail");
                return -1;
        }
 
@@ -221,10 +221,10 @@ static int haptic_open(int handle)
 {
        struct haptic_node *node;
 
-       PRT_TRACE("handle : %d", handle);
+       _D("handle : %d", handle);
        node = malloc(sizeof(struct haptic_node));
        if (node == NULL) {
-               PRT_TRACE_ERR("malloc fail");
+               _E("malloc fail");
                return -1;
        }
 
@@ -242,10 +242,10 @@ static int haptic_close(int handle)
        int play = 0;
        int r;
 
-       PRT_TRACE("handle : %d", handle);
+       _D("handle : %d", handle);
        node = find_node(handle);
        if (node == NULL) {
-               PRT_TRACE_ERR("find_node(%d) fail", handle);
+               _E("find_node(%d) fail", handle);
                return -1;
        }
 
@@ -256,13 +256,13 @@ static int haptic_close(int handle)
        free(node);
 
        g_list_foreach(haptic_head, check_play_state, &play);
-       PRT_TRACE_ERR("play state : %d", play);
+       _E("play state : %d", play);
 
        if (!play) {
-               PRT_TRACE_ERR("not playing anymore, will be stop");
+               _E("not playing anymore, will be stop");
                r = device_set_property(DEVICE_TYPE_VIBRATOR, PROP_VIBRATOR_ENABLE, 0);
                if (r < 0) {
-                       PRT_TRACE_ERR("set enable fail");
+                       _E("set enable fail");
                        return -1;
                }
        }
@@ -277,19 +277,19 @@ int haptic_def_predefine_action(int argc, char **argv)
        int mode;
        int handle;
 
-       PRT_TRACE_ERR("argc : %d", argc);
+       _E("argc : %d", argc);
        for (i = 0; i < argc; ++i)
-               PRT_TRACE_ERR("[%2d] %s", i, argv[i]);
+               _E("[%2d] %s", i, argv[i]);
 
        if (argc <= 0 || argc > 5) {
-               PRT_TRACE_ERR("Haptic predefine action failed");
+               _E("Haptic predefine action failed");
                return -1;
        }
 
        pid = atoi(argv[0]);
        mode = atoi(argv[1]);
        handle = atoi(argv[2]);
-       PRT_TRACE_ERR("pid : %d, mode : %d", pid, mode);
+       _E("pid : %d, mode : %d", pid, mode);
 
        switch(mode) {
        case OPEN:
index 56ff61a..90402b8 100755 (executable)
@@ -32,7 +32,7 @@ static void show_tickernoti(char *msg)
        notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
        noti_err = notification_status_message_post(gettext(msg));
        if (noti_err != NOTIFICATION_ERROR_NONE)
-               PRT_TRACE_ERR("FAIL: notification_status_message_post(msg)");
+               _E("FAIL: notification_status_message_post(msg)");
 }
 
 static void pci_noti(pci_noti_type iPCI)
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
                pci_noti(cb_type);
        }
        else {
-               PRT_TRACE_ERR("FAIL param error");
+               _E("FAIL param error");
        }
 
        return 0;