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

Add overhead count in heap stats #7917

Merged
merged 1 commit into from Oct 5, 2018

Conversation

Projects
None yet
8 participants
@deepikabhavnani
Contributor

deepikabhavnani commented Aug 28, 2018

Description

Heap statistics are used for analyzing heap stats, but it doesn't tell anything about real heap usage or malloc overheads. Adding overhead_size element will help users to get the real heap usage.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change
@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 30, 2018

Resolves: #7343

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Aug 31, 2018

Needs work: Remove the overhead from mbed-os, we can use the allocator information to get the actual heap sizes.

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Sep 5, 2018

Updated overhead_size element to include the stats and allocator overhead.

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:heap_overhead branch 2 times, most recently from bc105d5 to 70feb50 Sep 5, 2018

@deepikabhavnani deepikabhavnani requested a review from SeppoTakalo Sep 5, 2018

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:heap_overhead branch 2 times, most recently from bd9f02c to 2612aba Sep 10, 2018

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Sep 12, 2018

@c1728p9 @SeppoTakalo - Please review

typedef struct {
size_t size;
}mbed_heap_overhead_t;

This comment has been minimized.

@SeppoTakalo

SeppoTakalo Sep 13, 2018

Contributor

Does this apply to all allocators or just one particular library? dlmalloc based?

This comment has been minimized.

@deepikabhavnani

deepikabhavnani Sep 13, 2018

Contributor

Does not apply to all allocators. But tested with dlmalloc and all three tool chains

This comment has been minimized.

@SeppoTakalo

SeppoTakalo Sep 14, 2018

Contributor

Which from Mbed OS point of view is "all"

Thanks..

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Sep 21, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Sep 29, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Sep 29, 2018

Build : SUCCESS

Build number : 3190
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7917/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr added ready for merge and removed needs: CI labels Sep 29, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 1, 2018

We need to restart the tests (reports success but there is a hard fault in one of the tests), will restart

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Oct 1, 2018

tagging with do not merge so that I don't merge it in the current "passed testing" state. @0xc0170 please remove the "do not merge" when you restart testing.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 2, 2018

/morph test

@mbed-ci

This comment has been minimized.

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Oct 2, 2018

We need to restart the tests (reports success but there is a hard fault in one of the tests), will restart

hey,curious to know how hardfault was discovered? I was not able to find and to be true didn;t go through logs of each and every test.

@theotherjimmy

Test was restarted and says success again, but would like to cross check for the same hardfault.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 2, 2018

/morph test

@mbed-ci

This comment has been minimized.

@NirSonnenschein

This comment has been minimized.

Contributor

NirSonnenschein commented Oct 3, 2018

still looks like a hard fault in LPC546XX,ARM (although tests report a pass):

