Skip to content

shell: add trace command#22

Draft
xuchang-vivo wants to merge 1 commit into
vivoblueos:mainfrom
xuchang-vivo:xc/add_tracing_event
Draft

shell: add trace command#22
xuchang-vivo wants to merge 1 commit into
vivoblueos:mainfrom
xuchang-vivo:xc/add_tracing_event

Conversation

@xuchang-vivo
Copy link
Copy Markdown
Contributor

Summary

  • Add a trace shell command for controlling the kernel tracing subsystem through procfs.
  • Register the command in the shell command table.
  • Stream trace dump output in fixed-size chunks to avoid allocating the whole dump in memory.

Usage

The command expects the kernel tracing procfs ABI to be available under /proc/trace.

Start a fresh tracing session:

trace start

Stop tracing:

trace stop

Reset tracing buffers and counters:

trace reset

Print tracing status and counters:

trace stats

Print decoded trace events:

trace dump

Save the raw binary BTRC trace stream for host-side tooling:

trace dump --raw /tmp/trace.btrc

If tracing is not compiled into the kernel, the command reports that tracing is disabled in this build.

Notes

  • Control commands are written to /proc/trace/control.
  • Statistics are read from /proc/trace/stats.
  • Decoded text output is read from /proc/trace/dump.
  • Raw binary output is read from /proc/trace/raw.

Validation

  • Not rerun while creating this PR.
  • This shell command is intended to be validated with the matching kernel tracing PR using qemu_mps2_an385.debug and shell_runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant