Skip to content

rebase#120

Open
Abhinavpv28 wants to merge 69 commits into
feature/RDKEMW-3380from
develop
Open

rebase#120
Abhinavpv28 wants to merge 69 commits into
feature/RDKEMW-3380from
develop

Conversation

@Abhinavpv28
Copy link
Copy Markdown
Contributor

No description provided.

@Abhinavpv28 Abhinavpv28 requested a review from a team as a code owner May 3, 2025 07:25
@Abhinavpv28 Abhinavpv28 requested a review from a team May 3, 2025 07:25
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 3, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
6 out of 8 committers have signed the CLA.

✅ Saranya2421
✅ nhanasi
✅ AravindanNC
✅ Abhinavpv28
✅ venkat0557
✅ Alan-Ryan
❌ Saranya
❌ naveenkumarhanasi


Saranya seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Abhinavpv28 and others added 6 commits May 5, 2025 15:49
…ic Updates (#117)

* Update rrdInterface.c

* Update rrdInterface.c

* Update rrdInterface.c

* Update cov_build.sh

* Update configure.ac

* Update rrdInterface.c

* Update rrdInterface.h

* Update cov_build.sh

* Update rrdInterface.c

* Update rrdInterface.h

* Update rrdInterface.c

---------

Co-authored-by: nhanasi <navihansi@gmail.com>
…method (#123)

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdCommon.h

* Update rrdIarmEvents.c

* Update rrdInterface.h

* Update rrdCommon.h

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c

* Update rrdDynamic.c

* Update rrdJsonParser.c

* Update rrdCommon.h

* Update rrdIarmEvents.c

* Update rrdInterface.h

* Update rrdInterface.h

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c

* Update rrdRunCmdThread.c

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdJsonParser.c

* Update rrdEventProcess.c

* Update rrdJsonParser.c

* Update rrdJsonParser.c

* Update rrdJsonParser.c

* Update rrdEventProcess.c

* Update rrdCommon.h

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c

* Update rrdIarmEvents.c
…method (#125)

* Update rrdIarmEvents.c

* Update rrdInterface.c

* Update rrdInterface.c

* Update cov_build.sh

* Update rrdIarmEvents.c

---------

Co-authored-by: nhanasi <navihansi@gmail.com>
…d message type (SCXI11BEI) (#121)

* Update rrdJsonParser.c

* Update rrdJsonParser.c

* Update rrdEventProcess.c

* Update rrdInterface.c

* Update rrdInterface.c

* Update rrdInterface.c

* Update rrdJsonParser.c

* Update rrdInterface.c

* Update rrdJsonParser.c

* Update rrdEventProcess.c

* Update rrdJsonParser.c

* Update rrdEventProcess.c

* Update rrdEventProcess.c

* Update rrdInterface.c

* Update rrdInterface.c

---------

Co-authored-by: nhanasi <navihansi@gmail.com>
Copy link
Copy Markdown
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 62 out of 62 changed files in this pull request and generated 4 comments.


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

if '.' in ISSUE_STRING:
ISSUE_NODE, ISSUE_SUBNODE = ISSUE_STRING.split('.')
else:
node = ISSUE_STRING
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Variable node is not used.

Copilot uses AI. Check for mistakes.
ISSUE_NODE, ISSUE_SUBNODE = ISSUE_STRING.split('.')
else:
node = ISSUE_STRING
subnode = None
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Variable subnode is not used.

Copilot uses AI. Check for mistakes.
node = ISSUE_STRING
subnode = None

ISSUE_FOUND = f"Issue Data Node: {ISSUE_NODE} and Sub-Node: {ISSUE_SUBNODE} found in Static JSON File /etc/rrd/remote_debugger.json"
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Variable ISSUE_FOUND is not used.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

from helper_functions import *
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Import pollutes the enclosing namespace, as the imported module helper_functions does not define 'all'.

Copilot uses AI. Check for mistakes.
nhanasi and others added 4 commits January 22, 2026 19:45
…ode (#178)

* Update Makefile.am

* Update rrdExecuteScript.c

* Update rrd_upload.h

* Update Makefile.am

* Update Makefile.am

* Update Makefile.am

* Update Makefile.am

---------

Co-authored-by: nhanasi <navihansi@gmail.com>
Copilot AI review requested due to automatic review settings February 17, 2026 16:08
Copy link
Copy Markdown
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 62 out of 62 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (10)

test/functional-tests/tests/test_rrd_deepsleep_static_report.py:1

  • subprocess is used but never imported in this file, which will raise NameError at runtime. Add import subprocess (and any other required stdlib imports) at the top of the test module.
    test/functional-tests/tests/test_rrd_c_api_upload.py:1
  • subprocess is used but not imported in this new test file, which will fail at runtime. Add import subprocess at the top of the file.
    test/functional-tests/tests/test_rrd_append_report.py:1
  • This test module mutates /etc/rrd/remote_debugger.json at import time (before pytest collects/runs tests), which can cause non-deterministic failures and pollute the test environment. Move this mutation into a test setup/fixture with a clear teardown (restore the original file), or write to a test-scoped copy (e.g., under /tmp) and point the system-under-test at that copy.
    test/functional-tests/tests/deepsleep_main.c:1
  • RRDEventThreadFunc loops forever and only breaks on msgrcv error, but main() unconditionally pthread_joins the thread. As written, the test harness can hang indefinitely. Add a termination mechanism (e.g., a shared atomic “stop” flag + msgrcv with timeout / non-blocking + periodic check, or cancel/detach the thread and exit cleanly after the events are injected).
    src/rrd_upload.c:1
  • UploadSTBLogsParams/TRIGGER_ONDEMAND come from uploadstblogs.h, but src/rrd_upload.h excludes that include when GTEST_ENABLE is defined. If rrd_upload.c is compiled with -DGTEST_ENABLE, this will not compile. Consider providing a small local typedef/enum shim under #ifdef GTEST_ENABLE (in a C header used by rrd_upload.c), or include uploadstblogs.h unconditionally for builds that compile this file.
    src/rrd_upload.c:1
  • Calling system("rm -rf %s") with an unquoted path is shell-injection prone if dir_path ever contains whitespace or shell metacharacters. Replace this with a safe recursive delete implementation (e.g., nftw + unlink/rmdir, or openat/unlinkat walking), or at minimum use an execv-style call to /bin/rm with -- and an argument vector (no shell).
    src/uploadRRDLogs.c:1
  • This PR introduces a substantial new orchestration surface with multiple distinct error codes (config load, MAC/timestamp, dir validation, sanitize, archive create, upload, cleanup). Add gtest unit coverage that asserts the returned error codes and key log/behavior for the main failure paths (e.g., invalid params → 1, config failure → 3, empty dir → 6, archive failure → 10, upload failure → 11) using mocks for sysinfo/upload and temp directories for filesystem behavior.
    src/rrd_sysinfo.h:1
  • The header comment says the MAC buffer needs “min 18 bytes”, but the implementation strips colons and only requires 12 hex chars + terminator (13 bytes). Update the documentation (or the implementation) so the required minimum buffer size is consistent.
    test/functional-tests/tests/power_controller.h:1
  • Correct the spelling in the enum comment: 'Critial' → 'Critical'.
    test/functional-tests/features/rrd_dynamic_profile_subcategory_report.feature:1
  • Fix typo in the scenario step: 'shopuld' → 'should'.

Comment thread src/rrdRunCmdThread.c
Comment on lines 417 to +424
/*Stop or Reset runtime service for issue*/
RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]: Stopping remote_debugger_%s service...\n",__FUNCTION__,__LINE__,cmdData->rfcvalue);
#if !defined(GTEST_ENABLE)
v_secure_system("systemctl stop %s", remoteDebuggerServiceStr);
v_secure_system("systemctl reset-failed %s", remoteDebuggerServiceStr);
free(cmdData->rfcvalue); // free rfcvalue received from RRDEventThreadFunc
free(cmdData->command); // free updated command info received from RRDEventThreadFunc
free(cmdData);
#endif
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

When GTEST_ENABLE is defined, cmdData->rfcvalue, cmdData->command, and cmdData are no longer freed, introducing a guaranteed memory leak on the gtest path. Keep memory cleanup outside the #if !defined(GTEST_ENABLE) guard and only gate the systemctl calls.

Copilot uses AI. Check for mistakes.
Comment thread src/rrdDynamic.c
#ifdef IARMBUS_SUPPORT
if (isDeepSleepAwakeEvent)
strncpy(msgDataString, paramString, msgDataStringSize);
strncpy(msgDataString, paramString, (msgDataStringSize - strlen(RDM_PKG_SUFFIX)));
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

This strncpy call can produce a non-null-terminated string when truncated, and the computed bound (msgDataStringSize - strlen(RDM_PKG_SUFFIX)) can underflow if msgDataStringSize is smaller than strlen(RDM_PKG_SUFFIX). Switch to snprintf (or ensure the bound is validated and always explicitly null-terminate msgDataString).

Suggested change
strncpy(msgDataString, paramString, (msgDataStringSize - strlen(RDM_PKG_SUFFIX)));
{
size_t paramLen = strlen(paramString);
size_t suffixLen = strlen(RDM_PKG_SUFFIX);
if (paramLen > suffixLen && msgDataStringSize > 0)
{
size_t baseLen = paramLen - suffixLen;
if (baseLen >= msgDataStringSize)
{
baseLen = msgDataStringSize - 1;
}
/* Copy paramString without the RDM_PKG_SUFFIX, ensuring null termination */
snprintf(msgDataString, msgDataStringSize, "%.*s", (int)baseLen, paramString);
}
else if (msgDataStringSize > 0)
{
msgDataString[0] = '\0';
}
}

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_archive.c
Comment on lines +95 to +108
if (name_len <= 100) {
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
} else if (name_len <= 255) {
/* split into prefix and name */
size_t prefix_len = name_len - 100 - 1; /* leave room for null */
if (prefix_len > sizeof(hdr.prefix)) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
strncpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len < sizeof(hdr.prefix) ? prefix_len : sizeof(hdr.prefix) - 1] = '\0';
strncpy(hdr.name, name + prefix_len + 1, sizeof(hdr.name) - 1);
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

USTAR prefix/name splitting must occur on a directory separator boundary (and prefix should contain the directory portion). Splitting purely by character count can generate invalid headers that some tar implementations won’t extract correctly. Split on the last '/' that keeps prefix <= 155 and name <= 100, and fail cleanly if no valid split exists.

Suggested change
if (name_len <= 100) {
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
} else if (name_len <= 255) {
/* split into prefix and name */
size_t prefix_len = name_len - 100 - 1; /* leave room for null */
if (prefix_len > sizeof(hdr.prefix)) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
strncpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len < sizeof(hdr.prefix) ? prefix_len : sizeof(hdr.prefix) - 1] = '\0';
strncpy(hdr.name, name + prefix_len + 1, sizeof(hdr.name) - 1);
if (name_len <= sizeof(hdr.name)) {
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
} else if (name_len <= 255) {
/* split into prefix and name on a directory separator boundary */
size_t prefix_len = 0;
const char *name_part = NULL;
/* search for the last '/' that yields a valid prefix and name */
for (size_t i = name_len; i > 0; --i) {
if (name[i - 1] == '/') {
size_t p_len = i - 1; /* directory portion, without trailing '/' */
size_t n_len = name_len - i; /* name portion after '/' */
if (p_len > 0 &&
p_len <= sizeof(hdr.prefix) &&
n_len > 0 &&
n_len <= sizeof(hdr.name)) {
prefix_len = p_len;
name_part = name + i;
break;
}
}
}
if (name_part == NULL) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
/* copy prefix (directory part) */
memcpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len] = '\0';
/* copy name (final path component) */
strncpy(hdr.name, name_part, sizeof(hdr.name) - 1);

Copilot uses AI. Check for mistakes.
madhubabutt and others added 4 commits February 25, 2026 15:11
This pull request addresses Coverity defects in the RDK Remote Debugger Device Management code, focusing on fixing memory leaks, buffer overflows, and resource handling issues.

Changes:

Added NULL checks for memory allocations (malloc, strdup, fread) with proper error handling and resource cleanup
Fixed buffer overflow vulnerabilities by using correct size parameters in strncpy/strncat operations
Corrected file pointer closure to only occur when pointers are valid (v_secure_pclose moved inside if blocks)
Fixed memory management issues with rfcbuf allocations and ownership





Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>
Remote Debugger 1.3.2 release
Copilot AI review requested due to automatic review settings March 20, 2026 19:00
Copy link
Copy Markdown
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 63 out of 63 changed files in this pull request and generated 11 comments.

Comment on lines +4 to +26
# Path to the existing JSON file
file_path = "/etc/rrd/remote_debugger.json"

# Read the existing JSON data
with open(file_path, "r") as json_file:
data = json.load(json_file)

# New entry to add
new_entry = {
"Test": {
"TestRun4": {
"Commands": "cat /version.txt;cat /tmp/.deviceDetails.cache",
"Timeout": 10
}
}
}

# Update the JSON data with the new entry
data.update(new_entry)

# Write the updated data back to the JSON file
with open(file_path, "w") as json_file:
json.dump(data, json_file, indent=4)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This test module performs file I/O and mutates /etc/rrd/remote_debugger.json at import time. Pytest will execute this on collection, which can make test runs order-dependent and can affect other tests (and local environments) even if these tests are skipped/xfail. Move this JSON read/update/write into a dedicated test/fixture (e.g., setup function) and ensure the original file contents are restored in teardown/finalizer.

Copilot uses AI. Check for mistakes.
Comment on lines +149 to +154
SCRIPT_SUCCESS = "Debug Information Report upload Failed"
SCRIPT_FAILURE = "Debug Information Report upload Success"
if SCRIPT_SUCCESS in grep_rrdlogs(SCRIPT_SUCCESS):
print("Script execution success")
elif SCRIPT_FAILURE in grep_rrdlogs(SCRIPT_FAILURE):
print("Script execution failed")
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

SCRIPT_SUCCESS / SCRIPT_FAILURE constants are swapped: SCRIPT_SUCCESS is set to the "...upload Failed" message and SCRIPT_FAILURE to the "...upload Success" message, and the printed status strings are inverted as well. This will report success on failure and vice versa. Swap the constants (or adjust the condition/print statements) so the labels match the expected log lines.

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +90
try:
result = subprocess.run(['bash', script_path], check=True, text=True, capture_output=True)
print("Script output:")
print(result.stdout)
except subprocess.CalledProcessError as e:
print("Error while executing the script:")
print(e.stderr)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The CalledProcessError from running create_json.sh is caught and only printed, so the test will continue and potentially pass even when the script fails. Re-raise the exception or fail the test (e.g., assert False) in the except block so environment setup failures are not silently ignored.

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_upload.c
Comment on lines +191 to +196
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Removing source directory: %s\n", __FUNCTION__, dir_path);

char cmd[1024];
snprintf(cmd, sizeof(cmd), "rm -rf %s", dir_path);

int ret = system(cmd);
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

rrd_upload_cleanup_source_dir builds an "rm -rf" shell command with an unquoted dir_path and executes it via system(). Since dir_path is derived from issue/category values that ultimately come from external input, this is vulnerable to command injection and also breaks paths containing spaces/shell metacharacters. Prefer a safe recursive delete using nftw()/unlinkat() (or, at minimum, execv("rm", {"rm","-rf","--",dir_path,...}) without invoking a shell).

Copilot uses AI. Check for mistakes.
Comment thread src/rrdRunCmdThread.c
Comment on lines +421 to +426
#if !defined(GTEST_ENABLE)
v_secure_system("systemctl stop %s", remoteDebuggerServiceStr);
v_secure_system("systemctl reset-failed %s", remoteDebuggerServiceStr);
free(cmdData->rfcvalue); // free rfcvalue received from RRDEventThreadFunc
free(cmdData->command); // free updated command info received from RRDEventThreadFunc
free(cmdData);
#endif
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

In the GTEST_ENABLE build, this block skips freeing cmdData->rfcvalue/cmdData->command/cmdData entirely, which introduces a leak in unit tests and makes behavior differ between test and production builds. Consider guarding only the systemctl calls with GTEST_ENABLE, but keep the memory cleanup outside the conditional.

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_archive.c
Comment on lines +95 to +109
if (name_len <= 100) {
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
} else if (name_len <= 255) {
/* split into prefix and name */
size_t prefix_len = name_len - 100 - 1; /* leave room for null */
if (prefix_len > sizeof(hdr.prefix)) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
strncpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len < sizeof(hdr.prefix) ? prefix_len : sizeof(hdr.prefix) - 1] = '\0';
strncpy(hdr.name, name + prefix_len + 1, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The ustar name/prefix split logic for paths 101–255 chars is incorrect: it splits at an arbitrary offset (name_len - 101) rather than at the last '/' boundary. This can produce invalid tar headers and lose path information. Split the path at the last '/' such that prefix <= 155 and name <= 100 per ustar rules, or reject names that can’t be represented correctly.

Suggested change
if (name_len <= 100) {
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
} else if (name_len <= 255) {
/* split into prefix and name */
size_t prefix_len = name_len - 100 - 1; /* leave room for null */
if (prefix_len > sizeof(hdr.prefix)) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
strncpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len < sizeof(hdr.prefix) ? prefix_len : sizeof(hdr.prefix) - 1] = '\0';
strncpy(hdr.name, name + prefix_len + 1, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
if (name_len <= sizeof(hdr.name)) {
/* simple case: whole path fits in name field */
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
} else if (name_len <= 255) {
/* split into prefix and name according to POSIX ustar rules:
* - prefix contains the directory path (no trailing '/')
* - name contains the final path component
* - both fields must fit in their respective header buffers
*/
size_t prefix_len = 0;
size_t name_part_len = 0;
int split_found = 0;
/* search for last '/' that yields valid prefix and name lengths */
for (size_t i = name_len; i > 0; --i) {
if (name[i - 1] == '/') {
prefix_len = i - 1; /* up to but not including this '/' */
name_part_len = name_len - i; /* after '/' to end */
if (prefix_len > 0 &&
prefix_len <= sizeof(hdr.prefix) &&
name_part_len > 0 &&
name_part_len <= sizeof(hdr.name)) {
split_found = 1;
break;
}
}
}
if (!split_found) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG,
"[%s] File name too long or invalid for ustar: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
/* copy prefix (directory path) */
memcpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len] = '\0';
/* copy final path component */
memcpy(hdr.name, name + prefix_len + 1, name_part_len);
hdr.name[name_part_len] = '\0';

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_upload.h
Comment on lines +37 to +45
int rrd_upload_execute(const char *log_server, const char *protocol, const char *http_link, const char *working_dir, const char *archive_filename, const char *source_dir);
int rrd_upload_check_lock(bool *is_locked);
int rrd_upload_wait_for_lock(int max_attempts, int wait_seconds);
int rrd_upload_invoke_logupload_api(const char *log_server, const char *protocol, const char *http_link, const char *archive_filename);
int rrd_upload_orchestrate(const char *upload_dir, const char *issue_type);
int rrd_upload_cleanup_files(const char *archive_path, const char *source_dir);
int rrd_upload_cleanup_source_dir(const char *dir_path);
void rrd_upload_cleanup(void);

Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

rrd_upload.h declares rrd_upload_invoke_logupload_api() and rrd_upload_cleanup(), but there are no implementations in the source tree. Since this header is installed as part of the public include set, this creates an API contract that will fail at link time for consumers. Either implement these functions or remove them from the public header until they exist.

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_log.h
Comment on lines +23 to +28
// Initialize rdklogger
int rrd_log_init(const char *debug_ini_file);

// Logging macro placeholder (replace with actual RDK_LOG macro)
#define LOG_UPLOADRRDLOGS "LOG.RDK.UPLOADRRDLOGS"

Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

rrd_log.h declares rrd_log_init(), but there is no implementation in the repository. If this is intended as a public API, it should be implemented; otherwise, remove the declaration to avoid unresolved symbol/link-time failures for any consumer that includes this installed header.

Copilot uses AI. Check for mistakes.
And the issue data node and sub-node should be found in the JSON file
And the directory should be created to store the executed output
And Sanity check to validate the commands should be executed
And Command output shopuld be added to the output file
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Typo in step text: "shopuld" should be "should".

Copilot uses AI. Check for mistakes.
And the issue data node and sub-node should be found in the JSON file
And the directory should be created to store the executed output
And Sanity check to validate the commands should be executed
And Command output shopuld be added to the output file
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Typo in step text: "shopuld" should be "should".

Copilot uses AI. Check for mistakes.
nhanasi and others added 2 commits April 10, 2026 14:32
* RDKEMW-16897: Add Agentic Support for the RRD

* Updated the instructions

---------

Co-authored-by: Hanasi <nhanas001c@cable.comcast.com>
…ile Data (#183)

* Update rrdInterface.h

Update rrdInterface.h

Update rrdInterface.c

Update rrdInterface.h

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Add helper functions for profile data processing

Added helper functions for profile data processing.

Update rrdInterface.c

Update rrdInterface.h

Update Client_Mock.h

Add mock implementations for RBusApiWrapper methods

Remove mock profile handler functions for GTEST

Removed mock implementations for profile handler functions when GTEST_ENABLE is defined.

Update Client_Mock.cpp

Update Client_Mock.h

Update rrdInterface.h

Update Makefile.am

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Create profileTestValid.json

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Create profileTestInvalid.json

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

fix: add NULL guard to has_direct_commands to prevent crash on NULL input

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c84bc9e8-e1d2-4412-81d4-54eb9c67be5f

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Create test.py

Convert run_l2.sh to Python with RDK tests

Refactor run_l2.sh to Python and implement RDK Remote Debugger tests.

L2

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

fix: correct set_rbus_response to use real rbus API signatures

rbusValue_Init() returns rbusValue_t (not rbusError_t) and
rbusValue_SetString() returns void in the real rbus library, so
capturing their return values as rbusError_t caused a build error.

- Remove incorrect return-value capture from rbusValue_Init and
  rbusValue_SetString; check rbusValue != NULL after init instead
- Add NULL guard for prop parameter
- Update RRDProfileHandlerTest SetUp() mock so rbusValue_Init actually
  sets *value to a non-null pointer, keeping SetRbusResponse_ValidInput
  test passing

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/e887c84a-2e12-4903-9d59-2bd6f90e2527

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdInterface.c

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

fix: resolve Coverity dead code and add NULL guard to get_all_categories_json

- read_profile_json_file: split combined NULL check into two separate
  checks (file_size first, then filename) so *file_size is safely
  zeroed before the filename check; eliminates the ternary
  'filename ? filename : "(null)"' and the Coverity dead-code report
- get_all_categories_json: add early NULL guard for json parameter
  that returns an empty JSON object string to prevent crash when
  callers (including unit tests) pass NULL

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c686520e-0adf-4e7e-9915-9b9e4e8a74fd

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

Update rrdInterface.c

Update rrdUnitTestRunner.cpp

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

Clean up comments in save_profile_category function

Removed comments explaining file opening flags.

RDKEMW-16897: Add Agentic Support for the RRD (#182)

* RDKEMW-16897: Add Agentic Support for the RRD

* Updated the instructions

---------

Co-authored-by: Hanasi <nhanas001c@cable.comcast.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Rename test.py to test_rrd_profile_data.py

rrd

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

* Update rrdInterface.c

* Update rrdUnitTestRunner.cpp
Copilot AI review requested due to automatic review settings April 23, 2026 14:20
Copy link
Copy Markdown
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 81 out of 81 changed files in this pull request and generated 5 comments.

Comment on lines +4 to +10
# Path to the existing JSON file
file_path = "/etc/rrd/remote_debugger.json"

# Read the existing JSON data
with open(file_path, "r") as json_file:
data = json.load(json_file)

Comment thread src/rrd_upload.c
Comment on lines +191 to +196
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Removing source directory: %s\n", __FUNCTION__, dir_path);

char cmd[1024];
snprintf(cmd, sizeof(cmd), "rm -rf %s", dir_path);

int ret = system(cmd);
Comment thread src/rrdIarmEvents.c
Comment on lines 155 to 165
rbusError_t rc = RBUS_ERROR_BUS_ERROR;
rbusValue_t value;
rbusValue_Init(&value);
rbusValue_SetString(value,"root");
rc = rbus_set(rrdRbusHandle, RRD_WEBCFG_FORCE_SYNC, value, NULL);
if (rc != RBUS_ERROR_SUCCESS)
#ifndef USE_L2_SUPPORT
if (rc != RBUS_ERROR_SUCCESS)
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: rbus_set failed for [%s] with error [%d]\n\n", __FUNCTION__, __LINE__,RRD_WEBCFG_FORCE_SYNC ,rc);
return;
}
Comment thread run_l2.sh
Comment on lines +33 to +34
echo "AA:BB:CC:DD:EE:FF" >> /tmp/.estb_mac

Comment thread cov_build.sh
Comment on lines +46 to +54
git clone https://github.com/rdkcentral/dcm-agent.git -b develop

cd dcm-agent
sh cov_build.sh
autoreconf -i
./configure
make && make install
cp uploadstblogs/include/*.h /usr/local/include
cd -
naveenkumarhanasi and others added 5 commits April 23, 2026 17:47
RRD release for static profile DML
Update rrdEventProcess.c

Update rrdExecuteScript.c

Refactor rrdEventProcess.h to rrdExecuteScript.h

Update rrdExecuteScript.h

Update rrdExecuteScript.h

Update rrdEventProcess.h

Update rrdExecuteScript.h

Update rrdJsonParser.c

Update rrdJsonParser.h

Update rrdInterface.c

Update rrdCommon.h

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Fix indentation for appendMode assignment

Update rrdCommon.h

Fix appendMode assignment in rrdEventProcess.c

Update rrdEventProcess.c

Update rrdJsonParser.c

Update rrdEventProcess.c

Update rrdExecuteScript.h

Update rrdExecuteScript.c

Update rrdExecuteScript.c

Update rrdExecuteScript.c

Remove redundant logging from rrdJsonParser

Update rrdJsonParser.c

Update rrdEventProcess.c

Update rrdJsonParser.c

Update rrdEventProcess.c

Update rrdJsonParser.c

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdJsonParser.c

Fix heap overflow in issueTypeSplitter and memory leaks in suffix handling

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/fbc52780-966b-4912-825f-3030aa43c3e9

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Delete .gitignore

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdUnitTestRunner.cpp

Update rrdEventProcess.c

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Add gtest test cases for split_issue_type

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Remove build artifacts, add .gitignore

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Add explicit truncated content assertion in SuffixTruncatedWhenTooSmall test

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdJsonParser.c

Update rrdJsonParser.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Delete .gitignore

Delete src/unittest/UTJson/device.properties

Update rrdEventProcess.c

Add gtest tests for split_issue_type, suffix field, and processIssueTypeEvent

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/76cad72a-f67f-4c05-8fb5-bfadf0c173b3

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Delete .gitignore

Validate suffix prefix: only _Search- and _LogSearch- are allowed

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/125526c2-7b70-48f5-8bec-fd725eea8a04

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Base never contains underscore: split at first _ and discard invalid suffix

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/904bf10d-546b-4038-a60c-9bc76094a225

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdEventProcess.c

Update rrdUnitTestRunner.cpp

Update rrdEventProcess.c

Update rrdEventProcess.c

Fix segfault in GTEST_ENABLE mode when rbuf->jsonPath is NULL

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Remove accidentally committed dummy directory and update .gitignore

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Fix IssueTypeSplitterTest to match new issueTypeSplitter behavior (no built-in special-char removal)

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/00abcaba-8a41-4b88-ae12-07b5ff780ff9

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Fix empty/whitespace IssueType bypassing processIssueTypeEvent guards

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/4de31e24-70d8-496c-ac6a-a5376771d936

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

fix: preserve hyphens in archive filename so portal can parse it correctly

rrd_logproc_convert_issue_type() was converting '-' to '_', turning the
suffix '_Search-67768-67' into '_SEARCH_67768_67'. This added extra '_'
separators into the archive filename that broke the analytics portal's
filename parser — it could no longer identify the timestamp field, so
download requests used an incorrect S3 key.

Fix: keep '-' as '-' in the sanitized output. The archive filename now
uses '_' to separate structural fields (MAC, issueType, timestamp) and
'-' within the UUID suffix, giving the portal a reliable delimiter.

Also increase issue_type_sanitized buffer in uploadRRDLogs.c from 64 to
256 bytes so a full UUID suffix never causes a silent truncation failure.

Before: 04B86A12F9F8_DEVICE_DEVICEIP_SEARCH_67768_67_<timestamp>_RRD_DEBUG_LOGS.tgz
After:  04B86A12F9F8_DEVICE_DEVICEIP_SEARCH-67768-67_<timestamp>_RRD_DEBUG_LOGS.tgz

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/981b6bc1-c9d2-4150-9e9d-851004942ffc

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

fix: replace _Search-/_LogSearch- prefix check with suffix length <= 9 rule

split_issue_type() now discards any suffix whose total length (including
the leading '_') exceeds 9 characters.  The old _Search-/_LogSearch-
prefix validation is removed entirely.

Rule:
  strlen(underscore) <= 9  → suffix accepted
  strlen(underscore)  > 9  → suffix discarded

This means:
  - Short session tokens (e.g. "_ab12345", 8 chars) are carried through
  - Long UUID-based suffixes like "_Search-b6877385-...) are discarded,
    preventing extra '_' delimiters from breaking the portal filename parser

Affected tests updated:
  - UnderscoreSplitsBaseAndSuffix : uses a short accepted suffix
  - MultipleUnderscoresSplitsAtFirst: "_def_ghi" (8 chars) now kept
  - BaseTruncatedWhenTooSmall / ExactFitBase: "_suffix" (7 chars) now kept
  - SuffixTruncatedWhenTooSmall: uses 9-char suffix with 5-byte buffer
  - OnlyUnderscoreInput: "_" (1 char) now kept
  - LogSearchSuffixIsValid → NineCharSuffixIsAccepted (boundary test)
  - SearchSuffixIsValid → LongSuffixIsDiscarded
  - InvalidSuffixPrefixDiscarded / SearchWithoutHyphenIsInvalid /
    LogSearchWithoutHyphenIsInvalid: updated comments (same outcomes)
  - ProcessIssueTypeEvntTest comments updated to reflect new rule

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

refactor: improve RRD_MAX_SUFFIX_LEN comment and rename length-based tests

- Expand the RRD_MAX_SUFFIX_LEN comment to explain why 9 chars is the limit
- Rename misleading test names that referenced old prefix-based validation:
    InvalidSuffixPrefixDiscarded → SuffixExceedingMaxLengthDiscarded
    SearchWithoutHyphenIsInvalid → SuffixSeventeenCharsDiscarded
    LogSearchWithoutHyphenIsInvalid → SuffixTwentyCharsDiscarded
- LongSuffixIsDiscarded: switch to a neutral _1234567890 example so the
  test does not imply any Search-specific behavior

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdJsonParser.c

Update uploadRRDLogs.c

Update uploadRRDLogs.c

Update rrdJsonParser.c

Delete .gitignore

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdJsonParser.c

Update rrdEventProcess.c

sanitize split_issue_type suffix to [A-Za-z0-9_-] to prevent injection

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/72e164ed-ae53-4076-8fb1-5ff1e21375e9

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdEventProcess.c

Delete .gitignore

Update rrdRunCmdThread.c

Update rrdRunCmdThread.h

Delete src/unittest/UTJson/device.properties

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdRunCmdThread.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
RDK-60236 : Remote Debugger Supports UUID Information in Debug Report File
Copilot AI review requested due to automatic review settings May 14, 2026 01:01
Copy link
Copy Markdown
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 83 out of 84 changed files in this pull request and generated 6 comments.

Comment thread src/rrdEventProcess.c
Comment on lines 112 to +147
@@ -88,24 +116,52 @@ void processIssueTypeEvent(data_buf *rbuf)
}
cmdBuff->appendMode = rbuf->appendMode;
cmdBuff->mdata = (char *)calloc(1, dataMsgLen);

/* Store suffix for this issue type */
cmdBuff->suffix = NULL;
if (local_suffix[0] != '\0') {
cmdBuff->suffix = strdup(local_suffix);
if (cmdBuff->suffix == NULL)
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Failed to allocate memory for suffix... \n", __FUNCTION__, __LINE__);
}
}
if (cmdBuff->mdata)
{
strncpy((char *)cmdBuff->mdata, cmdMap[index], dataMsgLen);
strncpy((char *)cmdBuff->mdata, base, dataMsgLen);
processIssueType(cmdBuff);
}
else
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Memory Allocation Failed... \n", __FUNCTION__, __LINE__);
}
free(cmdBuff);
if(cmdBuff)
{
if (cmdBuff->suffix)
{
free(cmdBuff->suffix);
cmdBuff->suffix = NULL;
}
free(cmdBuff);
cmdBuff = NULL;
}
Comment thread src/rrd_upload.c
Comment on lines +188 to +205
int rrd_upload_cleanup_source_dir(const char *dir_path) {
if (!dir_path) return -1;

RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Removing source directory: %s\n", __FUNCTION__, dir_path);

char cmd[1024];
snprintf(cmd, sizeof(cmd), "rm -rf %s", dir_path);

int ret = system(cmd);
if (ret == 0) {
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "%s: Successfully removed source directory: %s\n",
__FUNCTION__, dir_path);
return 0;
} else {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "%s: Failed to remove source directory: %s (ret: %d)\n",
__FUNCTION__, dir_path, ret);
return -1;
}
Comment thread src/rrdIarmEvents.c
Comment on lines 155 to +167
rbusError_t rc = RBUS_ERROR_BUS_ERROR;
rbusValue_t value;
rbusValue_Init(&value);
rbusValue_SetString(value,"root");
rc = rbus_set(rrdRbusHandle, RRD_WEBCFG_FORCE_SYNC, value, NULL);
if (rc != RBUS_ERROR_SUCCESS)
#ifndef USE_L2_SUPPORT
if (rc != RBUS_ERROR_SUCCESS)
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: rbus_set failed for [%s] with error [%d]\n\n", __FUNCTION__, __LINE__,RRD_WEBCFG_FORCE_SYNC ,rc);
return;
}
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
#else
#endif
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Invoking WebCfg Force Sync: %s... \n", __FUNCTION__, __LINE__, RRD_WEBCFG_FORCE_SYNC);
Comment thread remote_debugger.json
Comment on lines +42 to +67
},
"DeepSleep": {
"Audio" : {
"AudioStatus" : {
"Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump",
"Timeout" : 10
}
},
"Video" : {
"VideoStatus" : {
"Commands": "cat /sys/class/avsync_session0/session_stat;cat /sys/class/vdec/vdec_status;hal_dump",
"Timeout" : 10
}
},
"Process" : {
"ProcessStatus" : {
"Commands": "cat /opt/logs/top_log.txt*",
"Timeout" : 10
},
"ServiceStatus" : {
"Commands": "systemctl list-units --type=service --all",
"Timeout" : 10
}

}
}
Comment thread src/Makefile.am
Comment on lines +15 to +28
remotedebugger_SOURCES = rrdMain.c rrdEventProcess.c rrdJsonParser.c rrdRunCmdThread.c rrdCommandSanity.c rrdDynamic.c rrdExecuteScript.c rrdMsgPackDecoder.c rrdInterface.c
remotedebugger_CFLAGS = -I$(top_srcdir)/include/rrd -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/trower-base64/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rbus/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir} $(CJSON_CFLAGS)
AM_LDFLAGS="-lpthread -lrdkloggers -lmsgpackc -ltrower-base64 -lwebconfig_framework -lrbus -lsecure_wrapper "

remotedebugger_SOURCES = rrdMain.c rrdEventProcess.c rrdJsonParser.c rrdRunCmdThread.c rrdCommandSanity.c rrdDynamic.c rrdExecuteScript.c rrdMsgPackDecoder.c rrdInterface.c
remotedebugger_CFLAGS = -I$(top_srcdir)/include/rrd -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/trower-base64/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rbus/ $(CJSON_CFLAGS)
AM_LDFLAGS="-lpthread -lrdkloggers -lmsgpackc -ltrower-base64 -lwebconfig_framework -lrbus -lsecure_wrapper"
if IARMBUS_ENABLE
remotedebugger_SOURCES += rrdIarmEvents.c
remotedebugger_SOURCES += rrdIarmEvents.c uploadRRDLogs.c rrd_config.c rrd_sysinfo.c rrd_logproc.c rrd_archive.c rrd_upload.c
remotedebugger_CFLAGS += -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmbus/ -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmmgrs/rdmmgr -I$(PKG_CONFIG_SYSROOT_DIR)${includedir}/rdk/iarmmgrs-hal -DIARMBUS_SUPPORT
AM_LDFLAGS += "-lIARMBus -lrfcapi -ltr181api"
endif
remotedebugger_LDFLAGS = $(AM_LDFLAGS) $(CJSON_LDFLAGS) $(CJSON_LIBS) -fno-common
if IARMBUS_ENABLE
remotedebugger_LDFLAGS += -luploadstblogs
remotedebugger_LDADD = -lfwutils -lz -luploadstblogs
endif
Comment thread configure.ac
yes) L2_SUPPORT_ENABLE=true
L2_SUPPORT_FLAG="-DUSE_L2_SUPPORT"
m4_if(m4_sysval,[0],[SUBDIRS_L2_SUPPORT="src"]) ;;
no) L2_SUPPORT_ENABLE=false AC_MSG_ERROR([L2_SUPPORT is disabled]) ;;
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.