-
Notifications
You must be signed in to change notification settings - Fork 3k
Disable printf in crash reporting for release builds #9164
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
Conversation
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.
LGTM
Out of curiosity, how was this error/issue discovered? Is there something we can reference as being fixed? If the resulting compiled files change significantly with this (for the better), can the before/after results be shared? |
Woop, never mind. Saw the email. |
Isn't Ah, no, it goes via You may as well do the same thing here, even though you don't need the exception-safe - use |
Ah, the title of the PR confused me. That test isn't checking for "debug builds only". NDEBUG is set for develop and debug builds, and off only for release builds. |
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.
Title needs correction - crash reporting remains enabled for develop builds. Suggest saying you're disabling it for release builds.
@@ -211,7 +211,9 @@ mbed_error_status_t mbed_error_initialize(void) | |||
if ((report_error_ctx->crc_error_ctx == crc_val) && (report_error_ctx->is_error_processed == 0)) { | |||
is_reboot_error_valid = true; | |||
//Report the error info | |||
#ifndef NDEBUG |
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.
It would make sense for this to use mbed_error_printf
, so you're definitely not pulling in anything extra beyond the existing error prints.
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 are the only 2 printf in this file,
I updated the title as requested |
Commit message still needs the same change. |
97bea7f
to
daa8b0e
Compare
@SenRamakri Do you have any thoughts on #9164 (comment)? |
@cmonr - We are not able to use mbed_error_printf() that early in boot due to how IAR retargeting layer is implemented. Please see my previous comment here as well - #8702 (comment) |
Thanks @SenRamakri for the link to the past explanation. @kjbracey-arm thoughts? Looks like the printfs might be the best we can do for now. |
CI started (restarted also Travis job) |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
The current implementation of crash reporting uses printf() to print some debug messages to terminal during boot up. This is pulling in printf() dependencies which is potentially causing ~7k increase in ROM size for GCC ARM. This change wraps it for debug builds only so release builds doesn't increase in size for applications not using printf() otherwise. Interestingly other toolchains(IAR, ARMC) is not impacted by this.
Pull request type