From 5a9bf8b8f10cb36bf458dada73df87fc2d6d0d00 Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Mon, 4 Apr 2016 17:38:58 +0900 Subject: [PATCH] sensord: replace 0x% with %# - %# adds "0x" prefix according to data type Change-Id: I7d20614603c18d14e4710b04c59aaa7f10a8e7f3 Signed-off-by: kibak.yoon --- src/client/client.cpp | 22 ++++---- src/client/client_common.cpp | 4 +- src/client/command_channel.cpp | 8 +-- src/client/sensor_client_info.cpp | 4 +- src/client/sensor_event_listener.cpp | 4 +- src/client/sensor_handle_info.cpp | 6 +- src/sensor/accel/accel_sensor.cpp | 2 +- src/sensor/fusion/fusion_sensor.cpp | 6 +- src/sensor/hrm/hrm_sensor.cpp | 2 +- src/sensor/orientation/orientation_sensor.cpp | 2 +- .../rotation_vector/gaming_rv/gaming_rv_sensor.cpp | 2 +- .../geomagnetic_rv/geomagnetic_rv_sensor.cpp | 2 +- src/sensor/rotation_vector/rv/rv_sensor.cpp | 2 +- src/sensor/tilt/tilt_sensor.cpp | 2 +- src/server/client_sensor_record.cpp | 16 +++--- src/server/command_worker.cpp | 66 +++++++++++----------- src/server/sensor_base.cpp | 12 ++-- src/server/sensor_event_dispatcher.cpp | 8 +-- src/server/sensor_usage.cpp | 6 +- src/server/worker_thread.cpp | 10 ++-- src/shared/cbase_lock.cpp | 4 +- src/shared/csocket.cpp | 14 ++--- src/shared/sensor_info.cpp | 4 +- 23 files changed, 104 insertions(+), 104 deletions(-) diff --git a/src/client/client.cpp b/src/client/client.cpp index 4a8854f..79a759c 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -716,7 +716,7 @@ static bool register_event(int handle, unsigned int event_type, unsigned int int if (interval == 0) interval = DEFAULT_INTERVAL; - _I("%s registers event %s[0x%x] for sensor %s[%d] with interval: %d, latency: %d, cb: 0x%x, user_data: 0x%x", + _I("%s registers event %s[%#x] for sensor %s[%d] with interval: %d, latency: %d, cb: %#x, user_data: %#x", get_client_name(), get_event_name(event_type), event_type, get_sensor_name(sensor_id), handle, interval, max_batch_latency, cb, user_data); @@ -759,14 +759,14 @@ API bool sensord_unregister_event(int handle, unsigned int event_type) return false; } - _I("%s unregisters event %s[0x%x] for sensor %s[%d]", get_client_name(), get_event_name(event_type), + _I("%s unregisters event %s[%#x] for sensor %s[%d]", get_client_name(), get_event_name(event_type), event_type, get_sensor_name(sensor_id), handle); sensor_client_info::get_instance().get_sensor_rep(sensor_id, prev_rep); sensor_client_info::get_instance().get_event_info(handle, event_type, prev_interval, prev_latency, prev_cb_type, prev_cb, prev_user_data); if (!sensor_client_info::get_instance().unregister_event(handle, event_type)) { - _E("%s try to unregister non registered event %s[0x%x] for sensor %s[%d]", + _E("%s try to unregister non registered event %s[%#x] for sensor %s[%d]", get_client_name(),get_event_name(event_type), event_type, get_sensor_name(sensor_id), handle); return false; } @@ -796,7 +796,7 @@ API bool sensord_register_accuracy_cb(int handle, sensor_accuracy_changed_cb_t c } - _I("%s registers accuracy_changed_cb for sensor %s[%d] with cb: 0x%x, user_data: 0x%x", + _I("%s registers accuracy_changed_cb for sensor %s[%d] with cb: %#x, user_data: %#x", get_client_name(), get_sensor_name(sensor_id), handle, cb, user_data); sensor_client_info::get_instance().register_accuracy_cb(handle, cb , user_data); @@ -921,7 +921,7 @@ static bool change_event_batch(int handle, unsigned int event_type, unsigned int if (interval == 0) interval = DEFAULT_INTERVAL; - _I("%s changes batch of event %s[0x%x] for %s[%d] to (%d, %d)", get_client_name(), get_event_name(event_type), + _I("%s changes batch of event %s[%#x] for %s[%d] to (%d, %d)", get_client_name(), get_event_name(event_type), event_type, get_sensor_name(sensor_id), handle, interval, latency); sensor_client_info::get_instance().get_sensor_rep(sensor_id, prev_rep); @@ -951,11 +951,11 @@ API bool sensord_change_event_interval(int handle, unsigned int event_type, unsi AUTOLOCK(lock); if (!sensor_client_info::get_instance().get_event_info(handle, event_type, prev_interval, prev_latency, prev_cb_type, prev_cb, prev_user_data)) { - _E("Failed to get event info with handle = %d, event_type = 0x%x", handle, event_type); + _E("Failed to get event info with handle = %d, event_type = %#x", handle, event_type); return false; } - _I("handle = %d, event_type = 0x%x, interval = %d, prev_latency = %d", handle, event_type, interval, prev_latency); + _I("handle = %d, event_type = %#x, interval = %d, prev_latency = %d", handle, event_type, interval, prev_latency); return change_event_batch(handle, event_type, interval, prev_latency); } @@ -969,7 +969,7 @@ API bool sensord_change_event_max_batch_latency(int handle, unsigned int event_t AUTOLOCK(lock); if (!sensor_client_info::get_instance().get_event_info(handle, event_type, prev_interval, prev_latency, prev_cb_type, prev_cb, prev_user_data)) { - _E("Failed to get event info with handle = %d, event_type = 0x%x", handle, event_type); + _E("Failed to get event info with handle = %d, event_type = %#x", handle, event_type); return false; } @@ -1069,7 +1069,7 @@ API int sensord_set_attribute_str(int handle, int attribute, const char *value, } retvm_if((value_len < 0) || (value == NULL), -EINVAL, - "Invalid value_len: %d, value: 0x%x, handle: %d, %s, %s", + "Invalid value_len: %d, value: %#x, handle: %d, %s, %s", value_len, value, handle, get_sensor_name(sensor_id), get_client_name()); client_id = sensor_client_info::get_instance().get_client_id(); @@ -1078,7 +1078,7 @@ API int sensord_set_attribute_str(int handle, int attribute, const char *value, client_id, handle, get_sensor_name(sensor_id), get_client_name()); if (!cmd_channel->cmd_set_attribute_str(attribute, value, value_len)) { - _E("Sending cmd_set_attribute_str(%d, %d, 0x%x) failed for %s", + _E("Sending cmd_set_attribute_str(%d, %d, %#x) failed for %s", client_id, value_len, value, get_client_name()); return -EPERM; } @@ -1127,7 +1127,7 @@ API bool sensord_get_data(int handle, unsigned int data_id, sensor_data_t* senso } if (!cmd_channel->cmd_get_data(data_id, sensor_data)) { - _E("cmd_get_data(%d, %d, 0x%x) failed for %s", client_id, data_id, sensor_data, get_client_name()); + _E("cmd_get_data(%d, %d, %#x) failed for %s", client_id, data_id, sensor_data, get_client_name()); return false; } diff --git a/src/client/client_common.cpp b/src/client/client_common.cpp index ae7479c..95af36e 100644 --- a/src/client/client_common.cpp +++ b/src/client/client_common.cpp @@ -60,7 +60,7 @@ const char* get_sensor_name(sensor_id_t sensor_id) auto iter = g_log_maps.find(sensor_type); if (iter == g_log_maps.end()) { - _I("Unknown type value: 0x%x", sensor_type); + _I("Unknown type value: %#x", sensor_type); return p_unknown; } @@ -75,7 +75,7 @@ const char* get_event_name(unsigned int event_type) auto iter = g_log_maps.find(sensor_type); if (iter == g_log_maps.end()) { - _I("Unknown type value: 0x%x", sensor_type); + _I("Unknown type value: %#x", sensor_type); return p_unknown; } diff --git a/src/client/command_channel.cpp b/src/client/command_channel.cpp index da07846..7724278 100644 --- a/src/client/command_channel.cpp +++ b/src/client/command_channel.cpp @@ -612,18 +612,18 @@ bool command_channel::cmd_set_attribute_int(int attribute, int value) cmd_set_attribute_int->attribute = attribute; cmd_set_attribute_int->value = value; - _I("%s send cmd_set_attribute_int(client_id=%d, %s, 0x%x, %d)", + _I("%s send cmd_set_attribute_int(client_id=%d, %s, %#x, %d)", get_client_name(), m_client_id, get_sensor_name(m_sensor_id), attribute, value); if (!command_handler(packet, (void **)&cmd_done)) { - _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d], attribute[0x%x], value[%d]", + _E("Client %s failed to send/receive command for sensor[%s] with client_id [%d], attribute[%#x], value[%d]", get_client_name(), get_sensor_name(m_sensor_id), m_client_id, attribute, value); delete packet; return false; } if (cmd_done->value < 0) { - _E("Client %s got error[%d] from server for sensor[%s] with attribute[0x%x], value[%d]", + _E("Client %s got error[%d] from server for sensor[%s] with attribute[%#x], value[%d]", get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), attribute, value); delete[] (char *)cmd_done; @@ -653,7 +653,7 @@ bool command_channel::cmd_set_attribute_str(int attribute, const char* value, in cmd_set_attribute_str->value_len = value_len; memcpy(cmd_set_attribute_str->value, value, value_len); - _I("%s send cmd_set_attribute_str(client_id=%d, attribute = 0x%x, value_len = %d, value = 0x%x)", + _I("%s send cmd_set_attribute_str(client_id=%d, attribute = %#x, value_len = %d, value = %#x)", get_client_name(), m_client_id, attribute, value_len, value); if (!command_handler(packet, (void **)&cmd_done)) { diff --git a/src/client/sensor_client_info.cpp b/src/client/sensor_client_info.cpp index d6133c3..e4485af 100644 --- a/src/client/sensor_client_info.cpp +++ b/src/client/sensor_client_info.cpp @@ -438,7 +438,7 @@ bool sensor_client_info::get_active_batch(sensor_id_t sensor, unsigned int &inte } if (!active_sensor_found) { - _D("Active sensor[0x%llx] is not found for client %s", sensor, get_client_name()); + _D("Active sensor[%#llx] is not found for client %s", sensor, get_client_name()); return false; } @@ -470,7 +470,7 @@ unsigned int sensor_client_info::get_active_option(sensor_id_t sensor) } if (!active_sensor_found) - _D("Active sensor[0x%llx] is not found for client %s", sensor, get_client_name()); + _D("Active sensor[%#llx] is not found for client %s", sensor, get_client_name()); return active_option; } diff --git a/src/client/sensor_event_listener.cpp b/src/client/sensor_event_listener.cpp index 273d0d1..56e877a 100644 --- a/src/client/sensor_event_listener.cpp +++ b/src/client/sensor_event_listener.cpp @@ -285,7 +285,7 @@ gboolean sensor_event_listener::callback_dispatcher(gpointer data) else if (cb_info->cb_type == SENSOR_LEGACY_CB) ((sensor_legacy_cb_t) cb_info->cb)(cb_info->event_type, (sensor_event_data_t *) cb_info->sensor_data, cb_info->user_data); } else { - _W("Discard invalid callback cb(0x%x)(%s, 0x%x, 0x%x) with id: %llu", + _W("Discard invalid callback cb(%#x)(%s, %#x, %#x) with id: %llu", cb_info->cb, get_event_name(cb_info->event_type), cb_info->sensor_data, cb_info->user_data, cb_info->event_id); } @@ -423,7 +423,7 @@ bool sensor_event_listener::create_event_channel(void) } if ((event_channel_ready.magic != CHANNEL_MAGIC_NUM) || (event_channel_ready.client_id != client_id)) { - _E("Event_channel_ready packet is wrong, magic = 0x%x, client id = %d", + _E("Event_channel_ready packet is wrong, magic = %#x, client id = %d", event_channel_ready.magic, event_channel_ready.client_id); return false; } diff --git a/src/client/sensor_handle_info.cpp b/src/client/sensor_handle_info.cpp index f24b74a..2263ee0 100644 --- a/src/client/sensor_handle_info.cpp +++ b/src/client/sensor_handle_info.cpp @@ -70,7 +70,7 @@ bool sensor_handle_info::add_reg_event_info(unsigned int event_type, unsigned in auto it_event = m_reg_event_infos.find(event_type); if (it_event != m_reg_event_infos.end()) { - _E("Event %s[0x%x] is already registered for client %s", get_event_name(event_type), event_type, get_client_name()); + _E("Event %s[%#x] is already registered for client %s", get_event_name(event_type), event_type, get_client_name()); return false; } @@ -93,7 +93,7 @@ bool sensor_handle_info::delete_reg_event_info(unsigned int event_type) auto it_event = m_reg_event_infos.find(event_type); if (it_event == m_reg_event_infos.end()) { - _E("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name()); + _E("Event %s[%#x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name()); return false; } @@ -118,7 +118,7 @@ bool sensor_handle_info::change_reg_event_batch(unsigned int event_type, unsigne auto it_event = m_reg_event_infos.find(event_type); if (it_event == m_reg_event_infos.end()) { - _E("Event %s[0x%x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name()); + _E("Event %s[%#x] is not registered for client %s", get_event_name(event_type), event_type, get_client_name()); return false; } diff --git a/src/sensor/accel/accel_sensor.cpp b/src/sensor/accel/accel_sensor.cpp index 4fe9f5b..90fd8bd 100644 --- a/src/sensor/accel/accel_sensor.cpp +++ b/src/sensor/accel/accel_sensor.cpp @@ -23,7 +23,7 @@ accel_sensor::accel_sensor() { - _E("accel_sensor is created : 0x%x", this); + _E("accel_sensor is created : %#x", this); } accel_sensor::~accel_sensor() diff --git a/src/sensor/fusion/fusion_sensor.cpp b/src/sensor/fusion/fusion_sensor.cpp index 5766a04..0a90e58 100644 --- a/src/sensor/fusion/fusion_sensor.cpp +++ b/src/sensor/fusion/fusion_sensor.cpp @@ -169,15 +169,15 @@ bool fusion_sensor::init(void) m_magnetic_sensor = sensor_loader::get_instance().get_sensor(GEOMAGNETIC_SENSOR); if (!m_accel_sensor) { - _E("Failed to load accel sensor: 0x%x", m_accel_sensor); + _E("Failed to load accel sensor: %#x", m_accel_sensor); return false; } if (!m_gyro_sensor) - _I("Failed to load gyro sensor: 0x%x", m_gyro_sensor); + _I("Failed to load gyro sensor: %#x", m_gyro_sensor); if (!m_magnetic_sensor) - _I("Failed to load geomagnetic sensor: 0x%x", m_magnetic_sensor); + _I("Failed to load geomagnetic sensor: %#x", m_magnetic_sensor); _I("%s is created!", sensor_base::get_name()); return true; diff --git a/src/sensor/hrm/hrm_sensor.cpp b/src/sensor/hrm/hrm_sensor.cpp index 908f1b5..0425226 100644 --- a/src/sensor/hrm/hrm_sensor.cpp +++ b/src/sensor/hrm/hrm_sensor.cpp @@ -25,7 +25,7 @@ hrm_sensor::hrm_sensor() { set_permission(SENSOR_PERMISSION_BIO); - _I("hrm_sensor is created : 0x%x", this); + _I("hrm_sensor is created : %#x", this); } hrm_sensor::~hrm_sensor() diff --git a/src/sensor/orientation/orientation_sensor.cpp b/src/sensor/orientation/orientation_sensor.cpp index 7ace6ee..091cb12 100644 --- a/src/sensor/orientation/orientation_sensor.cpp +++ b/src/sensor/orientation/orientation_sensor.cpp @@ -131,7 +131,7 @@ bool orientation_sensor::init(void) m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR); if (!m_accel_sensor || !m_gyro_sensor || !m_magnetic_sensor || !m_fusion_sensor) { - _E("Failed to load sensors, accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x", + _E("Failed to load sensors, accel: %#x, gyro: %#x, mag: %#x, fusion: %#x", m_accel_sensor, m_gyro_sensor, m_magnetic_sensor, m_fusion_sensor); return false; } diff --git a/src/sensor/rotation_vector/gaming_rv/gaming_rv_sensor.cpp b/src/sensor/rotation_vector/gaming_rv/gaming_rv_sensor.cpp index 3fd0268..b2d4e99 100644 --- a/src/sensor/rotation_vector/gaming_rv/gaming_rv_sensor.cpp +++ b/src/sensor/rotation_vector/gaming_rv/gaming_rv_sensor.cpp @@ -132,7 +132,7 @@ bool gaming_rv_sensor::init() m_gyro_sensor = sensor_loader::get_instance().get_sensor(GYROSCOPE_SENSOR); if (!m_accel_sensor || !m_gyro_sensor) { - _E("Failed to load sensors, accel: 0x%x, gyro: 0x%x", + _E("Failed to load sensors, accel: %#x, gyro: %#x", m_accel_sensor, m_gyro_sensor); return false; } diff --git a/src/sensor/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp b/src/sensor/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp index e7cbfb3..a97b949 100644 --- a/src/sensor/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp +++ b/src/sensor/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp @@ -91,7 +91,7 @@ bool geomagnetic_rv_sensor::init() m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR); if (!m_accel_sensor || !m_magnetic_sensor || !m_fusion_sensor) { - _E("Failed to load sensors, accel: 0x%x, mag: 0x%x, fusion: 0x%x", + _E("Failed to load sensors, accel: %#x, mag: %#x, fusion: %#x", m_accel_sensor, m_magnetic_sensor, m_fusion_sensor); return false; } diff --git a/src/sensor/rotation_vector/rv/rv_sensor.cpp b/src/sensor/rotation_vector/rv/rv_sensor.cpp index 79b5cc5..1008ed3 100644 --- a/src/sensor/rotation_vector/rv/rv_sensor.cpp +++ b/src/sensor/rotation_vector/rv/rv_sensor.cpp @@ -99,7 +99,7 @@ bool rv_sensor::init() m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR); if (!m_accel_sensor || !m_gyro_sensor || !m_magnetic_sensor || !m_fusion_sensor) { - _E("Failed to load sensors, accel: 0x%x, gyro: 0x%x, mag: 0x%x, fusion: 0x%x", + _E("Failed to load sensors, accel: %#x, gyro: %#x, mag: %#x, fusion: %#x", m_accel_sensor, m_gyro_sensor, m_magnetic_sensor, m_fusion_sensor); return false; } diff --git a/src/sensor/tilt/tilt_sensor.cpp b/src/sensor/tilt/tilt_sensor.cpp index e37a448..d236350 100644 --- a/src/sensor/tilt/tilt_sensor.cpp +++ b/src/sensor/tilt/tilt_sensor.cpp @@ -112,7 +112,7 @@ bool tilt_sensor::init(void) m_fusion_sensor = sensor_loader::get_instance().get_sensor(FUSION_SENSOR); if (!m_accel_sensor || !m_fusion_sensor) { - _E("Failed to load sensors, accel: 0x%x, fusion: 0x%x", + _E("Failed to load sensors, accel: %#x, fusion: %#x", m_accel_sensor, m_fusion_sensor); return false; } diff --git a/src/server/client_sensor_record.cpp b/src/server/client_sensor_record.cpp index 58fde54..95001bb 100644 --- a/src/server/client_sensor_record.cpp +++ b/src/server/client_sensor_record.cpp @@ -49,7 +49,7 @@ bool client_sensor_record::register_event(sensor_id_t sensor_id, unsigned int ev } if (!it_usage->second.register_event(event_type)) { - _E("Event[0x%x] is already registered", event_type); + _E("Event[%#x] is already registered", event_type); return false; } @@ -61,12 +61,12 @@ bool client_sensor_record::unregister_event(sensor_id_t sensor_id, unsigned int auto it_usage = m_sensor_usages.find(sensor_id); if (it_usage == m_sensor_usages.end()) { - _E("Sensor[0x%x] is not registered", sensor_id); + _E("Sensor[%#x] is not registered", sensor_id); return false; } if (!it_usage->second.unregister_event(event_type)) { - _E("Event[0x%x] is already registered", event_type); + _E("Event[%#x] is already registered", event_type); return false; } @@ -136,7 +136,7 @@ bool client_sensor_record::get_batch(sensor_id_t sensor_id, unsigned int &interv auto it_usage = m_sensor_usages.find(sensor_id); if (it_usage == m_sensor_usages.end()) { - _E("Sensor[0x%x] is not found", sensor_id); + _E("Sensor[%#x] is not found", sensor_id); return false; } @@ -164,7 +164,7 @@ bool client_sensor_record::add_sensor_usage(sensor_id_t sensor_id) auto it_usage = m_sensor_usages.find(sensor_id); if (it_usage != m_sensor_usages.end()) { - _E("Sensor[0x%x] is already registered", sensor_id); + _E("Sensor[%#x] is already registered", sensor_id); return false; } @@ -178,7 +178,7 @@ bool client_sensor_record::remove_sensor_usage(sensor_id_t sensor_id) auto it_usage = m_sensor_usages.find(sensor_id); if (it_usage == m_sensor_usages.end()) { - _E("Sensor[0x%x] is not found", sensor_id); + _E("Sensor[%#x] is not found", sensor_id); return false; } m_sensor_usages.erase(it_usage); @@ -199,7 +199,7 @@ bool client_sensor_record::has_sensor_usage(sensor_id_t sensor_id) auto it_usage = m_sensor_usages.find(sensor_id); if (it_usage == m_sensor_usages.end()) { - _D("Sensor[0x%x] is not found", sensor_id); + _D("Sensor[%#x] is not found", sensor_id); return false; } @@ -212,7 +212,7 @@ bool client_sensor_record::get_registered_events(sensor_id_t sensor_id, event_ty auto it_usage = m_sensor_usages.find(sensor_id); if (it_usage == m_sensor_usages.end()) { - _D("Sensor[0x%x] is not found", sensor_id); + _D("Sensor[%#x] is not found", sensor_id); return false; } diff --git a/src/server/command_worker.cpp b/src/server/command_worker.cpp index b9f5853..83c3f8b 100644 --- a/src/server/command_worker.cpp +++ b/src/server/command_worker.cpp @@ -222,7 +222,7 @@ bool command_worker::stopped(void *ctx) if (inst->m_sensor_id > UNKNOWN_SENSOR) { if (get_client_info_manager().has_sensor_record(inst->m_client_id, inst->m_sensor_id)) { - _I("Removing sensor[0x%llx] record for client_id[%d]", inst->m_sensor_id, inst->m_client_id); + _I("Removing sensor[%#llx] record for client_id[%d]", inst->m_sensor_id, inst->m_client_id); get_client_info_manager().remove_sensor_record(inst->m_client_id, inst->m_sensor_id); } } @@ -331,7 +331,7 @@ bool command_worker::send_cmd_get_sensor_list_done(void) int permission = get_permission(); - _I("permission = 0x%x", permission); + _I("permission = %#x", permission); get_sensor_list(permission, sensor_list); @@ -410,14 +410,14 @@ bool command_worker::cmd_hello(void *payload) } if (!is_permission_allowed()) { - _E("Permission denied to connect sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id); + _E("Permission denied to connect sensor[%#llx] for client [%d]", m_sensor_id, m_client_id); ret_value = OP_ERROR; goto out; } - _D("Hello sensor [0x%llx], client id [%d]", m_sensor_id, m_client_id); + _D("Hello sensor [%#llx], client id [%d]", m_sensor_id, m_client_id); get_client_info_manager().create_sensor_record(m_client_id, m_sensor_id); - _I("New sensor record created for sensor [0x%llx], sensor name [%s] on client id [%d]\n", m_sensor_id, m_module->get_name(), m_client_id); + _I("New sensor record created for sensor [%#llx], sensor name [%s] on client id [%d]\n", m_sensor_id, m_module->get_name(), m_client_id); ret_value = OP_SUCCESS; out: if (!send_cmd_done(ret_value)) @@ -431,12 +431,12 @@ bool command_worker::cmd_byebye(void *payload) long ret_value = OP_ERROR; if (!is_permission_allowed()) { - _E("Permission denied to stop sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id); + _E("Permission denied to stop sensor[%#llx] for client [%d]", m_sensor_id, m_client_id); ret_value = OP_ERROR; goto out; } - _D("CMD_BYEBYE for client [%d], sensor [0x%llx]", m_client_id, m_sensor_id); + _D("CMD_BYEBYE for client [%d], sensor [%#llx]", m_client_id, m_sensor_id); if (!get_client_info_manager().remove_sensor_record(m_client_id, m_sensor_id)) { _E("Error removing sensor_record for client [%d]", m_client_id); @@ -462,12 +462,12 @@ bool command_worker::cmd_start(void *payload) long ret_value = OP_ERROR; if (!is_permission_allowed()) { - _E("Permission denied to start sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id); + _E("Permission denied to start sensor[%#llx] for client [%d]", m_sensor_id, m_client_id); ret_value = OP_ERROR; goto out; } - _D("START Sensor [0x%llx], called from client [%d]", m_sensor_id, m_client_id); + _D("START Sensor [%#llx], called from client [%d]", m_sensor_id, m_client_id); if (m_module->start()) { get_client_info_manager().set_start(m_client_id, m_sensor_id, true); @@ -479,7 +479,7 @@ bool command_worker::cmd_start(void *payload) get_event_dispathcher().request_last_event(m_client_id, m_sensor_id); ret_value = OP_SUCCESS; } else { - _E("Failed to start sensor [0x%llx] for client [%d]", m_sensor_id, m_client_id); + _E("Failed to start sensor [%#llx] for client [%d]", m_sensor_id, m_client_id); ret_value = OP_ERROR; } @@ -495,19 +495,19 @@ bool command_worker::cmd_stop(void *payload) long ret_value = OP_ERROR; if (!is_permission_allowed()) { - _E("Permission denied to stop sensor[0x%llx] for client [%d]", m_sensor_id, m_client_id); + _E("Permission denied to stop sensor[%#llx] for client [%d]", m_sensor_id, m_client_id); ret_value = OP_ERROR; goto out; } - _D("STOP Sensor [0x%llx], called from client [%d]", m_sensor_id, m_client_id); + _D("STOP Sensor [%#llx], called from client [%d]", m_sensor_id, m_client_id); if (m_module->stop()) { get_client_info_manager().set_start(m_client_id, m_sensor_id, false); m_module->delete_attribute(m_client_id); ret_value = OP_SUCCESS; } else { - _E("Failed to stop sensor [0x%llx] for client [%d]", m_sensor_id, m_client_id); + _E("Failed to stop sensor [%#llx] for client [%d]", m_sensor_id, m_client_id); ret_value = OP_ERROR; } @@ -526,21 +526,21 @@ bool command_worker::cmd_register_event(void *payload) cmd = (cmd_reg_t*)payload; if (!is_permission_allowed()) { - _E("Permission denied to register event [0x%x] for client [%d] to client info manager", + _E("Permission denied to register event [%#x] for client [%d] to client info manager", cmd->event_type, m_client_id); ret_value = OP_ERROR; goto out; } if (!get_client_info_manager().register_event(m_client_id, m_sensor_id, cmd->event_type)) { - _I("Failed to register event [0x%x] for client [%d] to client info manager", + _I("Failed to register event [%#x] for client [%d] to client info manager", cmd->event_type, m_client_id); ret_value = OP_ERROR; goto out; } ret_value = OP_SUCCESS; - _D("Registering Event [0x%x] is done for client [%d]", cmd->event_type, m_client_id); + _D("Registering Event [%#x] is done for client [%d]", cmd->event_type, m_client_id); out: if (!send_cmd_done(ret_value)) @@ -557,21 +557,21 @@ bool command_worker::cmd_unregister_event(void *payload) cmd = (cmd_unreg_t*)payload; if (!is_permission_allowed()) { - _E("Permission denied to unregister event [0x%x] for client [%d] to client info manager", + _E("Permission denied to unregister event [%#x] for client [%d] to client info manager", cmd->event_type, m_client_id); ret_value = OP_ERROR; goto out; } if (!get_client_info_manager().unregister_event(m_client_id, m_sensor_id, cmd->event_type)) { - _E("Failed to unregister event [0x%x] for client [%d] from client info manager", + _E("Failed to unregister event [%#x] for client [%d] from client info manager", cmd->event_type, m_client_id); ret_value = OP_ERROR; goto out; } ret_value = OP_SUCCESS; - _D("Unregistering Event [0x%x] is done for client [%d]", + _D("Unregistering Event [%#x] is done for client [%d]", cmd->event_type, m_client_id); out: @@ -589,28 +589,28 @@ bool command_worker::cmd_set_batch(void *payload) cmd = (cmd_set_batch_t*)payload; if (!is_permission_allowed()) { - _E("Permission denied to set batch for client [%d], for sensor [0x%llx] with batch [%d, %d] to client info manager", + _E("Permission denied to set batch for client [%d], for sensor [%#llx] with batch [%d, %d] to client info manager", m_client_id, m_sensor_id, cmd->interval, cmd->latency); ret_value = OP_ERROR; goto out; } if (!get_client_info_manager().set_batch(m_client_id, m_sensor_id, cmd->interval, cmd->latency)) { - _E("Failed to set batch for client [%d], for sensor [0x%llx] with batch [%d, %d] to client info manager", + _E("Failed to set batch for client [%d], for sensor [%#llx] with batch [%d, %d] to client info manager", m_client_id, m_sensor_id, cmd->interval, cmd->latency); ret_value = OP_ERROR; goto out; } if (!m_module->add_interval(m_client_id, cmd->interval, false)) { - _E("Failed to set interval for client [%d], for sensor [0x%llx] with interval [%d]", + _E("Failed to set interval for client [%d], for sensor [%#llx] with interval [%d]", m_client_id, m_sensor_id, cmd->interval); ret_value = OP_ERROR; goto out; } if (!m_module->add_batch(m_client_id, cmd->latency)) { - _E("Failed to set latency for client [%d], for sensor [0x%llx] with latency [%d]", + _E("Failed to set latency for client [%d], for sensor [%#llx] with latency [%d]", m_client_id, m_sensor_id, cmd->latency); ret_value = OP_ERROR; goto out; @@ -630,14 +630,14 @@ bool command_worker::cmd_unset_batch(void *payload) long ret_value = OP_ERROR; if (!is_permission_allowed()) { - _E("Permission denied to unset batch for client [%d], for sensor [0x%llx] to client info manager", + _E("Permission denied to unset batch for client [%d], for sensor [%#llx] to client info manager", m_client_id, m_sensor_id); ret_value = OP_ERROR; goto out; } if (!get_client_info_manager().set_batch(m_client_id, m_sensor_id, 0, 0)) { - _E("Failed to unset batch for client [%d], for sensor [0x%llx] to client info manager", + _E("Failed to unset batch for client [%d], for sensor [%#llx] to client info manager", m_client_id, m_sensor_id); ret_value = OP_ERROR; goto out; @@ -672,14 +672,14 @@ bool command_worker::cmd_set_option(void *payload) cmd = (cmd_set_option_t*)payload; if (!is_permission_allowed()) { - _E("Permission denied to set interval for client [%d], for sensor [0x%llx] with option [%d] to client info manager", + _E("Permission denied to set interval for client [%d], for sensor [%#llx] with option [%d] to client info manager", m_client_id, m_sensor_id, cmd->option); ret_value = OP_ERROR; goto out; } if (!get_client_info_manager().set_option(m_client_id, m_sensor_id, cmd->option)) { - _E("Failed to set option for client [%d], for sensor [0x%llx] with option [%d] to client info manager", + _E("Failed to set option for client [%d], for sensor [%#llx] with option [%d] to client info manager", m_client_id, m_sensor_id, cmd->option); ret_value = OP_ERROR; goto out; @@ -704,7 +704,7 @@ bool command_worker::cmd_get_data(void *payload) _D("CMD_GET_VALUE Handler invoked\n"); if (!is_permission_allowed()) { - _E("Permission denied to get data for client [%d], for sensor [0x%llx]", + _E("Permission denied to get data for client [%d], for sensor [%#llx]", m_client_id, m_sensor_id); state = -EACCES; goto out; @@ -731,7 +731,7 @@ bool command_worker::cmd_get_data(void *payload) } while ((state == -ENODATA) && (retry++ < RETRY_CNT)) { - _I("Wait sensor[0x%llx] data updated for client [%d] #%d", m_sensor_id, m_client_id, retry); + _I("Wait sensor[%#llx] data updated for client [%d] #%d", m_sensor_id, m_client_id, retry); usleep(WAIT_TIME(retry)); state = m_module->get_cache(&data); } @@ -741,7 +741,7 @@ bool command_worker::cmd_get_data(void *payload) } if (state < 0) { - _E("Failed to get data for client [%d], for sensor [0x%llx]", + _E("Failed to get data for client [%d], for sensor [%#llx]", m_client_id, m_sensor_id); } @@ -761,7 +761,7 @@ bool command_worker::cmd_set_attribute_int(void *payload) cmd = (cmd_set_attribute_int_t*)payload; if (!is_permission_allowed()) { - _E("Permission denied to set attribute for client [%d], for sensor [0x%llx] with attribute [%d]", + _E("Permission denied to set attribute for client [%d], for sensor [%#llx] with attribute [%d]", m_client_id, m_sensor_id, cmd->attribute); ret_value = OP_ERROR; goto out; @@ -786,7 +786,7 @@ bool command_worker::cmd_set_attribute_str(void *payload) cmd = (cmd_set_attribute_str_t*)payload; if (!is_permission_allowed()) { - _E("Permission denied to set attribute for client [%d], for sensor [0x%llx]", + _E("Permission denied to set attribute for client [%d], for sensor [%#llx]", m_client_id, m_sensor_id); ret_value = OP_ERROR; goto out; @@ -808,7 +808,7 @@ bool command_worker::cmd_flush(void *payload) _D("CMD_FLUSH Handler invoked"); if (!is_permission_allowed()) { - _E("Permission denied to flush sensor data for client [%d], for sensor [0x%llx]", + _E("Permission denied to flush sensor data for client [%d], for sensor [%#llx]", m_client_id, m_sensor_id); ret_value = OP_ERROR; goto out; diff --git a/src/server/sensor_base.cpp b/src/server/sensor_base.cpp index 6398cd6..0af356d 100644 --- a/src/server/sensor_base.cpp +++ b/src/server/sensor_base.cpp @@ -180,7 +180,7 @@ bool sensor_base::add_interval(int client_id, unsigned int interval, bool is_pro cur_min = m_sensor_info_list.get_min_interval(); if (cur_min != prev_min) { - _I("Min interval for sensor[0x%llx] is changed from %dms to %dms" + _I("Min interval for sensor[%#llx] is changed from %dms to %dms" " by%sclient[%d] adding interval", get_id(), prev_min, cur_min, is_processor ? " processor " : " ", client_id); @@ -204,14 +204,14 @@ bool sensor_base::delete_interval(int client_id, bool is_processor) cur_min = m_sensor_info_list.get_min_interval(); if (!cur_min) { - _I("No interval for sensor[0x%llx] by%sclient[%d] deleting interval, " + _I("No interval for sensor[%#llx] by%sclient[%d] deleting interval, " "so set to default %dms", get_id(), is_processor ? " processor " : " ", client_id, POLL_1HZ_MS); set_interval(POLL_1HZ_MS); } else if (cur_min != prev_min) { - _I("Min interval for sensor[0x%llx] is changed from %dms to %dms" + _I("Min interval for sensor[%#llx] is changed from %dms to %dms" " by%sclient[%d] deleting interval", get_id(), prev_min, cur_min, is_processor ? " processor " : " ", client_id); @@ -243,7 +243,7 @@ bool sensor_base::add_batch(int client_id, unsigned int latency) cur_max = m_sensor_info_list.get_max_batch(); if (cur_max != prev_max) { - _I("Max latency for sensor[0x%llx] is changed from %dms to %dms by client[%d] adding latency", + _I("Max latency for sensor[%#llx] is changed from %dms to %dms by client[%d] adding latency", get_id(), prev_max, cur_max, client_id); set_batch_latency(cur_max); } @@ -264,12 +264,12 @@ bool sensor_base::delete_batch(int client_id) cur_max = m_sensor_info_list.get_max_batch(); if (!cur_max) { - _I("No latency for sensor[0x%llx] by client[%d] deleting latency, so set to default 0 ms", + _I("No latency for sensor[%#llx] by client[%d] deleting latency, so set to default 0 ms", get_id(), client_id); set_batch_latency(0); } else if (cur_max != prev_max) { - _I("Max latency for sensor[0x%llx] is changed from %dms to %dms by client[%d] deleting latency", + _I("Max latency for sensor[%#llx] is changed from %dms to %dms by client[%d] deleting latency", get_id(), prev_max, cur_max, client_id); set_batch_latency(cur_max); diff --git a/src/server/sensor_event_dispatcher.cpp b/src/server/sensor_event_dispatcher.cpp index 977a657..c1c401a 100644 --- a/src/server/sensor_event_dispatcher.cpp +++ b/src/server/sensor_event_dispatcher.cpp @@ -169,9 +169,9 @@ void sensor_event_dispatcher::send_sensor_events(vector &events) ret = (ret & (client_socket.send(sensor_event->data, sensor_event->data_length) > 0)); if (ret) - _D("Event[0x%x] sent to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd()); + _D("Event[%#x] sent to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd()); else - _E("Failed to send event[0x%x] to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd()); + _E("Failed to send event[%#x] to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd()); ++it_client_id; } @@ -261,10 +261,10 @@ void sensor_event_dispatcher::request_last_event(int client_id, sensor_id_t sens sensor_event_t event; if (is_record_event(*it_event) && get_last_event(*it_event, event)) { if (client_socket.send(&event, sizeof(event)) > 0) - _I("Send the last event[0x%x] to %s on socket[%d]", event.event_type, + _I("Send the last event[%#x] to %s on socket[%d]", event.event_type, client_info_manager.get_client_info(client_id), client_socket.get_socket_fd()); else - _E("Failed to send event[0x%x] to %s on socket[%d]", event.event_type, + _E("Failed to send event[%#x] to %s on socket[%d]", event.event_type, client_info_manager.get_client_info(client_id), client_socket.get_socket_fd()); } ++it_event; diff --git a/src/server/sensor_usage.cpp b/src/server/sensor_usage.cpp index 83ead8d..77d2cce 100644 --- a/src/server/sensor_usage.cpp +++ b/src/server/sensor_usage.cpp @@ -40,7 +40,7 @@ bool sensor_usage::register_event(unsigned int event_type) auto it_event = find(m_reg_events.begin(), m_reg_events.end(), event_type); if (it_event != m_reg_events.end()) { - _E("Event[0x%x] is already registered", event_type); + _E("Event[%#x] is already registered", event_type); return false; } @@ -53,7 +53,7 @@ bool sensor_usage::unregister_event(unsigned int event_type) auto it_event = find(m_reg_events.begin(), m_reg_events.end(), event_type); if (it_event == m_reg_events.end()) { - _E("Event[0x%x] is not found",event_type); + _E("Event[%#x] is not found",event_type); return false; } @@ -67,7 +67,7 @@ bool sensor_usage::is_event_registered(unsigned int event_type) auto it_event = find (m_reg_events.begin(), m_reg_events.end(), event_type); if (it_event == m_reg_events.end()){ - _D("Event[0x%x] is not registered",event_type); + _D("Event[%#x] is not registered",event_type); return false; } diff --git a/src/server/worker_thread.cpp b/src/server/worker_thread.cpp index afd188c..bf3320c 100644 --- a/src/server/worker_thread.cpp +++ b/src/server/worker_thread.cpp @@ -153,7 +153,7 @@ bool worker_thread::resume(void) void worker_thread::main(void) { - _D("Worker thread(0x%x) is created", std::this_thread::get_id()); + _D("Worker thread(%#x) is created", std::this_thread::get_id()); transition_function(STARTED); @@ -164,7 +164,7 @@ void worker_thread::main(void) if (state == WORKER_STATE_WORKING) { if (!transition_function(WORKING)) { m_state = WORKER_STATE_STOPPED; - _D("Worker thread(0x%x) exits from working state", std::this_thread::get_id()); + _D("Worker thread(%#x) exits from working state", std::this_thread::get_id()); m_thread_created = false; transition_function(STOPPED); break; @@ -177,12 +177,12 @@ void worker_thread::main(void) if (m_state == WORKER_STATE_PAUSED) { transition_function(PAUSED); - _D("Worker thread(0x%x) is paused", std::this_thread::get_id()); + _D("Worker thread(%#x) is paused", std::this_thread::get_id()); m_cond_working.wait(u); if (m_state == WORKER_STATE_WORKING) { transition_function(RESUMED); - _D("Worker thread(0x%x) is resumed", std::this_thread::get_id()); + _D("Worker thread(%#x) is resumed", std::this_thread::get_id()); } else if (m_state == WORKER_STATE_STOPPED) { m_thread_created = false; transition_function(STOPPED); @@ -194,7 +194,7 @@ void worker_thread::main(void) break; } } - _I("Worker thread(0x%x)'s main is terminated", std::this_thread::get_id()); + _I("Worker thread(%#x)'s main is terminated", std::this_thread::get_id()); } void worker_thread::set_started(trans_func_t func) diff --git a/src/shared/cbase_lock.cpp b/src/shared/cbase_lock.cpp index f30ce18..e7bcc95 100644 --- a/src/shared/cbase_lock.cpp +++ b/src/shared/cbase_lock.cpp @@ -64,7 +64,7 @@ void cbase_lock::lock(lock_type type, const char* expr, const char *module, cons lock_waiting_start_time = MICROSECONDS(sv); pthread_mutex_lock(&m_history_mutex); - _I("%s is waiting for getting %s(0x%x) owned in %s", + _I("%s is waiting for getting %s(%#x) owned in %s", m_curent_info, expr, this, m_owner_info); pthread_mutex_unlock(&m_history_mutex); @@ -82,7 +82,7 @@ void cbase_lock::lock(lock_type type, const char* expr, const char *module, cons waiting_time = lock_acquired_time - lock_waiting_start_time; pthread_mutex_lock(&m_history_mutex); - _I("%s acquires lock after waiting %lluus, %s(0x%x) was previously owned in %s", + _I("%s acquires lock after waiting %lluus, %s(%#x) was previously owned in %s", m_curent_info, waiting_time, expr, this, m_owner_info); snprintf(m_owner_info, OWNER_INFO_LEN, "%s", m_curent_info); pthread_mutex_unlock(&m_history_mutex); diff --git a/src/shared/csocket.cpp b/src/shared/csocket.cpp index 23bcdd4..199a722 100644 --- a/src/shared/csocket.cpp +++ b/src/shared/csocket.cpp @@ -159,7 +159,7 @@ ssize_t csocket::send_for_seqpacket(const void *buffer, size_t size) const } while (err == EINTR); if (err) { - _ERRNO(errno, _E, "Failed to send(%d, 0x%x, %d, 0x%x) = %d", + _ERRNO(errno, _E, "Failed to send(%d, %#x, %d, %#x) = %d", m_sock_fd, buffer, size, m_send_flags, len); } @@ -176,7 +176,7 @@ ssize_t csocket::recv_for_seqpacket(void* buffer, size_t size) const if (len > 0) { err = 0; } else if (len == 0) { - _E("recv(%d, 0x%p , %d) = %d, because the peer performed shutdown!", + _E("recv(%d, %#p , %d) = %d, because the peer performed shutdown!", m_sock_fd, buffer, size, len); err = 1; } else { @@ -185,13 +185,13 @@ ssize_t csocket::recv_for_seqpacket(void* buffer, size_t size) const } while (err == EINTR); if ((err == EAGAIN) || (err == EWOULDBLOCK)) { - _ERRNO(err, _D, "Failed to recv(%d, 0x%x, %d, 0x%x) = %d", + _ERRNO(err, _D, "Failed to recv(%d, %#x, %d, %#x) = %d", m_socket_fd, buffer, size, m_recv_flags, len); return 0; } if (err) { - _ERRNO(err, _E, "Failed to recv(%d, 0x%x, %d, 0x%x) = %d", + _ERRNO(err, _E, "Failed to recv(%d, %#x, %d, %#x) = %d", m_sock_fd, buffer, size, m_recv_flags, len); } @@ -212,7 +212,7 @@ ssize_t csocket::send_for_stream(const void *buffer, size_t size) const total_sent_size += len; err = 0; } else { - _ERRNO(errno, _E, "Failed to send(%d, 0x%p + %d, %d - %d) = %d for %s", + _ERRNO(errno, _E, "Failed to send(%d, %#p + %d, %d - %d) = %d for %s", m_sock_fd, buffer, total_sent_size, size, total_sent_size, len, get_client_name()); @@ -238,12 +238,12 @@ ssize_t csocket::recv_for_stream(void* buffer, size_t size) const if (len > 0) { total_recv_size += len; } else if (len == 0) { - _E("recv(%d, 0x%p + %d, %d - %d) = %d, because the peer of %s performed shutdown!", + _E("recv(%d, %#p + %d, %d - %d) = %d, because the peer of %s performed shutdown!", m_sock_fd, buffer, total_recv_size, size, total_recv_size, len, get_client_name()); err = 1; break; } else { - _ERRNO(errno, _E, "Failed to recv(%d, 0x%p + %d, %d - %d) = %d for %s", + _ERRNO(errno, _E, "Failed to recv(%d, %#p + %d, %d - %d) = %d for %s", m_sock_fd, buffer, total_recv_size, size, total_recv_size, len, get_client_name()); diff --git a/src/shared/sensor_info.cpp b/src/shared/sensor_info.cpp index eae3bde..f7c241a 100644 --- a/src/shared/sensor_info.cpp +++ b/src/shared/sensor_info.cpp @@ -211,7 +211,7 @@ void sensor_info::set_raw_data(const char *data, int data_len) void sensor_info::show(void) { _I("Type = %d", m_type); - _I("ID = 0x%llx", (int64_t)m_id); + _I("ID = %#llx", (int64_t)m_id); _I("Privilege = %d", (int)m_privilege); _I("Name = %s", m_name.c_str()); _I("Vendor = %s", m_vendor.c_str()); @@ -221,7 +221,7 @@ void sensor_info::show(void) _I("Min_interval = %d", m_min_interval); _I("Fifo_count = %d", m_fifo_count); _I("Max_batch_count = %d", m_max_batch_count); - _I("Supported_event = 0x%x", m_supported_event); + _I("Supported_event = %#x", m_supported_event); _I("Wakeup_supported = %d", m_wakeup_supported); } -- 2.7.4