logs:
21:09:40 [1538532634.70][CONN][RXD]
21:09:40 [1538532634.70][CONN][RXD] >>> Running case #18: 'test_remove_event_tail'...
21:09:40 [1538532634.80][CONN][RXD]
21:09:40 [1538532634.80][CONN][RXD] ++ MbedOS Fault Handler ++
21:09:40 [1538532634.80][CONN][RXD]
21:09:40 [1538532634.80][CONN][RXD] FaultType: HardFault
21:09:40 [1538532634.80][CONN][RXD]
21:09:40 [1538532634.80][CONN][RXD] Context:
21:09:40 [1538532634.80][CONN][INF] found KV pair in stream: {{__testcase_start;test_remove_event_tail}}, queued...
21:09:40 [1538532634.90][CONN][RXD] R0 : 00000007
21:09:40 [1538532634.90][CONN][RXD] R1 : 00000000
21:09:40 [1538532634.90][CONN][RXD] R2 : 00000007
21:09:40 [1538532634.90][CONN][RXD] R3 : 00000000
21:09:40 [1538532634.90][CONN][RXD] R4 : 00000000
21:09:40 [1538532634.90][CONN][RXD] R5 : 00000007
21:09:40 [1538532635.00][CONN][RXD] R6 : 00000007
21:09:40 [1538532635.00][CONN][RXD] R7 : 200025B8
21:09:40 [1538532635.00][CONN][RXD] R8 : 00000000
21:09:40 [1538532635.00][CONN][RXD] R9 : 20002548
21:09:40 [1538532635.00][CONN][RXD] R10 : 00000094
21:09:40 [1538532635.00][CONN][RXD] R11 : 20000F28
21:09:40 [1538532635.10][CONN][RXD] R12 : 00000000
21:09:40 [1538532635.10][CONN][RXD] SP : 200024F0
21:09:40 [1538532635.10][CONN][RXD] LR : 00006FFB
21:09:40 [1538532635.10][CONN][RXD] PC : FFF85780
21:09:40 [1538532635.10][CONN][RXD] xPSR : 41000000
21:09:40 [1538532635.10][CONN][RXD] PSP : 20002488
21:09:40 [1538532635.20][CONN][RXD] MSP : 20027FD8
21:09:40 [1538532635.20][CONN][RXD] CPUID: 410FC241
21:09:40 [1538532635.20][CONN][RXD] HFSR : 40000000
21:09:40 [1538532635.20][CONN][RXD] MMFSR: 00000001
21:09:40 [1538532635.20][CONN][RXD] BFSR : 00000000
21:09:40 [1538532635.20][CONN][RXD] UFSR : 00000000
21:09:40 [1538532635.30][CONN][RXD] DFSR : 00000008
21:09:40 [1538532635.30][CONN][RXD] AFSR : 00000000
21:09:40 [1538532635.30][CONN][RXD] Mode : Thread
21:09:40 [1538532635.30][CONN][RXD] Priv : Privileged
21:09:40 [1538532635.30][CONN][RXD] Stack: PSP
21:09:40 [1538532635.30][CONN][RXD]
21:09:40 [1538532635.40][CONN][RXD] -- MbedOS Fault Handler --
21:09:40 [1538532635.41][CONN][RXD]
21:09:40 [1538532635.41][CONN][RXD]
21:09:40 [1538532635.41][CONN][RXD]
21:09:40 [1538532635.41][CONN][RXD] ++ MbedOS Error Info ++
21:09:40 [1538532635.41][CONN][RXD] Error Status: 0x80FF013D Code: 317 Module: 255
21:09:40 [1538532635.50][CONN][RXD] Error Message: Fault exception
21:09:40 [1538532635.50][CONN][RXD] Location: 0xC8C9
21:09:40 [1538532635.50][CONN][RXD] Error Value: 0xFFF85780
21:09:41 [1538532635.60][CONN][RXD] Current Thread: Id: 0x20002688 Entry: 0xCAC1 StackSize: 0x1000 StackMem: 0x20001688 SP: 0x20027F90
21:09:41 [1538532635.71][CONN][RXD] For more info, visit: https://armmbed.github.io/mbedos-error/?error=0x80FF013D
21:09:41 [1538532635.71][CONN][RXD] -- MbedOS Error Info --

Add `overhead_size` element to get the overhead of stats
Heap statistics are used for analysing heap stats, but it doesn't tell anything
about real heap usage or malloc overheads. Adding `overhead_size` element
will help users to get the real heap usage.

@deepikabhavnani deepikabhavnani force-pushed the deepikabhavnani:heap_overhead branch from 2612aba to 5f58828 Oct 3, 2018

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Oct 3, 2018

Issue might be related to ARMmbed/DAPLink#504.

Rebased and verified test locally, no error for LPC546xx Eval board with latest daplink (with above fix). The PR is merged but not released. Daplink firmware should be updated on LPC546xx devices in CI.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 4, 2018

/morph build

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Oct 4, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 4, 2018

Build : SUCCESS

Build number : 3236
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7917/

Triggering tests

/morph test
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 5, 2018

/morph export-build

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Oct 5, 2018

@0xc0170 0xc0170 merged commit 8adb8c3 into ARMmbed:master Oct 5, 2018

14 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0 bytes) RAM(+8 bytes)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Passed, 628 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9967 cycles (-245 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@0xc0170 0xc0170 removed the ready for merge label Oct 5, 2018

@deepikabhavnani deepikabhavnani deleted the deepikabhavnani:heap_overhead branch Oct 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment