summaryrefslogtreecommitdiff
path: root/system/common/metrics.cc
diff options
context:
space:
mode:
author Henri Chataing <henrichataing@google.com> 2024-04-15 20:33:17 +0000
committer Henri Chataing <henrichataing@google.com> 2024-04-18 21:20:57 +0000
commit3398c071e0c7211893d69fb3e37c211aec25cb60 (patch)
tree038bc8dd5c402e721112a05298ea5b82b8d9b390 /system/common/metrics.cc
parente234dced479dad4c9e5245a0453c0c573771ab28 (diff)
system: Remove most ADDRESS_TO_LOGGABLE_(CSTR|STR)
The added formatters for address types have all the same behavior. ADDRESS_TO_LOGGABLE_STR still occurs in BTM_History, dumpsys, log::assert_that calls Test: m com.android.btservices Bug: 305066880 Flag: EXEMPT, mechanical refactor Change-Id: I950f76bd2f1d000638752759a3f08ba0be6f014c
Diffstat (limited to 'system/common/metrics.cc')
-rw-r--r--system/common/metrics.cc49
1 files changed, 19 insertions, 30 deletions
diff --git a/system/common/metrics.cc b/system/common/metrics.cc
index 251af12258..f2016e2c2e 100644
--- a/system/common/metrics.cc
+++ b/system/common/metrics.cc
@@ -614,9 +614,8 @@ void LogLinkLayerConnectionEvent(const RawAddress* address,
"failed to log status {}, reason {} from cmd {}, event {}, ble_event "
"{} for {}, handle {}, type {}, error {}",
loghex(cmd_status), loghex(reason_code), loghex(hci_cmd),
- loghex(hci_event), loghex(hci_ble_event),
- ADDRESS_TO_LOGGABLE_STR(*address), connection_handle, loghex(link_type),
- ret);
+ loghex(hci_event), loghex(hci_ble_event), *address, connection_handle,
+ loghex(link_type), ret);
}
}
@@ -661,8 +660,7 @@ void LogA2dpAudioUnderrunEvent(const RawAddress& address,
log::warn(
"failed for {}, encoding_interval_nanos {}, num_missing_pcm_bytes {}, "
"error {}",
- ADDRESS_TO_LOGGABLE_STR(address), encoding_interval_nanos,
- num_missing_pcm_bytes, ret);
+ address, encoding_interval_nanos, num_missing_pcm_bytes, ret);
}
}
@@ -690,9 +688,8 @@ void LogA2dpAudioOverrunEvent(const RawAddress& address,
"failed to log for {}, encoding_interval_nanos {}, num_dropped_buffers "
"{}, num_dropped_encoded_frames {}, num_dropped_encoded_bytes {}, "
"error {}",
- ADDRESS_TO_LOGGABLE_STR(address), encoding_interval_nanos,
- num_dropped_buffers, num_dropped_encoded_frames,
- num_dropped_encoded_bytes, ret);
+ address, encoding_interval_nanos, num_dropped_buffers,
+ num_dropped_encoded_frames, num_dropped_encoded_bytes, ret);
}
}
@@ -713,8 +710,7 @@ void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state,
log::warn(
"failed to log for {}, playback_state {}, audio_coding_mode {}, error "
"{}",
- ADDRESS_TO_LOGGABLE_STR(address), playback_state, audio_coding_mode,
- ret);
+ address, playback_state, audio_coding_mode, ret);
}
}
@@ -733,8 +729,7 @@ void LogReadRssiResult(const RawAddress& address, uint16_t handle,
cmd_status, rssi, metric_id);
if (ret < 0) {
log::warn("failed for {}, handle {}, status {}, rssi {} dBm, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), handle, loghex(cmd_status),
- rssi, ret);
+ address, handle, loghex(cmd_status), rssi, ret);
}
}
@@ -757,8 +752,7 @@ void LogReadFailedContactCounterResult(const RawAddress& address,
log::warn(
"failed for {}, handle {}, status {}, failed_contact_counter {} "
"packets, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), handle, loghex(cmd_status),
- failed_contact_counter, ret);
+ address, handle, loghex(cmd_status), failed_contact_counter, ret);
}
}
@@ -780,8 +774,7 @@ void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle,
log::warn(
"failed for {}, handle {}, status {}, transmit_power_level {} packets, "
"error {}",
- ADDRESS_TO_LOGGABLE_STR(address), handle, loghex(cmd_status),
- transmit_power_level, ret);
+ address, handle, loghex(cmd_status), transmit_power_level, ret);
}
}
@@ -804,8 +797,7 @@ void LogSmpPairingEvent(const RawAddress& address, uint8_t smp_cmd,
if (ret < 0) {
log::warn(
"failed for {}, smp_cmd {}, direction {}, smp_fail_reason {}, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), loghex(smp_cmd), direction,
- loghex(smp_fail_reason), ret);
+ address, loghex(smp_cmd), direction, loghex(smp_fail_reason), ret);
}
}
@@ -828,9 +820,8 @@ void LogClassicPairingEvent(const RawAddress& address, uint16_t handle, uint32_t
log::warn(
"failed for {}, handle {}, hci_cmd {}, hci_event {}, cmd_status {}, "
"reason {}, event_value {}, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), handle, loghex(hci_cmd),
- loghex(hci_event), loghex(cmd_status), loghex(reason_code), event_value,
- ret);
+ address, handle, loghex(hci_cmd), loghex(hci_event), loghex(cmd_status),
+ loghex(reason_code), event_value, ret);
}
}
@@ -853,8 +844,7 @@ void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid,
protocol_uuid, attribute_id, attribute_field, metric_id);
if (ret < 0) {
log::warn("failed for {}, protocol_uuid {}, attribute_id {}, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), loghex(protocol_uuid),
- loghex(attribute_id), ret);
+ address, loghex(protocol_uuid), loghex(attribute_id), ret);
}
}
@@ -881,8 +871,8 @@ void LogSocketConnectionState(
log::warn(
"failed for {}, port {}, type {}, state {}, tx_bytes {}, rx_bytes {}, "
"uid {}, server_port {}, socket_role {}, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), port, type, connection_state,
- tx_bytes, rx_bytes, uid, server_port, socket_role, ret);
+ address, port, type, connection_state, tx_bytes, rx_bytes, uid,
+ server_port, socket_role, ret);
}
}
@@ -914,9 +904,9 @@ void LogManufacturerInfo(const RawAddress& address,
"failed for {}, source_type {}, source_name {}, manufacturer {}, model "
"{}, hardware_version {}, software_version {} MAC address type {} MAC "
"address prefix {} {} {}, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), source_type, source_name,
- manufacturer, model, hardware_version, software_version, address_type,
- address.address[5], address.address[4], address.address[3], ret);
+ address, source_type, source_name, manufacturer, model,
+ hardware_version, software_version, address_type, address.address[5],
+ address.address[4], address.address[3], ret);
}
}
@@ -934,8 +924,7 @@ void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code,
obfuscated_id_field, error_code, vendor_error_code);
if (ret < 0) {
log::warn("failed for {}, error_code {}, vendor_error_code {}, error {}",
- ADDRESS_TO_LOGGABLE_STR(address), loghex(error_code),
- loghex(vendor_error_code), ret);
+ address, loghex(error_code), loghex(vendor_error_code), ret);
}
}