Skip to content

Commit ca72cdf

Browse files
Report error if dotnet-pgo trace contains multiple processes (#114962)
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.
1 parent 548f821 commit ca72cdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ private int InnerProcessTraceFileMain()
10501050
{
10511051
bool hasPid = IsSet(_command.Pid);
10521052
string processName = Get(_command.ProcessName);
1053-
if (hasPid && processName == null && traceLog.Processes.Count != 1)
1053+
if (!hasPid && processName == null && traceLog.Processes.Count != 1)
10541054
{
10551055
PrintError("Trace file contains multiple processes to distinguish between");
10561056
PrintOutput("Either a pid or process name from the following list must be specified");

0 commit comments

Comments
 (0)