From: Sung Yoon Whang Date: Tue, 30 Apr 2019 01:28:06 +0000 (-0700) Subject: Fix issue with dotnet-counters not being able to target user-defined EventSource... X-Git-Tag: submit/tizen/20190813.035844~6^2^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=755d149fbd34cd08e582a6c922de9bb2d54a236f;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix issue with dotnet-counters not being able to target user-defined EventSource (#222) --- diff --git a/src/Tools/dotnet-counters/ConsoleWriter.cs b/src/Tools/dotnet-counters/ConsoleWriter.cs index 2963d2f84..1886dfd08 100644 --- a/src/Tools/dotnet-counters/ConsoleWriter.cs +++ b/src/Tools/dotnet-counters/ConsoleWriter.cs @@ -83,8 +83,12 @@ namespace Microsoft.Diagnostics.Tools.Counters } else { - // If it's from an provider, just append it at the end. + // If it's from an unknown provider, just append it at the end. string displayName = payload.GetDisplay(); + if (string.IsNullOrEmpty(displayName)) + { + displayName = payload.GetName(); + } int left = displayName.Length + 7; // displayName + " : " int row = maxRow; displayPosition[name] = (left, row); diff --git a/src/Tools/dotnet-counters/CounterProvider.cs b/src/Tools/dotnet-counters/CounterProvider.cs index 03c8b68c3..07400071b 100644 --- a/src/Tools/dotnet-counters/CounterProvider.cs +++ b/src/Tools/dotnet-counters/CounterProvider.cs @@ -43,7 +43,7 @@ namespace Microsoft.Diagnostics.Tools.Counters public static string SerializeUnknownProviderName(string unknownCounterProviderName, int interval) { - return $"{unknownCounterProviderName}:0xffffffff:0x4:EventCounterIntervalSec={interval}"; + return $"{unknownCounterProviderName}:ffffffff:4:EventCounterIntervalSec={interval}"; } public IReadOnlyList GetAllCounters() => Counters.Values.ToList();