From: Sung Yoon Whang Date: Sun, 5 Apr 2020 03:35:11 +0000 (-0700) Subject: Filter the tools' own PID out of ps command result (#983) X-Git-Tag: submit/tizen_5.5/20200504.045052~11^2^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef2f711b631d02e38fdd63208870686cc2b69132;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Filter the tools' own PID out of ps command result (#983) --- diff --git a/src/Tools/Common/Commands/ProcessStatus.cs b/src/Tools/Common/Commands/ProcessStatus.cs index 19ff7bec4..1a8adf54b 100644 --- a/src/Tools/Common/Commands/ProcessStatus.cs +++ b/src/Tools/Common/Commands/ProcessStatus.cs @@ -34,8 +34,15 @@ namespace Microsoft.Internal.Common.Commands .OrderBy(process => process.ProcessName) .ThenBy(process => process.Id); + var currentPid = Process.GetCurrentProcess().Id; + foreach (var process in processes) { + if (process.Id == currentPid) + { + continue; + } + try { sb.Append($"{process.Id, 10} {process.ProcessName, -10} {process.MainModule.FileName}\n");