Skip to content
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

Add print PID option under MAGIC_TRACE_DEBUG (-z-print-pid) #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DMaroo
Copy link

@DMaroo DMaroo commented Dec 6, 2022

This PR introduces an option (-z-print-pid) to be used when Env_vars.debug is set to true. This would print the PIDs of all the processes which magic-trace attaches to.

A demo output looks like this:

$ MAGIC_TRACE_DEBUG=1 magic-trace attach -p 245085,251541 -z-print-pid
Passed PIDs to perf: 245085,251541
<rest of the output>
<Ctrl+C>
$ /bin/cat &
[2] 251834
[2]  + suspended (tty input)  cat
$ MAGIC_TRACE_DEBUG=1 magic-trace attach -z-print-pid
<choose /bin/cat process using fzf>
Passed PIDs to perf: 251834
<rest of the output>
<Ctrl+C>

Done in collaboration with @Mantra-7.

Fixes #256.

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.

Write out the PID
1 participant