-
Notifications
You must be signed in to change notification settings - Fork 1.5k
{Bp-13949} note: support asynchronous sched_note_printf output #14507
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
Conversation
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
noteram_add may cause head = tail when remain == NOTE_ALIGN(notelen) log: nsh_main-14 [0] 2.132127493: tracing_mark_write: B|14|trace dump -c nsh_main-14 [0] 2.143322780: tracing_mark_write: E|14|trace dump -c nsh_main-14 [0] 2.513023895: tracing_mark_write: B|14|trace dump -c nsh_main-14 [0] 2.524060048: tracing_mark_write: E|14|trace dump -c nsh_main-14 [0] 2.897055341: tracing_mark_write: B|14|trace dump -c ap> trace dump -c nsh_main-14 [0] 3.270037241: tracing_mark_write: B|14|trace dump -c ap> trace dump -c Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Fix ubsan warning that writes need to be aligned to memory boundaries when writing data Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
noteram_get may cause _read = ni_bufsize cause assert crash [ 1493.627200] [79] [ EMERG] [ap] _assert: Assertion failed : at file: note/noteram_driver.c:370 task: trace process: trace 0x446f238a [ 1493.627400] [79] [ EMERG] [ap] backtrace: [ 1493.627500] [79] [ EMERG] [ap] [79] [<0xf7933c9d>] _fini+0xae0720b9/0xb673e41b [ 1493.628400] [79] [ EMERG] [ap] [79] [<0x498b1b0c>] host_backtrace+0x42/0x72 [ 1493.629300] [79] [ EMERG] [ap] [79] [<0x48bef3d1>] up_backtrace+0x127/0x2d2 [ 1493.630200] [79] [ EMERG] [ap] [79] [<0x48b86bed>] sched_backtrace+0x71/0x8a [ 1493.631100] [79] [ EMERG] [ap] [79] [<0x44676273>] sched_dumpstack+0xed/0x486 [ 1493.631600] [79] [ EMERG] [ap] [79] [<0x445c61ff>] _assert+0x9f0/0xb38 [ 1493.632200] [79] [ EMERG] [ap] [79] [<0x4420dd07>] __assert+0x3f/0x4c [ 1493.632800] [79] [ EMERG] [ap] [79] [<0x44151648>] noteram_get+0x1b0/0x5fe [ 1493.633600] [79] [ EMERG] [ap] [79] [<0x44152370>] noteram_read+0x331/0x4f7 [ 1493.634200] [79] [ EMERG] [ap] [79] [<0x444c66f9>] file_read+0x38b/0x3c0 [ 1493.634700] [79] [ EMERG] [ap] [79] [<0x444c6840>] nx_read+0x112/0x170 [ 1493.635300] [79] [ EMERG] [ap] [79] [<0x444c68e5>] NXread+0x47/0xfa [ 1493.635800] [79] [ EMERG] [ap] [79] [<0x446f2c70>] trace_dump+0x148/0x2f4 [ 1493.636400] [79] [ EMERG] [ap] [79] [<0x446f110b>] trace_cmd_dump+0x41b/0x4b9 [ 1493.636900] [79] [ EMERG] [ap] [79] [<0x446f2723>] trace_main+0x399/0x6e2 [ 1493.637500] [79] [ EMERG] [ap] [79] [<0x44217fc9>] nxtask_startup+0x69/0x7c [ 1493.638000] [79] [ EMERG] [ap] [79] [<0x440f9b78>] nxtask_start+0x8a5/0x8b8 Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
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>
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>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Make it easy to access for beginners, using the default serial as console. Enable wdog sched note. Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Do not format immediately when calling sched_note_printf, but delay formatting until dump trace. After turning on SYSTEM_NOTE, similar asynchronous syslog functions can be achieved. Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
|
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
Oct 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Arch: arm
Issues related to ARM (32-bit) architecture
Arch: risc-v
Issues related to the RISC-V (32-bit or 64-bit) architecture
Arch: simulator
Issues related to the SIMulator
Arch: xtensa
Issues related to the Xtensa architecture
Area: BINFMT
Area: Documentation
Improvements or additions to documentation
Area: File System
File System issues
Area: Memory Management
Memory Management issues
Area: OS Components
OS Components issues
Area: Tooling
Board: arm
Board: renesas
Size: XL
The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.
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.
Summary
Change 1: Replace sched_note_printf with sched_note_bprintf to delay string formatting and improve sched_note_printf execution speed (bprintf does not format parameters, but only parses the format string and saves parameters for delayed formatting)
Change 2: Supports obtaining variable parameter types at compile time and saving function parameters at runtime without parsing the format string. This method does not require parsing the format string, so the execution speed will be faster than bprintf
These two functions can use sched_note_printf to replace syslog, providing a faster log storage method.
And it does not rely on the format string. The format string in syslog can be removed to reduce the size of the final bin file.
Impact
RELEASE
Testing
sim
NOTE
includes
#13684
#13771
#13847
#13901
#13948
#13949