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

Filter PIDs to profile #761

Merged
merged 21 commits into from
Apr 12, 2023
Merged

Filter PIDs to profile #761

merged 21 commits into from
Apr 12, 2023

Conversation

mpozniak95
Copy link
Contributor

Description

This PR:

  • Add flag --pid that enables providing chosen pids to profile
  • Checks if at least one of processes provided is alive
  • pids are passed to profilers via ProfilerState
  • Adds test for checking if only provided pid is profiled with async-profiler

Related Issue

#605

@mpozniak95
Copy link
Contributor Author

mpozniak95 commented Apr 5, 2023

I'll open two more issues and I'll link them to the code. It seems that flags --pid/-p doesn't work as intendent in pyperf and phpspy. Pyperf seems to ignore this parameter and phpspy is getting stuck with this flag

@mpozniak95 mpozniak95 requested a review from Jongy April 6, 2023 08:11
Copy link
Contributor

@Jongy Jongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :) I gave some comments. Did not try it out locally yet, will do that after the next CR round.

@mpozniak95 mpozniak95 requested a review from Jongy April 11, 2023 07:32
@mpozniak95
Copy link
Contributor Author

Two tests failed in CI/CD but I think that it isn't connected with these changes

@Jongy Jongy added the enhancement New feature or request label Apr 11, 2023
Copy link
Contributor

@Jongy Jongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done reviewing

@mpozniak95 mpozniak95 requested a review from Jongy April 11, 2023 12:53
Copy link
Contributor

@Jongy Jongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Gave a few minor comments. I'll play with it a bit locally now and write my impression, currently no other comment besides those few and then it's good to merge.

Copy link
Contributor

@Jongy Jongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done reviewing and trying it out. 2 UX comments and we can merge

@@ -943,7 +980,8 @@ def main() -> None:
logger.info(
"Running gProfiler", version=__version__, commandline=" ".join(sys.argv[1:]), arguments=args.__dict__
)

if processes_to_profile is not None:
logger.info("Target PIDs given by --pids: ", pids=[process.pid for process in processes_to_profile])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like:

[2023-04-12 15:56:36,138] INFO: gprofiler: Target PIDs given by --pids:  (pids=[1])

No need for the : and the space, since logging adds it anyway when formatting the extras.

@Jongy Jongy merged commit df84102 into intel:master Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants