Skip to content

Support running commands while attached#379

Open
yinli-systems wants to merge 1 commit into
janestreet:masterfrom
yinli-systems:kevin/attach-run-command
Open

Support running commands while attached#379
yinli-systems wants to merge 1 commit into
janestreet:masterfrom
yinli-systems:kevin/attach-run-command

Conversation

@yinli-systems

Copy link
Copy Markdown

Fixes #230.

Summary

Adds an optional command argument to magic-trace attach, so users can attach to an existing process, run a workload, and have magic-trace detach automatically when that workload exits:

magic-trace attach -p $PID -- ./load-generator arg1 arg2

The existing Ctrl-C-driven attach flow is unchanged. The new path reuses the existing attach/record/decode pipeline, forwards the helper command's stdio, detaches when the helper exits, and still detaches promptly if magic-trace receives Ctrl-C first.

Validation

  • git diff --check
  • make attempted, but this local machine does not have dune installed (make: dune: No such file or directory)

Signed-off-by: Kevin-Li-2025 <2242139@qq.com>
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.

Support magic-trace attach -p ... [cmd] syntax

1 participant