-
Notifications
You must be signed in to change notification settings - Fork 8
RDKEMW-14300 : Removed Log truncation & added testApp to measure CPU #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1c54cb4
c33ca96
04bce03
7c067ad
f022013
d89b523
a3d3a69
1d7789d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,20 +1,23 @@ | ||||||||||||||||||||||
| <log4c> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <config> | ||||||||||||||||||||||
|
||||||||||||||||||||||
| <config> | |
| <config> | |
| <!-- | |
| NOTE: bufsize=0 causes log4c to dynamically allocate the message buffer | |
| for each log entry instead of using a fixed-size buffer. This avoids | |
| LOG4C_MSG_BUFFER_SIZE-based truncation but can introduce additional | |
| allocation overhead, especially under high-frequency logging. | |
| This trade-off is intentional; adjust bufsize to a non-zero value | |
| if fixed-size buffering and reduced allocation cost are preferred. | |
| --> |
Copilot
AI
Feb 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting bufsize to 0 in the log4c configuration means the buffer will dynamically grow as needed via realloc. However, there's a critical bug in the realloc implementation at src/rdk_debug_priv.c:778 where the return value is not checked for NULL. This configuration change makes the memory allocation failure path more likely to be hit with large log messages. The realloc bug must be fixed before this configuration change can be safely deployed.
| <bufsize>0</bufsize> | |
| <bufsize>2048</bufsize> |
Copilot
AI
Feb 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes modify default logging behavior (root category now uses rdk_console instead of rdk_syslog; console/syslog layouts changed). This is potentially breaking for consumers relying on previous defaults, and it isn’t mentioned in the PR description. Please confirm it’s intended and document the behavior change (or preserve existing defaults).
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,9 +46,12 @@ void rdk_logger_msg_printf(rdk_LogLevel level, const char *module, const char *f | |
| { | ||
| va_list args; | ||
|
|
||
| va_start(args, format); | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
| va_end(args); | ||
| if ((!format) && (!module)) | ||
| { | ||
| va_start(args, format); | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
| va_end(args); | ||
| } | ||
|
Comment on lines
+49
to
+54
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -63,19 +66,24 @@ void rdk_dbg_MsgRaw(rdk_LogLevel level, const char *module, const char *format, | |
| { | ||
| va_list args; | ||
|
|
||
| va_start(args, format); | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
| va_end(args); | ||
| if ((!format) && (!module)) | ||
| { | ||
| va_start(args, format); | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
| va_end(args); | ||
| } | ||
|
Comment on lines
+69
to
+74
|
||
| } | ||
|
|
||
| void rdk_logger_msg_vsprintf(rdk_LogLevel level, const char *module, const char *format, va_list args) | ||
| { | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
| if ((!format) && (!module)) | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
|
Comment on lines
+79
to
+80
|
||
| } | ||
|
|
||
| void rdk_dbg_MsgRaw1(rdk_LogLevel level, const char *module, const char *format, va_list args) | ||
| { | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
| if ((!format) && (!module)) | ||
| rdk_dbg_priv_log_msg(level, module, format, args); | ||
|
Comment on lines
+85
to
+86
|
||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.