Skip to content

RDKEMW-16814: reduce ble status prints and events#235

Open
egalla204 wants to merge 6 commits into
developfrom
RDKEMW-16814_reduce_ble_logging
Open

RDKEMW-16814: reduce ble status prints and events#235
egalla204 wants to merge 6 commits into
developfrom
RDKEMW-16814_reduce_ble_logging

Conversation

@egalla204
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 14, 2026 23:24
@egalla204 egalla204 requested a review from a team as a code owner May 14, 2026 23:24
@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/control/235/rdk/components/generic/control

  • Commit: 6a7f4c3

Report detail: gist'

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_INFO to XLOGD_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.

Comment thread src/ble/ctrlm_ble_network.cpp
Comment thread src/ble/ctrlm_ble_network.cpp Outdated
Comment thread src/ble/ctrlm_ble_network.cpp Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_MAX is 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_);
   }

Comment thread src/ble/ctrlm_ble_network.cpp
Comment thread src/ble/ctrlm_ble_network.cpp Outdated
Comment thread src/ctrlm_controller.cpp Outdated
@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/control/235/rdk/components/generic/control

  • Commit: 57a79f5

Report detail: gist'

@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/control/235/rdk/components/generic/control

  • Commit: 231d418

Report detail: gist'

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Comment thread src/ble/ctrlm_ble_network.cpp
Comment thread src/ble/ctrlm_ble_network.cpp Outdated
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
@rdkcmf-jenkins
Copy link
Copy Markdown
Contributor

b'## WARNING: A Blackduck scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: ok

  • Commit: 231d418
    '

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants