Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f2d0717 authored by Michael Sun's avatar Michael Sun
Browse files

floss: metrics: make profile connection logging skinnier

Do not pass intent as they can be parsed from the connection state. Do
not log connection attempts separately, as they can also be parsed from
the connection state.

BUG: 240781725
Tag: #floss
Test: emerge-${BOARD} floss
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Iee60ac5e7e27cb67705c63a4eaaface6eae881eb
parent 6dd8dc88
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -170,10 +170,7 @@ void LogMetricsDeviceInfoReport(
      .Record();
}

void LogMetricsProfileConnectionAttempt(RawAddress* addr, uint32_t intent, uint32_t profile) {}

void LogMetricsProfileConnectionStateChanged(
    RawAddress* addr, uint32_t intent, uint32_t profile, uint32_t status, uint32_t state) {}
void LogMetricsProfileConnectionStateChanged(RawAddress* addr, uint32_t profile, uint32_t status, uint32_t state) {}

}  // namespace metrics
}  // namespace bluetooth
+1 −4
Original line number Diff line number Diff line
@@ -37,10 +37,7 @@ void LogMetricsDeviceInfoReport(
    uint32_t product_id,
    uint32_t version) {}

void LogMetricsProfileConnectionAttempt(RawAddress* addr, uint32_t intent, uint32_t profile) {}

void LogMetricsProfileConnectionStateChanged(
    RawAddress* addr, uint32_t intent, uint32_t profile, uint32_t status, uint32_t state) {}
void LogMetricsProfileConnectionStateChanged(RawAddress* addr, uint32_t profile, uint32_t status, uint32_t state) {}

}  // namespace metrics
}  // namespace bluetooth
+1 −3
Original line number Diff line number Diff line
@@ -35,9 +35,7 @@ void LogMetricsDeviceInfoReport(
    uint32_t vendor_id_src,
    uint32_t product_id,
    uint32_t version);
void LogMetricsProfileConnectionAttempt(RawAddress* addr, uint32_t intent, uint32_t profile);
void LogMetricsProfileConnectionStateChanged(
    RawAddress* addr, uint32_t intent, uint32_t profile, uint32_t status, uint32_t state);
void LogMetricsProfileConnectionStateChanged(RawAddress* addr, uint32_t profile, uint32_t status, uint32_t state);

}  // namespace metrics
}  // namespace bluetooth
+2 −9
Original line number Diff line number Diff line
@@ -59,17 +59,10 @@ void device_info_report(
      &addr, device_type, class_of_device, appearance, vendor_id, vendor_id_src, product_id, version);
}

void profile_connection_attempt(RustRawAddress bt_addr, uint32_t intent, uint32_t profile) {
void profile_connection_state_changed(RustRawAddress bt_addr, uint32_t profile, uint32_t status, uint32_t state) {
  RawAddress addr = rusty::CopyFromRustAddress(bt_addr);

  metrics::LogMetricsProfileConnectionAttempt(&addr, intent, profile);
}

void profile_connection_state_changed(
    RustRawAddress bt_addr, uint32_t intent, uint32_t profile, uint32_t status, uint32_t state) {
  RawAddress addr = rusty::CopyFromRustAddress(bt_addr);

  metrics::LogMetricsProfileConnectionStateChanged(&addr, intent, profile, status, state);
  metrics::LogMetricsProfileConnectionStateChanged(&addr, profile, status, state);
}

}  // namespace rust
+1 −3
Original line number Diff line number Diff line
@@ -40,9 +40,7 @@ void device_info_report(
    uint32_t vendor_id_src,
    uint32_t product_id,
    uint32_t version);
void profile_connection_attempt(RustRawAddress bt_addr, uint32_t intent, uint32_t profile);
void profile_connection_state_changed(
    RustRawAddress bt_addr, uint32_t intent, uint32_t profile, uint32_t status, uint32_t state);
void profile_connection_state_changed(RustRawAddress bt_addr, uint32_t profile, uint32_t status, uint32_t state);

}  // namespace rust
}  // namespace topshim
Loading