diff options
Diffstat (limited to 'system/common/metrics.h')
-rw-r--r-- | system/common/metrics.h | 120 |
1 files changed, 51 insertions, 69 deletions
diff --git a/system/common/metrics.h b/system/common/metrics.h index 182d0b0387..c40b184bf8 100644 --- a/system/common/metrics.h +++ b/system/common/metrics.h @@ -89,7 +89,7 @@ typedef enum { * NOTE: Negative values are invalid */ class A2dpSessionMetrics { - public: +public: A2dpSessionMetrics() {} /* @@ -121,7 +121,7 @@ class A2dpSessionMetrics { }; class BluetoothMetricsLogger { - public: +public: static BluetoothMetricsLogger* GetInstance() { static BluetoothMetricsLogger* instance = new BluetoothMetricsLogger(); return instance; @@ -137,8 +137,8 @@ class BluetoothMetricsLogger { * disconnect_reason: HCI reason for pairing disconnection. * See: stack/include/hcidefs.h */ - void LogPairEvent(uint32_t disconnect_reason, uint64_t timestamp_ms, - uint32_t device_class, device_type_t device_type); + void LogPairEvent(uint32_t disconnect_reason, uint64_t timestamp_ms, uint32_t device_class, + device_type_t device_type); /* * Record a wake event @@ -149,8 +149,8 @@ class BluetoothMetricsLogger { * requestor: if provided is the service requesting the wake lock * name: the name of the wake lock held */ - void LogWakeEvent(wake_event_type_t type, const std::string& requestor, - const std::string& name, uint64_t timestamp_ms); + void LogWakeEvent(wake_event_type_t type, const std::string& requestor, const std::string& name, + uint64_t timestamp_ms); /* * Record a scan event @@ -162,8 +162,8 @@ class BluetoothMetricsLogger { * type: whether the scan reports BR/EDR, LE, or both. * results: number of results to be reported. */ - void LogScanEvent(bool start, const std::string& initator, scan_tech_t type, - uint32_t results, uint64_t timestamp_ms); + void LogScanEvent(bool start, const std::string& initiator, scan_tech_t type, uint32_t results, + uint64_t timestamp_ms); /* * Start logging a Bluetooth session @@ -180,8 +180,7 @@ class BluetoothMetricsLogger { * timestamp_ms : the timestamp for session start, 0 means now * */ - void LogBluetoothSessionStart(connection_tech_t connection_tech_type, - uint64_t timestamp_ms); + void LogBluetoothSessionStart(connection_tech_t connection_tech_type, uint64_t timestamp_ms); /* * Stop logging a Bluetooth session and pushes it to the log queue @@ -193,8 +192,7 @@ class BluetoothMetricsLogger { * timestamp_ms : the timestamp of session end, 0 means now * */ - void LogBluetoothSessionEnd(disconnect_reason_t disconnect_reason, - uint64_t timestamp_ms); + void LogBluetoothSessionEnd(disconnect_reason_t disconnect_reason, uint64_t timestamp_ms); /* * Log information about remote device in a current Bluetooth session @@ -206,8 +204,7 @@ class BluetoothMetricsLogger { * device_class : device_class defined in btm_api_types.h * device_type : type of remote device */ - void LogBluetoothSessionDeviceInfo(uint32_t device_class, - device_type_t device_type); + void LogBluetoothSessionDeviceInfo(uint32_t device_class, device_type_t device_type); /* * Log A2DP Audio Session Information @@ -252,7 +249,7 @@ class BluetoothMetricsLogger { static const size_t kMaxNumWakeEvent = 1000; static const size_t kMaxNumScanEvent = 50; - private: +private: BluetoothMetricsLogger(); /* @@ -305,11 +302,9 @@ static const uint32_t kUnknownConnectionHandle = 0xFFFF; * @param cmd_status Command status associated with this event, if any * @param reason_code Reason code associated with this event, if any */ -void LogLinkLayerConnectionEvent(const RawAddress* address, - uint32_t connection_handle, - android::bluetooth::DirectionEnum direction, - uint16_t link_type, uint32_t hci_cmd, - uint16_t hci_event, uint16_t hci_ble_event, +void LogLinkLayerConnectionEvent(const RawAddress* address, uint32_t connection_handle, + android::bluetooth::DirectionEnum direction, uint16_t link_type, + uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, uint16_t cmd_status, uint16_t reason_code); /** @@ -345,8 +340,7 @@ void LogRemoteVersionInfo(uint16_t handle, uint8_t status, uint8_t version, * @param num_missing_pcm_bytes number of PCM bytes that cannot be read from * the source */ -void LogA2dpAudioUnderrunEvent(const RawAddress& address, - uint64_t encoding_interval_millis, +void LogA2dpAudioUnderrunEvent(const RawAddress& address, uint64_t encoding_interval_millis, int num_missing_pcm_bytes); /** @@ -360,10 +354,8 @@ void LogA2dpAudioUnderrunEvent(const RawAddress& address, * @param num_dropped_encoded_bytes number of encoded bytes dropped from Tx * queue */ -void LogA2dpAudioOverrunEvent(const RawAddress& address, - uint64_t encoding_interval_millis, - int num_dropped_buffers, - int num_dropped_encoded_frames, +void LogA2dpAudioOverrunEvent(const RawAddress& address, uint64_t encoding_interval_millis, + int num_dropped_buffers, int num_dropped_encoded_frames, int num_dropped_encoded_bytes); /** @@ -373,8 +365,7 @@ void LogA2dpAudioOverrunEvent(const RawAddress& address, * @param playback_state audio playback state * @param audio_coding_mode audio codec encoding mode */ -void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state, - int audio_coding_mode); +void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state, int audio_coding_mode); /** * Log read RSSI result @@ -385,8 +376,8 @@ void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state, * @param cmd_status command status from read RSSI command * @param rssi rssi value in dBm */ -void LogReadRssiResult(const RawAddress& address, uint16_t handle, - uint32_t cmd_status, int8_t rssi); +void LogReadRssiResult(const RawAddress& address, uint16_t handle, uint32_t cmd_status, + int8_t rssi); /** * Log failed contact counter report @@ -398,9 +389,8 @@ void LogReadRssiResult(const RawAddress& address, uint16_t handle, * @param failed_contact_counter Number of consecutive failed contacts for a * connection corresponding to the Handle */ -void LogReadFailedContactCounterResult(const RawAddress& address, - uint16_t handle, uint32_t cmd_status, - int32_t failed_contact_counter); +void LogReadFailedContactCounterResult(const RawAddress& address, uint16_t handle, + uint32_t cmd_status, int32_t failed_contact_counter); /** * Log transmit power level for a particular device after read @@ -412,8 +402,7 @@ void LogReadFailedContactCounterResult(const RawAddress& address, * @param transmit_power_level transmit power level for connection to this * device */ -void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle, - uint32_t cmd_status, +void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle, uint32_t cmd_status, int32_t transmit_power_level); /** @@ -425,8 +414,7 @@ void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle, * @param smp_fail_reason SMP pairing failure reason code from SMP spec */ void LogSmpPairingEvent(const RawAddress& address, uint8_t smp_cmd, - android::bluetooth::DirectionEnum direction, - uint8_t smp_fail_reason); + android::bluetooth::DirectionEnum direction, uint8_t smp_fail_reason); /** * Logs there is an event related Bluetooth classic pairing @@ -440,8 +428,9 @@ void LogSmpPairingEvent(const RawAddress& address, uint8_t smp_cmd, * @param reason_code Reason code associated with this event * @param event_value A status value related to this specific event */ -void LogClassicPairingEvent(const RawAddress& address, uint16_t handle, uint32_t hci_cmd, uint16_t hci_event, - uint16_t cmd_status, uint16_t reason_code, int64_t event_value); +void LogClassicPairingEvent(const RawAddress& address, uint16_t handle, uint32_t hci_cmd, + uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, + int64_t event_value); /** * Logs when certain Bluetooth SDP attributes are discovered @@ -453,9 +442,8 @@ void LogClassicPairingEvent(const RawAddress& address, uint16_t handle, uint32_t * @param attribute_value pointer to the attribute data, must be larger than * attribute_size */ -void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid, - uint16_t attribute_id, size_t attribute_size, - const char* attribute_value); +void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid, uint16_t attribute_id, + size_t attribute_size, const char* attribute_value); /** * Logs when there is a change in Bluetooth socket connection state @@ -472,11 +460,10 @@ void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid, * @param socket_role role of this socket, server or connection * @param uid socket owner's uid */ -void LogSocketConnectionState( - const RawAddress& address, int port, int type, - android::bluetooth::SocketConnectionstateEnum connection_state, - int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port, - android::bluetooth::SocketRoleEnum socket_role); +void LogSocketConnectionState(const RawAddress& address, int port, int type, + android::bluetooth::SocketConnectionstateEnum connection_state, + int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port, + android::bluetooth::SocketRoleEnum socket_role); /** * Logs when a Bluetooth device's manufacturer information is learnt @@ -492,10 +479,8 @@ void LogSocketConnectionState( void LogManufacturerInfo(const RawAddress& address, android::bluetooth::AddressTypeEnum address_type, android::bluetooth::DeviceInfoSrcEnum source_type, - const std::string& source_name, - const std::string& manufacturer, - const std::string& model, - const std::string& hardware_version, + const std::string& source_name, const std::string& manufacturer, + const std::string& model, const std::string& hardware_version, const std::string& software_version); /** @@ -508,28 +493,25 @@ void LogManufacturerInfo(const RawAddress& address, void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code, uint32_t vendor_error_code); -void LogLeAudioConnectionSessionReported( - int32_t group_size, int32_t group_metric_id, - int64_t connection_duration_nanos, - std::vector<int64_t>& device_connecting_offset_nanos, - std::vector<int64_t>& device_connected_offset_nanos, - std::vector<int64_t>& device_connection_duration_nanos, - std::vector<int32_t>& device_connection_status, - std::vector<int32_t>& device_disconnection_status, - std::vector<RawAddress>& device_address, - std::vector<int64_t>& streaming_offset_nanos, - std::vector<int64_t>& streaming_duration_nanos, - std::vector<int32_t>& streaming_context_type); +void LogLeAudioConnectionSessionReported(int32_t group_size, int32_t group_metric_id, + int64_t connection_duration_nanos, + std::vector<int64_t>& device_connecting_offset_nanos, + std::vector<int64_t>& device_connected_offset_nanos, + std::vector<int64_t>& device_connection_duration_nanos, + std::vector<int32_t>& device_connection_status, + std::vector<int32_t>& device_disconnection_status, + std::vector<RawAddress>& device_address, + std::vector<int64_t>& streaming_offset_nanos, + std::vector<int64_t>& streaming_duration_nanos, + std::vector<int32_t>& streaming_context_type); void LogLeAudioBroadcastSessionReported(int64_t duration_nanos); void LogLeBluetoothConnectionMetricEventReported( - const RawAddress& raw_address, - android::bluetooth::le::LeConnectionOriginType origin_type, - android::bluetooth::le::LeConnectionType connection_type, - android::bluetooth::le::LeConnectionState transaction_state, - std::vector<std::pair<os::ArgumentType, int>> - argument_list); + const RawAddress& raw_address, android::bluetooth::le::LeConnectionOriginType origin_type, + android::bluetooth::le::LeConnectionType connection_type, + android::bluetooth::le::LeConnectionState transaction_state, + std::vector<std::pair<os::ArgumentType, int>> argument_list); } // namespace common |