From: John Salem Date: Tue, 20 Aug 2019 16:47:02 +0000 (-0700) Subject: Remove double escape in provider filter strings (#431) X-Git-Tag: submit/tizen/20191015.063341~12^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bbea63f577f0f1d8cc34848ed993bad0f809bcf;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Remove double escape in provider filter strings (#431) * unescape filter strings since they are coming in double escaped, e.g., \\r\\n instead of \r\n * add note to documentation about correct usage of filter string --- diff --git a/documentation/dotnet-trace-instructions.md b/documentation/dotnet-trace-instructions.md index 31aef5014..f43beacd5 100644 --- a/documentation/dotnet-trace-instructions.md +++ b/documentation/dotnet-trace-instructions.md @@ -173,7 +173,8 @@ Options: 4 - Informational 5 - Verbose KeyValueArgs - A semicolon separated list of key=value - KeyValueArgs format: '[key1=value1][;key2=value2]' + KeyValueArgs format: '[key1=value1][;key2=value2]' + note: values that contain ';' or '=' characters should be surrounded by double quotes ("), e.g., 'key="value;with=symbols";key2=value2' --buffersize Sets the size of the in-memory circular buffer in megabytes. Default 256 MB. diff --git a/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/Provider.cs b/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/Provider.cs index 04ef7e70f..1f8270d48 100644 --- a/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/Provider.cs +++ b/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/Provider.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics.Tracing; +using System.Text.RegularExpressions; namespace Microsoft.Diagnostics.Tools.RuntimeClient { @@ -20,7 +21,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient Name = name; Keywords = keywords; EventLevel = eventLevel; - FilterData = string.IsNullOrWhiteSpace(filterData) ? null : filterData; + FilterData = string.IsNullOrWhiteSpace(filterData) ? null : Regex.Unescape(filterData); } public ulong Keywords { get; }