Skip to content
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

Optimize debug profile flags for size #11126

Merged
merged 3 commits into from Aug 15, 2019

Conversation

@teetak01
Copy link
Contributor

commented Jul 30, 2019

Description

Adjusts the debug profile to use similar size-optimized configurations.

This allows to compile also larger applications with debug profile. Especially on ROM constrained devices, it often is not possible to use the current speed-optimized profiles.

For example: device management client example with Thread stack (K64F + Thread + GCC)

With default GCC profile => does not fit.
With optimized GCC profile =>

16:01:13 Total Static RAM memory (data + bss): 70300(+70300) bytes
16:01:13 Total Flash memory (text + data): 657209(+657209) bytes

With Wisun stack this saves -321 KiB ROM.

This is similar to changes done for develop profile in #10813

Previously Client has been maintaining its own size-optimized compiler profiles as part of its delivery. It would be better for client to drop those, and Mbed OS to adopt more size-optimized profiles. (https://github.com/ARMmbed/mbed-cloud-client-example/tree/master/profiles).

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@TeroJaasko @kjbracey-arm @bulislaw

Release Notes

Changed the Debug compiler profile to favor size optimization over speed optimization.

teetak01 added 2 commits Jul 30, 2019
Total Static RAM memory (data + bss): 71179(+0) bytes
Total Flash memory (text + data): 665394(-44680) bytes
@ciarmcom ciarmcom requested review from bulislaw, kjbracey-arm, TeroJaasko and ARMmbed/mbed-os-maintainers Jul 30, 2019
@ciarmcom

This comment has been minimized.

Copy link
Member

commented Jul 30, 2019

@@ -5,7 +5,7 @@
"-fmessage-length=0", "-fno-exceptions",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD", "-fno-delete-null-pointer-checks",
"-fomit-frame-pointer", "-O0", "-g3", "-DMBED_DEBUG",
"-fomit-frame-pointer", "-O1", "-g3", "-DMBED_DEBUG",

This comment has been minimized.

Copy link
@pan-

pan- Jul 30, 2019

Member

-Og is what you're looking for.

This comment has been minimized.

Copy link
@teetak01

teetak01 Jul 31, 2019

Author Contributor

Thanks @pan- that makes more sense. I changed it to -Og. It only increased the ROM by about 4 kB vs. -O1.

This brings massive ROM savings, and allows to use debug builds
also with larger applications (for. ex. Mesh stack).

Diff. for mbed-cloud-client-example with Wi-Sun stack.

Total Static RAM memory (data + bss): 85120(-216) bytes
Total Flash memory (text + data): 592668(-329296) bytes
Copy link
Member

left a comment

Looks good for minor release. Can we make sure it doesn't influence full test run results.

@0xc0170 0xc0170 requested a review from pan- Aug 8, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

commented Aug 8, 2019

This needs more approvals.

Previously Client has been maintaining its own size-optimized compiler profiles as part of its delivery. It would be better for client to drop those, and Mbed OS to adopt more size-optimized profiles.

💯

@0xc0170
0xc0170 approved these changes Aug 8, 2019
Copy link
Member

left a comment

We've been around this for some time, +1 for the alignment with the client.

Copy link
Contributor

left a comment

Tentative approval, as I'm not really a fan of -Og.

In practice I've found it to be not as good as advertised. But then, that was with older versions of GCC. Maybe it's improved. And I guess there's nothing stopping anyone from tweaking it to -O0 locally if they need to.

@0xc0170

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

commented Aug 12, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter
@0xc0170

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

Tracking issue for exporters failure: #11209

@0xc0170

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

commented Aug 14, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@adbridge adbridge added ready for merge and removed needs: CI labels Aug 15, 2019
@adbridge adbridge merged commit 3ede2a9 into ARMmbed:master Aug 15, 2019
27 checks passed
27 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/jenkins/pr-merge Manually fixed status
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8713 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
@teetak01 teetak01 deleted the teetak01:optimize-debug-profile branch Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.