nuttxgdb memory commands performance optimization#14916
Merged
xiaoxiang781216 merged 10 commits intoapache:masterfrom Nov 24, 2024
Merged
nuttxgdb memory commands performance optimization#14916xiaoxiang781216 merged 10 commits intoapache:masterfrom
xiaoxiang781216 merged 10 commits intoapache:masterfrom
Conversation
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
xiaoxiang781216
approved these changes
Nov 23, 2024
acassis
approved these changes
Nov 23, 2024
Contributor
|
@XuNeo please include Documentation/ for this new tools/scripts |
305dffc to
8626b2b
Compare
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Tested on a complex project, results are promising.
Command Time cost(s) Time saving(s) Peformance Boost
Before After
memleak 39.494172 22.366415 17.127757 1.8
memdump 41.872441 26.458386 15.414055 1.6
memdump -a 0x1234 28.116294 1.114119 27.002175 25.2
memdump --no-backtrace N/A 1.114119
memmap 7.973809 6.836468 1.137341 1.2
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This will make it easier to debug memory corruption when agacent node is corrupted. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Make the dump_nodes etc more common to use. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
igned-off-by: xuxingliang <xuxingliang@xiaomi.com>
This is useful to exclude memory nodes for mempool.
E.g.
(gdb) mm dump --nob --top 5 --sort size --nop --no-pid -1
Pool CNT PID Size Overhead Seqno Address Backtrace
H 1 0 16777264 44 13 0x41a79010
H 2 160 1536048 44 1129827490 0x41d6aad0
H 1 45374 1536176 44 1129829080 0x45ef1010
H 3 141 408440 44 145817 0x43905bf0
H 7 158 131120 44 32955 0x4308d090
Total 14 blks, 23528696 bytes
(gdb) mm dump --nob --top 5 --sort size --nop
Pool CNT PID Size Overhead Seqno Address Backtrace
H 1 0 16777264 44 13 0x41a79010
* H 6 -1 1048640 44 116954 0x436a0fd0
* H 5 -1 1048640 44 146821 0x43b24fd0
* H 3 -1 1048640 44 66161 0x4335bfd0
* H 3 -1 1048640 44 156337 0x43d3ffd0
Total 18 blks, 16777264 bytes
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
1. The prev free flag should use field size instead of preceding to compare. 2. If not prev-free, then prevnode should be None. 3. Cast type to mm_freenode_s in order to access flink, blink when node is free. 4. Heap itself is also included in first region. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
8626b2b to
c6e0e5d
Compare
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
It could be disabled at compile time. Use utils.get_task_name to handle it Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
c6e0e5d to
c3b9054
Compare
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: Please adhere to Contributing Guidelines.
Summary
This PR is not ready for review for now. because it depends on previous unmerged PRs.Optimize the performance of memleak, memdump commands.
Tested on a complex project, results are promising.
Optimize memdump command to include overhead dump.
Impact
Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.
Testing
Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.