diff --git a/src/coreclr/tools/dotnet-pgo/Program.cs b/src/coreclr/tools/dotnet-pgo/Program.cs index c7ac4bba6f2ee8..5894d235a8b59c 100644 --- a/src/coreclr/tools/dotnet-pgo/Program.cs +++ b/src/coreclr/tools/dotnet-pgo/Program.cs @@ -1050,7 +1050,7 @@ private int InnerProcessTraceFileMain() { bool hasPid = IsSet(_command.Pid); string processName = Get(_command.ProcessName); - if (hasPid && processName == null && traceLog.Processes.Count != 1) + if (!hasPid && processName == null && traceLog.Processes.Count != 1) { PrintError("Trace file contains multiple processes to distinguish between"); PrintOutput("Either a pid or process name from the following list must be specified");