Skip to content

Report error if dotnet-pgo trace contains multiple processes #114962

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

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

MichalStrehovsky
Copy link
Member

Fixes a logic error. When the trace file has multiple processes and no PID or process name was specified, we're supposed to instruct the user to provide it. Instead, we instruct user to provide it only if --pid is actually specified.

Fixes a logic error. When the trace file has multiple processes and no PID or process name was specified, we're supposed to instruct the user to provide it. Instead, we instruct user to provide it only if `--pid` is actually specified.
@Copilot Copilot AI review requested due to automatic review settings April 23, 2025 16:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the logic for reporting an error when the trace file contains multiple processes and neither PID nor process name is specified.

  • Fixes the incorrect condition for error reporting by checking if PID is not provided.
  • Updates the error handling to prompt the user for a PID or process name when multiple processes exist.
Comments suppressed due to low confidence (1)

src/coreclr/tools/dotnet-pgo/Program.cs:1055

  • [nitpick] Consider rephrasing the error message for improved clarity. For example, 'Trace file contains multiple processes; please specify either a PID or process name' might provide clearer guidance to the user.
PrintError("Trace file contains multiple processes to distinguish between");

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

Looks like a mishap in the move to System.CommandLine

@jkotas jkotas merged commit ca72cdf into main Apr 23, 2025
92 of 94 checks passed
@jkotas jkotas deleted the MichalStrehovsky-patch-2 branch April 23, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants