RDKEMW-16814: reduce ble status prints and events#235
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces log/event noise across the Control Manager (ctrlm-main) codebase, with the main functional change being throttling/coalescing of BLE “status print” output and BLE “status event” emissions.
Changes:
- Downgrade many high-frequency logs from
XLOGD_INFOtoXLOGD_DEBUG(DB access, controller lifecycle, BLE GATT services, etc.). - Add BLE-network scheduling to defer/coalesce pairing-table printing (
printStatus()) and IARM status events (iarm_event_rcu_status()), instead of printing/emitting on every status update. - Minor adjustments to BLE startup/status output and IR RF database printing verbosity.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/database/ctrlm_db_types.cpp | Reduce DB blob read/write log verbosity (INFO → DEBUG). |
| src/database/ctrlm_database.cpp | Reduce controller-create log verbosity (INFO → DEBUG). |
| src/ctrlm_network.h | Add new virtual request handlers for status print/event. |
| src/ctrlm_network.cpp | Provide base “not implemented” handlers for new status print/event requests. |
| src/ctrlm_ir_controller.cpp | Reduce IR input device name logging verbosity. |
| src/ctrlm_controller.cpp | Reduce controller ctor/dtor logging verbosity. |
| src/ble/hal/blercu/bluez/blegattnotifypipe.cpp | Reduce notify-thread launch logging verbosity. |
| src/ble/hal/blercu/bleservices/gatt/gatt_remotecontrolservice.cpp | Reduce several “request succeeded / initial value” logs to DEBUG. |
| src/ble/hal/blercu/bleservices/gatt/gatt_infraredsignal.cpp | Reduce IR characteristic discovery logs to DEBUG. |
| src/ble/hal/blercu/bleservices/gatt/gatt_infraredservice.cpp | Reduce IR support/code-id logs to DEBUG. |
| src/ble/hal/blercu/bleservices/gatt/gatt_deviceinfoservice.cpp | Reduce device-info milestone logs to DEBUG and shorten comment. |
| src/ble/hal/blercu/bleservices/gatt/gatt_batteryservice.cpp | Reduce battery change log to DEBUG. |
| src/ble/hal/blercu/bleservices/gatt/gatt_audioservice_rdk.cpp | Reduce audio property read logs to DEBUG. |
| src/ble/ctrlm_ble_rcu_interface.cpp | Reduce managed device listing log; enrich “input dev node found” log. |
| src/ble/ctrlm_ble_network.h | Add scheduling APIs + defer counters for BLE status print/event throttling. |
| src/ble/ctrlm_ble_network.cpp | Implement timers + deferred status print/event emission; adjust BLE startup/status logging. |
| src/ble/ctrlm_ble_controller.cpp | Reduce BLE controller ctor logging verbosity. |
| src/ble/ctrlm_ble_controller_attr_version.cpp | Reduce BLE version DB read/write logs to DEBUG. |
| src/attributes/ctrlm_attr_voice.cpp | Reduce voice metrics DB read/write logs to DEBUG. |
| src/attributes/ctrlm_attr_general.cpp | Reduce general attribute DB read/write logs to DEBUG. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/ble/ctrlm_ble_network.cpp:2018
- Same off-by-one issue as schedule_status_print():
event_status_defer_count_ > CTRLM_BLE_EVENT_STATUS_DEFER_MAXis evaluated before incrementing, which permits one extra deferral beyond the configured MAX before forcing an immediate event push. Consider changing the comparison (or the increment/check order) so the configured MAX is enforced as intended.
THREAD_ID_VALIDATE();
ctrlm_timeout_destroy(&g_ctrlm_ble_network.event_status_timer_tag);
if (immediately || event_status_defer_count_ > CTRLM_BLE_EVENT_STATUS_DEFER_MAX) {
event_status_defer_count_ = 0;
ctrlm_main_queue_msg_header_t msg;
errno_t safec_rc = memset_s(&msg, sizeof(msg), 0, sizeof(msg));
ERR_CHK(safec_rc);
ctrlm_main_queue_handler_push(CTRLM_HANDLER_NETWORK, (ctrlm_msg_handler_network_t)&ctrlm_obj_network_t::req_process_event_status, &msg, sizeof(msg), NULL, id_);
} else {
event_status_defer_count_++;
g_ctrlm_ble_network.event_status_timer_tag = ctrlm_timeout_create(CTRLM_BLE_EVENT_STATUS_TIMEOUT, ctrlm_ble_event_status_timer_cb, &id_);
}
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/ble/ctrlm_ble_network.cpp:2011
- In schedule_status_event(), the defer-limit check uses
event_status_defer_count_ > CTRLM_BLE_EVENT_STATUS_DEFER_MAX, which effectively permits DEFER_MAX+1 deferrals before forcing an event. If the desired behavior is “trigger once the max is reached”, use>=here as well.
void ctrlm_obj_network_ble_t::schedule_status_event(bool immediately) {
XLOGD_DEBUG("immediately = <%s>, event_status_defer_count_ = <%d>", immediately ? "TRUE" : "FALSE", event_status_defer_count_);
THREAD_ID_VALIDATE();
ctrlm_timeout_destroy(&g_ctrlm_ble_network.event_status_timer_tag);
if (immediately || event_status_defer_count_ > CTRLM_BLE_EVENT_STATUS_DEFER_MAX) {
event_status_defer_count_ = 0;
ctrlm_main_queue_msg_header_t msg;
| XLOGD_TELEMETRY("BLE remote RF pairing state changed to <%s>", ctrlm_rf_pair_state_str(dqm->state)); | ||
| state_ = dqm->state; | ||
| if (state_ == CTRLM_RF_PAIR_STATE_COMPLETE || state_ == CTRLM_RF_PAIR_STATE_IDLE) { | ||
| // report status in a couple seconds to allow remote data to be received from bluez |
|
b'## WARNING: A Blackduck scan failure has been waived A prior failure has been upvoted
|
No description provided.