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

Profile by pid #53

Merged
merged 4 commits into from
Dec 2, 2019
Merged

Conversation

ASankaran
Copy link
Contributor

@ASankaran ASankaran commented Nov 30, 2019

Sometimes it is preferable to be able to profile a running process instead of needing to restart the process under the profiler. This PR adds a Workload enum which can contain a command or a pid. Additionally a flag for passing in a pid instead of a command is provided for the flamegraph binary.

Usage:

flamegraph -p 2147

These changes do not break the existing cli interface.

@jonas-schievink
Copy link
Contributor

Thanks, this looks like a reasonable addition!

I think it would be good if the CLI tool would raise an error if -p is used alongside the trailing command. Right now the code will ignore the command and use the PID.

@ASankaran
Copy link
Contributor Author

Sounds good. The CLI now checks that trailing_arguments is empty before generating the Workload for the pid.

@jonas-schievink jonas-schievink merged commit 9e278f6 into flamegraph-rs:master Dec 2, 2019
leod pushed a commit to leod/flamegraph that referenced this pull request Jun 3, 2023
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.

2 participants