-
Notifications
You must be signed in to change notification settings - Fork 576
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
Common Log (In Progress) #6338
base: master
Are you sure you want to change the base?
Common Log (In Progress) #6338
Conversation
Do we need these commits to merge into |
"Potential memory leak :", //CMN_LOG_MEM_LEAK, | ||
"Buffer overflow detected :", //CMN_LOG_BUFFER_OVERFLOW, |
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.
Oops, is it possible to check in code?
static const char* clog_message_str[CMN_LOG_MSG_MAX] = | ||
{ | ||
/* Memory Operations */ | ||
"Memory allocation failed :", //CMN_LOG_ALLOC_FAIL, |
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.
Why all has : at the end? Every message has additional message after this?
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.
Yes, we have messages at some places.
1deca23
to
1e44cb1
Compare
3ef52c8
to
76acdf3
Compare
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.
Please check the conflicts and rebase the PR accordingly.
5d1d435
to
334fb2b
Compare
e8f0207
to
c536712
Compare
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.
Commit description should have detailed information about the changes & why we did it.
c536712
to
3c23105
Compare
3c23105
to
d52a7f8
Compare
"End of", //CMN_LOG_END, | ||
"Invalid data in", //CMN_LOG_INVALID_DATA, | ||
"Valid data in :" //CMN_LOG_VALID_DATA, | ||
"Not supported", // CMN_LOG_NOT_SUPPORTED |
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.
Fix indentation of all the above lines.
static const char* clog_message_str[CMN_LOG_MSG_MAX] = | ||
{ | ||
/* Memory Operations */ | ||
"Memory allocation failure", //CMN_LOG_ALLOC_FAIL, |
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.
Change failure
to failed
in all log msgs.
|
||
/* Network Operations */ | ||
"Connection Timeout", //CMN_LOG_CON_TIMEOUT, | ||
"Connection Refuse", //CMN_LOG_CON_REFUSED, |
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.
Refuse -> refused
"IOCTL call failure", //CMN_LOG_FILE_IOCTL_ERROR, | ||
|
||
/* Network Operations */ | ||
"Connection Timeout", //CMN_LOG_CON_TIMEOUT, |
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.
Why using capital letter for all words in some log msgs? Pls make it same as other msgs. Use capital letter only for first word.
@@ -1300,7 +1301,7 @@ FAR void *video_register(const char *devpath, FAR struct video_lowerhalf_s *dev) | |||
|
|||
priv = (FAR video_upperhalf_t *)kmm_malloc(sizeof(video_upperhalf_t)); | |||
if (!priv) { | |||
videodbg("Failed to allocate instance\n"); | |||
videodbg("%s instance\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); |
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.
%s for instance
@@ -360,7 +361,7 @@ static int btnull_send(FAR const struct bt_driver_s *dev, FAR struct bt_buf_s *b | |||
|
|||
outbuf = bt_buf_alloc(BT_EVT, NULL, 0); | |||
if (outbuf == NULL) { | |||
ndbg("ERROR: Failed to allocate buffer\n"); | |||
ndbg("%s: bt_buf_alloc\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); |
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.
Remove : bt_buf_alloc
@@ -610,7 +611,7 @@ int up_fbinitialize(int display) | |||
|
|||
priv->fbmem = (FAR uint8_t *)kmm_zalloc(priv->fblen); | |||
if (priv->fbmem == NULL) { | |||
gdbg("ERROR: Failed to allocate frame buffer memory\n"); | |||
gdbg("%s frame buffer\n", clog_message_str[CMN_LOG_ALLOC_FAIL]); |
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.
for frame buffer
DEBUGASSERT((unsigned)display < UINT8_MAX); | ||
|
||
/* Allocate the framebuffer state structure */ | ||
|
||
priv = (FAR struct lcdfb_dev_s *)kmm_zalloc(sizeof(struct lcdfb_dev_s)); | ||
if (priv == NULL) { | ||
gdbg("ERROR: Failed to allocate state structure\n"); | ||
gdbg("%s state structure \n", clog_message_str[CMN_LOG_ALLOC_FAIL]); |
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.
for state structure
Make changes in the debug log messages with the common messages
d52a7f8
to
f4fb92d
Compare
/* Memory Operations */ | ||
"Memory allocation failure", //CMN_LOG_ALLOC_FAIL, | ||
"Null pointer", //CMN_LOG_NULL_CHECK_FAIL, | ||
"Potential memory leak", //CMN_LOG_MEM_LEAK, |
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.
comments can be indented
Make changes in Debug log statements to reduce the binary size