diff options
author | Jiwoong Im <jiwoong.im@samsung.com> | 2017-06-14 13:49:51 +0900 |
---|---|---|
committer | Jiwoong Im <jiwoong.im@samsung.com> | 2017-06-26 13:16:49 +0900 |
commit | 8ce34941c2f15a1e7882298dd9025381c38e1b6e (patch) | |
tree | 121d30fb05045eb445825ad2bee4672dbeffff59 /alarm-manager.c | |
parent | 5930006dc1687b5aefe3cc241514421c26058bf2 (diff) | |
download | alarm-manager-8ce34941c2f15a1e7882298dd9025381c38e1b6e.tar.gz alarm-manager-8ce34941c2f15a1e7882298dd9025381c38e1b6e.tar.bz2 alarm-manager-8ce34941c2f15a1e7882298dd9025381c38e1b6e.zip |
Fix invalid log format
Change-Id: I4a9848d7df60e35d49082e6fce130d54ce59896d
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
Diffstat (limited to 'alarm-manager.c')
-rw-r--r-- | alarm-manager.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/alarm-manager.c b/alarm-manager.c index 10d6a4f..7664a49 100644 --- a/alarm-manager.c +++ b/alarm-manager.c @@ -266,7 +266,7 @@ void __hashtable_foreach_cb(gpointer key, gpointer value, gpointer user_data) { appid_cache_t *data = value; if (data) - ALARM_MGR_LOG_PRINT("# %s(%d) - %s - %d", data->unique_name, data->pid, data->is_app); + ALARM_MGR_LOG_PRINT("# %s(%d) - %d", data->unique_name, data->pid, data->is_app); } void __free_cached_value(gpointer data) @@ -828,7 +828,7 @@ static bool __alarm_update_due_time_of_all_items_in_list(double diff_time) double interval = 0; - ALARM_MGR_LOG_PRINT("alarm[%d] with duetime(%u) at current(%u)", entry->alarm_id, due_time, current_time); + ALARM_MGR_LOG_PRINT("alarm[%d] with duetime(%ld) at current(%ld)", entry->alarm_id, due_time, current_time); if (due_time == 0) { /* 0 means this alarm has been disabled */ continue; } @@ -944,7 +944,7 @@ static bool __alarm_create_appsvc(alarm_info_t *alarm_info, alarm_id_t *alarm_id if (alarm_context.c_due_time < current_time) { ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time " - "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time); + "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time); alarm_context.c_due_time = -1; } @@ -961,11 +961,11 @@ static bool __alarm_create_appsvc(alarm_info_t *alarm_info, alarm_id_t *alarm_id return true; } else if (current_time == due_time) { ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: " - "current_time(%d) is same as due_time(%d)", current_time, + "current_time(%ld) is same as due_time(%ld)", current_time, due_time); return true; } else if (difftime(due_time, current_time) < 0) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list\n", due_time, current_time); + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list\n", due_time, current_time); return true; } else { localtime_r(&due_time, &ts_ret); @@ -975,7 +975,7 @@ static bool __alarm_create_appsvc(alarm_info_t *alarm_info, alarm_id_t *alarm_id due_time_r); } - ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time); + ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time); if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) { _clear_scheduled_alarm_list(); @@ -1057,7 +1057,7 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t time(¤t_time); SECURE_LOGD("[alarm-server]:pid=%d, app_unique_name=%s, " - "app_service_name=%s,dst_service_name=%s, c_due_time=%d", \ + "app_service_name=%s,dst_service_name=%s, c_due_time=%ld", \ pid, g_quark_to_string(__alarm_info->quark_app_unique_name), \ g_quark_to_string(__alarm_info->quark_app_service_name), \ g_quark_to_string(__alarm_info->quark_dst_service_name), \ @@ -1065,7 +1065,7 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t if (alarm_context.c_due_time < current_time) { ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time " - "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time); + "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time); alarm_context.c_due_time = -1; } @@ -1079,11 +1079,11 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create a new alarm: due_time is 0, alarm(%d).", *alarm_id); return true; } else if (current_time == due_time) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%d) is same as due_time(%d).", + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%ld) is same as due_time(%ld).", current_time, due_time); return true; } else if (difftime(due_time, current_time) < 0) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list.", + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list.", due_time, current_time); return true; } else { @@ -1094,7 +1094,7 @@ static bool __alarm_create(alarm_info_t *alarm_info, alarm_id_t *alarm_id, uid_t SECURE_LOGD("[alarm-server]:Create a new alarm: alarm(%d) due_time(%s)", *alarm_id, due_time_r); } - ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time); + ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time); if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) { _clear_scheduled_alarm_list(); @@ -1174,7 +1174,7 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id, time(¤t_time); SECURE_LOGD("[alarm-server]:pid=%d, app_unique_name=%s, " - "app_service_name=%s,dst_service_name=%s, c_due_time=%d", \ + "app_service_name=%s,dst_service_name=%s, c_due_time=%ld", \ pid, g_quark_to_string(__alarm_info->quark_app_unique_name), \ g_quark_to_string(__alarm_info->quark_app_service_name), \ g_quark_to_string(__alarm_info->quark_dst_service_name), \ @@ -1182,7 +1182,7 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id, if (alarm_context.c_due_time < current_time) { ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time " - "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time); + "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time); alarm_context.c_due_time = -1; } @@ -1196,11 +1196,11 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id, ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create a new alarm: due_time is 0, alarm(%d).", *alarm_id); return true; } else if (current_time == due_time) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%d) is same as due_time(%d).", + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Create alarm: current_time(%ld) is same as due_time(%ld).", current_time, due_time); return true; } else if (difftime(due_time, current_time) < 0) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list.", + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list.", due_time, current_time); return true; } else { @@ -1209,7 +1209,7 @@ static bool __alarm_create_noti(alarm_info_t *alarm_info, alarm_id_t *alarm_id, SECURE_LOGD("[alarm-server]:Create a new alarm: alarm(%d) due_time(%s)", *alarm_id, due_time_r); } - ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time); + ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time); if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) { _clear_scheduled_alarm_list(); @@ -1238,7 +1238,7 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id, if (alarm_context.c_due_time < current_time) { ALARM_MGR_EXCEPTION_PRINT("Caution!! alarm_context.c_due_time " - "(%d) is less than current time(%d)", alarm_context.c_due_time, current_time); + "(%ld) is less than current time(%ld)", alarm_context.c_due_time, current_time); alarm_context.c_due_time = -1; } @@ -1275,11 +1275,11 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id, return true; } else if (current_time == due_time) { ALARM_MGR_EXCEPTION_PRINT("[alarm-server]:Update alarm: " - "current_time(%d) is same as due_time(%d)", current_time, + "current_time(%ld) is same as due_time(%ld)", current_time, due_time); return true; } else if (difftime(due_time, current_time) < 0) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%d, Current Time=%d]!!!Do not add to schedule list\n", due_time, current_time); + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: Expired Due Time.[Due time=%ld, Current Time=%ld]!!!Do not add to schedule list\n", due_time, current_time); return true; } else { char due_time_r[100] = { 0 }; @@ -1290,7 +1290,7 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id, "due_time(%s)\n", alarm_id, due_time_r); } - ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%d), due_time(%d)", alarm_context.c_due_time, due_time); + ALARM_MGR_LOG_PRINT("[alarm-server]:alarm_context.c_due_time(%ld), due_time(%ld)", alarm_context.c_due_time, due_time); if (alarm_context.c_due_time == -1 || due_time < alarm_context.c_due_time) { _clear_scheduled_alarm_list(); @@ -1298,11 +1298,11 @@ static bool __alarm_update(uid_t uid, int pid, alarm_id_t alarm_id, _alarm_set_timer(&alarm_context, alarm_context.timer, due_time); alarm_context.c_due_time = due_time; ALARM_MGR_LOG_PRINT("[alarm-server1]:alarm_context.c_due_time " - "(%d), due_time(%d)", alarm_context.c_due_time, due_time); + "(%ld), due_time(%ld)", alarm_context.c_due_time, due_time); } else if (due_time == alarm_context.c_due_time) { _add_to_scheduled_alarm_list(__alarm_info); ALARM_MGR_LOG_PRINT("[alarm-server2]:alarm_context.c_due_time " - "(%d), due_time(%d)", alarm_context.c_due_time, due_time); + "(%ld), due_time(%ld)", alarm_context.c_due_time, due_time); } __rtc_set(); @@ -1726,17 +1726,17 @@ static void __alarm_expired() time(¤t_time); interval = difftime(alarm_context.c_due_time, current_time); - ALARM_MGR_LOG_PRINT("[alarm-server]: c_due_time(%d), current_time(%d), interval(%d)", + ALARM_MGR_LOG_PRINT("[alarm-server]: c_due_time(%ld), current_time(%ld), interval(%f)", alarm_context.c_due_time, current_time, interval); if (alarm_context.c_due_time > current_time + 1) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%d) seconds future", + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%ld) seconds future", alarm_context.c_due_time - current_time); goto done; } /* 10 seconds is maximum permitted delay from timer expire to this function */ if (alarm_context.c_due_time + 10 < current_time) { - ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%d) seconds past.", + ALARM_MGR_EXCEPTION_PRINT("[alarm-server]: False Alarm. due time is (%ld) seconds past.", current_time - alarm_context.c_due_time); goto done; } @@ -1855,7 +1855,7 @@ static void __alarm_expired() } ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, __alarm_info->uid, &appinfo_handle); - ALARM_MGR_LOG_PRINT("appid : %s (%x)", appid, appinfo_handle); + ALARM_MGR_LOG_PRINT("appid : %s (%p)", appid, appinfo_handle); if (appinfo_handle) pkgmgrinfo_appinfo_destroy_appinfo(appinfo_handle); @@ -1924,7 +1924,7 @@ static void __alarm_expired() ALARM_MGR_LOG_PRINT("alarm_id[%d] is expired.", alarm_id); #ifdef _APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG - snprintf(log_message, sizeof(log_message), "alarmID: %d, pid: %d, duetime: %d", alarm_id, app_pid, (int)__alarm_info->due_time); + snprintf(log_message, sizeof(log_message), "alarmID: %d, pid: %d, duetime: %ld", alarm_id, app_pid, __alarm_info->due_time); __save_module_log("EXPIRED", log_message); #endif @@ -1976,7 +1976,7 @@ static gboolean __alarm_handler_idle(gpointer user_data) */ time(¤t_time); if (alarm_context.c_due_time == current_time) { - ALARM_MGR_LOG_PRINT("Expire alarms forcibly when duetime is same to current time(%d).", current_time); + ALARM_MGR_LOG_PRINT("Expire alarms forcibly when duetime is same to current time(%ld).", current_time); __alarm_expired(); _alarm_schedule(); } @@ -2012,7 +2012,7 @@ static void __on_system_time_external_changed(keynode_t *node, void *data) ALARM_MGR_LOG_PRINT("diff_time is %f, New time is %s\n", diff_time, ctime(&cur_time)); ALARM_MGR_LOG_PRINT("[alarm-server] System time has been changed externally\n"); - ALARM_MGR_LOG_PRINT("1.alarm_context.c_due_time is %d\n", + ALARM_MGR_LOG_PRINT("1.alarm_context.c_due_time is %ld\n", alarm_context.c_due_time); __set_time(cur_time); @@ -2026,7 +2026,7 @@ static void __on_system_time_external_changed(keynode_t *node, void *data) __alarm_update_due_time_of_all_items_in_list(diff_time); - ALARM_MGR_LOG_PRINT("2.alarm_context.c_due_time is %d\n", + ALARM_MGR_LOG_PRINT("2.alarm_context.c_due_time is %ld\n", alarm_context.c_due_time); _clear_scheduled_alarm_list(); _alarm_schedule(); @@ -2191,7 +2191,7 @@ bool __get_caller_unique_name(int pid, char *unique_name, bool *is_app, uid_t ui fd = open(proc_file, O_RDONLY); if (fd < 0) { SECURE_LOGE("Caution!! pid(%d) seems to be killed.", - pid, proc_file); + pid); return false; } else { if (read(fd, process_name, sizeof(process_name) - 1) <= 0) { @@ -2404,7 +2404,7 @@ gboolean __alarm_expired_directly(gpointer user_data) if (g_dummy_timer_is_set == true) { ALARM_MGR_LOG_PRINT("dummy alarm timer has expired."); } else { - ALARM_MGR_LOG_PRINT("due_time=%d is expired.", alarm_info->due_time); + ALARM_MGR_LOG_PRINT("due_time=%ld is expired.", alarm_info->due_time); __alarm_expired(); } @@ -2432,7 +2432,7 @@ void __reschedule_alarms_with_newtime(int cur_time, int new_time, double diff_ti bundle_free(b); __alarm_update_due_time_of_all_items_in_list(diff_time); /* Rescheduling alarms with ALARM_TYPE_RELATIVE */ - ALARM_MGR_LOG_PRINT("Next duetime is %d", alarm_context.c_due_time); + ALARM_MGR_LOG_PRINT("Next duetime is %ld", alarm_context.c_due_time); _clear_scheduled_alarm_list(); _alarm_schedule(); @@ -2560,7 +2560,7 @@ gboolean alarm_manager_alarm_set_time(AlarmManager *pObj, GDBusMethodInvocation } __set_time(time_sec); /* Change both OS time and RTC */ - ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%d), New time(%d)(%s), diff_time(%f)", + ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%ld), New time(%d)(%s), diff_time(%f)", cur_time.tv_sec, time_sec, ctime((const time_t *)&time_sec), diff_time); __reschedule_alarms_with_newtime(cur_time.tv_sec, time_sec, diff_time); @@ -2585,7 +2585,7 @@ gboolean alarm_manager_alarm_set_time_with_propagation_delay(AlarmManager *pObj, /* Check validation of requested time */ if (req_sec > cur_time.tv_sec || (req_sec == cur_time.tv_sec && req_nsec > cur_time.tv_nsec)) { - ALARM_MGR_EXCEPTION_PRINT("The requeted time(%d.%09d) must be equal to or less than current time(%d.%09d).", + ALARM_MGR_EXCEPTION_PRINT("The requeted time(%d.%09d) must be equal to or less than current time(%ld.%09ld).", req_sec, req_nsec, cur_time.tv_sec, cur_time.tv_nsec); g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", ERR_ALARM_INVALID_PARAM)); return true; @@ -2613,9 +2613,9 @@ gboolean alarm_manager_alarm_set_time_with_propagation_delay(AlarmManager *pObj, __set_time(real_newtime); /* Change both OS time and RTC */ diff_time = difftime(real_newtime, cur_time.tv_sec); - ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%d.%09d), New time(%d.%09d), Real Newtime(%d), diff_time(%f)", + ALARM_MGR_LOG_PRINT("[TIMESTAMP]Current time(%ld.%09ld), New time(%d.%09d), Real Newtime(%d), diff_time(%f)", cur_time.tv_sec, cur_time.tv_nsec, new_sec, new_nsec, real_newtime, diff_time); - ALARM_MGR_LOG_PRINT("Requested(%d.%09d) Delay(%d.%09d) Sleep(%09d)", req_sec, req_nsec, delay.tv_sec, delay.tv_nsec, sleep_time.tv_nsec); + ALARM_MGR_LOG_PRINT("Requested(%d.%09d) Delay(%ld.%09ld) Sleep(%09ld)", req_sec, req_nsec, delay.tv_sec, delay.tv_nsec, sleep_time.tv_nsec); __reschedule_alarms_with_newtime(cur_time.tv_sec, real_newtime, diff_time); g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", ALARMMGR_RESULT_SUCCESS)); return true; @@ -2661,7 +2661,7 @@ gboolean alarm_manager_alarm_set_timezone(AlarmManager *pObject, GDBusMethodInvo /* Rescheduling alarms */ _alarm_disable_timer(alarm_context); __alarm_update_due_time_of_all_items_in_list(0); - ALARM_MGR_LOG_PRINT("next expiring due_time is %d", alarm_context.c_due_time); + ALARM_MGR_LOG_PRINT("next expiring due_time is %ld", alarm_context.c_due_time); _clear_scheduled_alarm_list(); _alarm_schedule(); @@ -2934,7 +2934,7 @@ time_t _get_periodic_alarm_standard_time(void) if (periodic_alarm_standard_time == 0) periodic_alarm_standard_time = g_random_int_range(0, BILLION) + 1; - ALARM_MGR_LOG_PRINT("periodic_standard_time : [%d]", periodic_alarm_standard_time); + ALARM_MGR_LOG_PRINT("periodic_standard_time : [%ld]", periodic_alarm_standard_time); return periodic_alarm_standard_time; } @@ -3566,7 +3566,7 @@ gboolean alarm_manager_alarm_get_all_info(AlarmManager *pObject, GDBusMethodInvo if (uid >= REGULAR_UID_MIN && entry->uid != uid) continue; ++index; - SECURE_LOGD("#%d alarm id[%d] app_name[%s] duetime[%d]", + SECURE_LOGD("#%d alarm id[%d] app_name[%s] duetime[%ld]", index, entry->alarm_id, g_quark_to_string(entry->quark_app_unique_name), entry->start); alarm_info_t *alarm_info = (alarm_info_t *) &(entry->alarm_info); |