Skip to content

Add overhead count in heap stats #7917

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

Merged
merged 1 commit into from
Oct 5, 2018

Conversation

deepikabhavnani
Copy link

@deepikabhavnani 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
Copy link
Author

Resolves: #7343

@deepikabhavnani
Copy link
Author

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
Copy link
Author

Updated overhead_size element to include the stats and allocator overhead.

@deepikabhavnani deepikabhavnani force-pushed the heap_overhead branch 2 times, most recently from bc105d5 to 70feb50 Compare September 5, 2018 21:31
@deepikabhavnani deepikabhavnani force-pushed the heap_overhead branch 2 times, most recently from bd9f02c to 2612aba Compare September 10, 2018 14:43
@deepikabhavnani
Copy link
Author

deepikabhavnani commented Sep 12, 2018

@c1728p9 @SeppoTakalo - Please review


typedef struct {
size_t size;
}mbed_heap_overhead_t;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which from Mbed OS point of view is "all"

Thanks..

@cmonr
Copy link
Contributor

cmonr commented Sep 29, 2018

/morph build

@mbed-ci
Copy link

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
Copy link

mbed-ci commented Sep 29, 2018

@mbed-ci
Copy link

mbed-ci commented Sep 29, 2018

@0xc0170
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

0xc0170 commented Oct 2, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Oct 2, 2018

@deepikabhavnani
Copy link
Author

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
Copy link
Contributor

0xc0170 commented Oct 2, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Oct 3, 2018

@NirSonnenschein
Copy link
Contributor

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 --

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
Copy link
Author

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
Copy link
Contributor

0xc0170 commented Oct 4, 2018

/morph build

@deepikabhavnani
Copy link
Author

/morph build

@mbed-ci
Copy link

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
Copy link

mbed-ci commented Oct 5, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 5, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Oct 5, 2018

@0xc0170 0xc0170 merged commit 8adb8c3 into ARMmbed:master Oct 5, 2018
@deepikabhavnani deepikabhavnani deleted the heap_overhead branch October 5, 2018 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants