Skip to content

RDK-60621 - Data Collection Through T2 Events For Components Logging To btmgrlog.txt#75

Open
ANANTHMARIMUTHU wants to merge 32 commits intodevelopfrom
RDK-60621
Open

RDK-60621 - Data Collection Through T2 Events For Components Logging To btmgrlog.txt#75
ANANTHMARIMUTHU wants to merge 32 commits intodevelopfrom
RDK-60621

Conversation

@ANANTHMARIMUTHU
Copy link
Contributor

No description provided.

@ANANTHMARIMUTHU ANANTHMARIMUTHU requested a review from a team as a code owner February 20, 2026 08:32
Copilot AI review requested due to automatic review settings February 20, 2026 08:32
Copy link
Contributor

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 pull request adds telemetry instrumentation to the Bluetooth Manager (btrMgr) to track various Bluetooth operations and error conditions. The changes integrate a telemetry library (bt-telemetry.h) and add 22 telemetry markers throughout the codebase to monitor connection, pairing, unpairing, discovery, and error events.

Changes:

  • Added bt-telemetry.h include and initialized telemetry in BTRMGR_Init
  • Instrumented 22 telemetry markers for tracking BT operations (connect/disconnect, pair/unpair, discovery errors, adapter errors, GamePad RFC values)
  • Added test simulation function (commented out with #if 0) to verify all telemetry markers
  • Changed RFC GamePad parameter logging from DEBUG to INFO level

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 20, 2026 13:26
Copy link
Contributor

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 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor Author

@ANANTHMARIMUTHU ANANTHMARIMUTHU left a comment

Choose a reason for hiding this comment

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

review

@ANANTHMARIMUTHU ANANTHMARIMUTHU linked an issue Feb 24, 2026 that may be closed by this pull request
Copilot AI review requested due to automatic review settings February 25, 2026 13:07
Copy link
Contributor

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 3 out of 3 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 26, 2026 12:23
Copy link
Contributor

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 5 out of 5 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

char btmgr_name[] = "btmgr";
telemetry_init(btmgr_name);
/* Run telemetry test simulation if BTRMGR_TELEMETRY_TEST=1 is set */
// btrMgr_TelemetryTestSimulation();
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

Commented-out function call. This commented-out call to btrMgr_TelemetryTestSimulation should be removed. Commented-out code reduces code readability and should not be committed to the codebase. If this is needed for future testing, consider using a feature flag or environment variable check instead.

Suggested change
// btrMgr_TelemetryTestSimulation();

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@ANANTHMARIMUTHU ANANTHMARIMUTHU left a comment

Choose a reason for hiding this comment

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

review

Copilot AI review requested due to automatic review settings February 27, 2026 08:32
Copy link
Contributor

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 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 5738 to 5752
//Inside this function there is a failure logs so, did not any failures logs here.
btrMgr_GetDeviceDetails(ahBTRMgrDevHdl,&stDeviceInfo);
const char* lpcDeviceName = stDeviceInfo.pcDeviceName ? stDeviceInfo.pcDeviceName : "Unknown";

if (lenBtrCoreRet != enBTRCoreSuccess) {
//This is telemetry log. If we change this print,need to change and configure the telemetry string in xconf server.
char buffer[256];
snprintf(buffer, sizeof(buffer), "Failed to Disconnect from this device - Confirmed name,class,apperance,modalias: %s,%u,%u,v%04Xp%04Xd%04X",
lpcDeviceName, stDeviceInfo.ui32DevClassBtSpec, stDeviceInfo.ui16DevAppearanceBleSpec,
stDeviceInfo.ui32ModaliasVendorId, stDeviceInfo.ui32ModaliasProductId, stDeviceInfo.ui32ModaliasDeviceId);
telemetry_event_s("BTDiscFail_split", buffer);
BTRMGRLOG_ERROR ("Failed to Disconnect from this device - Confirmed name,class,apperance,modalias: %s,%u,%u,v%04Xp%04Xd%04X\n",
stDeviceInfo.pcDeviceName, stDeviceInfo.ui32DevClassBtSpec, stDeviceInfo.ui16DevAppearanceBleSpec,
lpcDeviceName, stDeviceInfo.ui32DevClassBtSpec, stDeviceInfo.ui16DevAppearanceBleSpec,
stDeviceInfo.ui32ModaliasVendorId, stDeviceInfo.ui32ModaliasProductId, stDeviceInfo.ui32ModaliasDeviceId);
BTRMGRLOG_ERROR ("Disconnect failure device MAC %s\n", stDeviceInfo.pcDeviceAddress);
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Disconnect telemetry/log formatting has the same issue as connect/unpair: stDeviceInfo is not zero-initialized and the result of btrMgr_GetDeviceDetails is ignored. If that call fails, pcDeviceName/pcDeviceAddress may be garbage and the telemetry payload may contain undefined values. Please MEMSET_S + check the return, and fall back to safe defaults before calling snprintf/telemetry_event_*.

Copilot uses AI. Check for mistakes.
Comment on lines +673 to +680
/*
* TEST SIMULATION FUNCTION FOR TELEMETRY MARKERS
* This function simulates all 22 telemetry markers for testing
* Set BTRMGR_TELEMETRY_TEST=1 environment variable to enable testing
*/
#if 1
STATIC void
btrMgr_TelemetryTestSimulation (
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The telemetry test simulation block is compiled in unconditionally (#if 1) despite the comment saying it should be enabled via an environment variable. This risks shipping a test-only routine in production builds. Please gate this behind a compile-time flag (e.g., #ifdef BTRMGR_TELEMETRY_TEST) and/or implement the documented env-var check inside the function.

Copilot uses AI. Check for mistakes.
Comment on lines 61 to +64
#include "btrMgr_SysDiag.h"
#include "btrMgr_Columbo.h"
#include "btrMgr_LEOnboarding.h"

#include "bt-telemetry.h"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

bt-telemetry.h is included unconditionally, but this repository does not provide that header in the normal include paths (it only exists under unitTest/support/include). This will break non-unit-test builds unless the header/library is guaranteed to come from an external dependency. Please add a proper configure-time check + conditional include (or ship/install the header and link the telemetry library when enabled).

Copilot uses AI. Check for mistakes.
Comment on lines 5406 to +5415
//Inside this function there is a failure logs so, did not any failures logs here.
btrMgr_GetDeviceDetails(ahBTRMgrDevHdl,&stDeviceInfo);

if (enBTRCoreSuccess != BTRCore_UnPairDevice(ghBTRCoreHdl, ahBTRMgrDevHdl)) {
//This is telemetry log. If we change this print,need to change and configure the telemetry string in xconf server.
char buffer[256];
snprintf(buffer, sizeof(buffer), "Failed to unpair name,class,apperance,modalias: %s,%u,%u,v%04Xp%04Xd%04X",
stDeviceInfo.pcDeviceName, stDeviceInfo.ui32DevClassBtSpec, stDeviceInfo.ui16DevAppearanceBleSpec,
stDeviceInfo.ui32ModaliasVendorId, stDeviceInfo.ui32ModaliasProductId, stDeviceInfo.ui32ModaliasDeviceId);
telemetry_event_s("BTUnpairFail_split", buffer);
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Unpair telemetry/log formatting uses stDeviceInfo without checking whether btrMgr_GetDeviceDetails succeeded, and without NULL-safety for pcDeviceName/pcDeviceAddress. Please zero-init stDeviceInfo, check the return from btrMgr_GetDeviceDetails, and use safe fallbacks ("Unknown" / 0) when details are unavailable to avoid crashes and bogus telemetry payloads.

Copilot uses AI. Check for mistakes.
@ANANTHMARIMUTHU ANANTHMARIMUTHU changed the title Rdk 60621 RDK-60621 - Data Collection Through T2 Events For Components Logging To btmgrlog.txt Feb 27, 2026
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.

RDK-60621 t2 event

2 participants