system/trace: support binary dump of noteram#3355
Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom Jan 26, 2026
Merged
system/trace: support binary dump of noteram#3355xiaoxiang781216 merged 1 commit intoapache:masterfrom
xiaoxiang781216 merged 1 commit intoapache:masterfrom
Conversation
435d9e0 to
10755f1
Compare
xiaoxiang781216
previously approved these changes
Jan 21, 2026
This patch adds support for dumping binary contents from noteram via the `trace dump -b <file>` command. Changes include: - Add a `binary` parameter to `trace_dump()` and the public header `system/trace/trace.h` to indicate binary output mode. - Update `trace_dump()` to set the noteram read mode to binary using `NOTERAM_SETREADMODE` when requested. - Update `trace dump` CLI parsing in `system/trace/trace.c` to accept the `-b` flag and pass it through to `trace_dump()`. - Update usage/help text to include the new `-b` option. Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
10755f1 to
93537bf
Compare
xiaoxiang781216
approved these changes
Jan 26, 2026
jerpelea
approved these changes
Jan 26, 2026
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.
This patch adds support for dumping binary contents from noteram via the
trace dump -b <file>command. Changes include:binaryparameter totrace_dump()and the public headersystem/trace/trace.hto indicate binary output mode.trace_dump()to set the noteram read mode to binary usingNOTERAM_SETREADMODEwhen requested.trace dumpCLI parsing insystem/trace/trace.cto acceptthe
-bflag and pass it through totrace_dump().-boption.Note: Please adhere to Contributing Guidelines.
Summary
This PR adds support for dumping binary noteram contents from the
traceutility. A new
-boption is provided totrace dumpto emit the rawbinary data instead of the human-readable text format.
What I changed
system/trace/trace.h: updated prototypeint trace_dump(FILE *out, bool binary);system/trace/trace.c: parse-boption fortrace dumpand pass theflag to
trace_dump(); update usage text.system/trace/trace_dump.c: when binary mode is requested, set thenoteram read mode to
NOTERAM_MODE_READ_BINARYvia ioctlNOTERAM_SETREADMODE.Files modified
Impact
-bis not specified.
Testing
nsh> trace dump -b /tmp/trace.binand verify the produced filecontains binary data as expected.
nsh> trace dump /tmp/trace.txtto verify the original text output.