-
Notifications
You must be signed in to change notification settings - Fork 3k
Refactor socket stats to reduce boiler plate #9959
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
Refactor socket stats to reduce boiler plate #9959
Conversation
@michalpasztamobica, thank you for your changes. |
@michalpasztamobica Please take a look at and address the Travis CI astyle issues. |
1007c87
to
0e6dfe8
Compare
Travis issues fixed. |
“bioler” = “boiler” as in “boiler template” |
Or... boilerplate Not boiler template.. |
CI started |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
Please take a look at the failued build
|
I compared build output with these changes:
And without them:
I guess this is a small change that makes a big difference... I also checked what GCC returns and it occupies much more memory with no complains:
I also checked that DISCO_L475VG_IOT01A has 1 MB of flash and 128 kB of SRAM, while this code claims to occupy ~262kB of Flash and ~24 kB of SRAM... Perhaps the issue is not with the code size, but with linker configuration.... |
Memory map indicates, that we have exceeded the SRAM1, larger, 96 kB RAM region :
SRAM1 holds:
With this PR the HEAP size has been increased to 0x17000 (94208 kB), which means that SRAM1 has exactly 3839 kB to hold the readwrite.
Considering that hard-coded heap occupies almost the whole SRAM1 region, I think the latter seems particularly reasonable. @SeppoTakalo, do you have any thoughts on this? |
Add a proper test case setup and teardown which does the socket stats checks in tcp, udp and tls.
0e6dfe8
to
b7ed4b5
Compare
Understanding the root cause I applied a workaround in our code base, by making the |
@michalpasztamobica Thank you for the analysis of the failure. I'm a bit concerned that part of the fix involves decreasing the heap, since #9588 seems to be fixing something important:
Would like to hear from @SeppoTakalo when he has a chance, but also from @naveenkaje/@linlingao about the possible fix. |
@cmonr , sorry, perhaps I put too much information into the comments... in the end I used a workaround which just moved one of the structures into readonly memory part by adding a I would still welcome a comment from @SeppoTakalo , as we are clearly coming close to the limits of memory on this chip and it is mainly due to the large static heap... |
Whoops! Thanks for clarifying that. |
If noone has anything to add regarding the heap size, then I think it should be fine to merge this PR. |
starting CI |
Test run: FAILEDSummary: 1 of 6 test jobs failed Failed test jobs:
|
The failures are:
I only refactored socket tests. I think the failure is unrelated. |
This is both hilarious and worrisome. |
CI job restarted: Failures did not appear related to PR. |
Tests are green now (were restarted) |
Description
Add a proper test case setup and teardown which does the socket stats checks in tcp, udp and tls.
Pull request type
Reviewers
@SeppoTakalo
@VeijoPesonen
@KariHaapalehto