Skip to content

Add heap note support#13847

Merged
xiaoxiang781216 merged 10 commits into
apache:masterfrom
XuNeo:mm-sched-note
Oct 7, 2024
Merged

Add heap note support#13847
xiaoxiang781216 merged 10 commits into
apache:masterfrom
XuNeo:mm-sched-note

Conversation

@XuNeo

@XuNeo XuNeo commented Oct 6, 2024

Copy link
Copy Markdown
Contributor

Summary

This patch series introduces support for retrieving note information related to heap operations, such as region add/remove and malloc/free activities. Additionally, Segger SysView has been upgraded to version V3.5.6, which now includes the Data Plot feature. This new feature enables real-time visualization of heap memory usage.

Impact

New feature added. Should have no impact on existing projects.

Testing

This PR is tested with configuration tools/configure.sh stm32f429i-disco:systemview

image

@github-actions github-actions Bot added Area: Tooling Arch: simulator Issues related to the SIMulator Area: Board support Board support issues Area: Memory Management Memory Management issues Area: OS Components OS Components issues Size: M The size of the change in this PR is medium labels Oct 6, 2024
@acassis

acassis commented Oct 6, 2024

Copy link
Copy Markdown
Contributor

@XuNeo please update the Documentation/ and include this image

@github-actions github-actions Bot added the Area: Documentation Improvements or additions to documentation label Oct 6, 2024
@XuNeo XuNeo force-pushed the mm-sched-note branch 2 times, most recently from 1a43e9d to 100afc1 Compare October 6, 2024 16:01
Comment thread arch/sim/src/sim/sim_heap.c Outdated
Comment thread drivers/note/note_driver.c Outdated
lion2tomato and others added 3 commits October 7, 2024 11:51
Signed-off-by: lijianjun <lijianjun@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Record all memory allocation and release, save to ram, used to analyze memory allocation rate and memory usage
Its absolute value is not trustworthy because the memory will be allocated in thread A and released in thread B

 netinit-5   [0]   0.105984392: tracing_mark_write: C|5|Heap Usage|96|free: heap: 0x606000000020 size:24, address: 0x603000000370
 netinit-5   [0]   0.105996874: tracing_mark_write: C|5|Heap Usage|24|free: heap: 0x606000000020 size:72, address: 0x6070000008e0
nsh_main-4   [0]   3.825169408: tracing_mark_write: C|4|Heap Usage|2177665|free: heap: 0x606000000020 size:424, address: 0x614000000840
nsh_main-4   [0]   3.825228525: tracing_mark_write: C|4|Heap Usage|14977|free: heap: 0x606000000020 size:2162688, address: 0x7f80a639f800
nsh_main-4   [0]   3.825298789: tracing_mark_write: C|4|Heap Usage|15189|malloc: heap: 0x606000000020 size:20, address: 0x6030000003a0

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
XuNeo and others added 7 commits October 7, 2024 14:12
1. Add NOTE_HEAP_ prefix for heap note event.
2. Use note type as heap instrumentation parameter.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
From V3.5.6 on, data plot is supported.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Add heap current used to note.
Plot it in segger sysview data plot.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
@xiaoxiang781216 xiaoxiang781216 merged commit 0ba4d2c into apache:master Oct 7, 2024
@XuNeo XuNeo deleted the mm-sched-note branch October 8, 2024 07:50
simbit18 added a commit to simbit18/nuttx that referenced this pull request Jun 25, 2025
Segger SysView has been upgraded to version V3.5.6
apache#13847

Signed-off-by: simbit18 <simbit18@gmail.com>
xiaoxiang781216 pushed a commit that referenced this pull request Jun 25, 2025
Segger SysView has been upgraded to version V3.5.6
#13847

Signed-off-by: simbit18 <simbit18@gmail.com>
jerpelea pushed a commit to jerpelea/nuttx that referenced this pull request Jun 27, 2025
Segger SysView has been upgraded to version V3.5.6
apache#13847

Signed-off-by: simbit18 <simbit18@gmail.com>
xiaoxiang781216 pushed a commit that referenced this pull request Jun 27, 2025
Segger SysView has been upgraded to version V3.5.6
#13847

Signed-off-by: simbit18 <simbit18@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: simulator Issues related to the SIMulator Area: Board support Board support issues Area: Documentation Improvements or additions to documentation Area: Memory Management Memory Management issues Area: OS Components OS Components issues Area: Tooling Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants