Skip to content

Commit

Permalink
Trim whitespace when parsing additional providers (#1998)
Browse files Browse the repository at this point in the history
Without this change, a very simple mistake such as an extra space in the
comma-separated list of providers will silently cause the provider to
not be enabled.  This is a very easy mistake to make if the list of
providers you want to enable it large and you are copying and pasting
the list from somewhere else and it gets word wrapped, etc.
  • Loading branch information
zpostfacto authored Feb 28, 2024
1 parent 8ff2346 commit c1c7266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PerfView/CommandProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3714,7 +3714,7 @@ public static List<ParsedProvider> ParseProviderSpecs(string[] providerSpecs, st
TraceEventLevel level = TraceEventLevel.Verbose;
ulong matchAnyKeywords = unchecked((ulong)-1);

var rest = providerSpec;
var rest = providerSpec.Trim();
Match m = Regex.Match(rest, @"^([^:]*)(:(.*))?$");
Debug.Assert(m.Success);
rest = m.Groups[3].Value;
Expand Down

0 comments on commit c1c7266

Please sign in to comment.