Show warning when providers are specified via GUID (#476)
authorSung Yoon Whang <suwhang@microsoft.com>
Sat, 14 Sep 2019 05:12:26 +0000 (22:12 -0700)
committerGitHub <noreply@github.com>
Sat, 14 Sep 2019 05:12:26 +0000 (22:12 -0700)
* Show warning when providers are specified via GUID

* Lets not throw useless exceptions

* Fix typo

src/Tools/dotnet-trace/Extensions.cs
src/Tools/dotnet-trace/trace.speedscope.json [new file with mode: 0644]

index 0967d6da9adbd99cbcb9f096ba8846772b73ea9c..fbaf43847f8d671afa1bcd51408ab9003024de97 100644 (file)
@@ -29,6 +29,13 @@ namespace Microsoft.Diagnostics.Tools.Trace
 
             // Provider name
             string providerName = tokens.Length > 0 ? tokens[0] : null;
+
+            // Check if the supplied provider is a GUID and not a name.
+            if (Guid.TryParse(providerName, out _))
+            {
+                Console.WriteLine($"Warning: --provider argument {providerName} appears to be a GUID which is not supported by dotnet-trace. Providers need to be referenced by their textual name.");
+            }
+
             if (string.IsNullOrWhiteSpace(providerName))
                 throw new ArgumentException("Provider name was not specified.");
 
diff --git a/src/Tools/dotnet-trace/trace.speedscope.json b/src/Tools/dotnet-trace/trace.speedscope.json
new file mode 100644 (file)
index 0000000..26967ca
--- /dev/null
@@ -0,0 +1 @@
+{"exporter": "speedscope@1.3.2", "name": "trace.speedscope", "activeProfileIndex": 0, "$schema": "https://www.speedscope.app/file-format-schema.json", "shared": { "frames": [ { "name": "Process64 Process(60720) (60720) Args: " }, { "name": "(Non-Activities)" }, { "name": "Threads" }, { "name": "Thread (3408949)" }, { "name": "hamham!my_own_counter.Program.Main(class System.String[])" }, { "name": "System.Private.CoreLib!System.Threading.Thread.Sleep(int32)" }, { "name": "UNMANAGED_CODE_TIME" }] }, "profiles": [ { "type": "evented", "name": "Thread (3408949)", "unit": "milliseconds", "startValue": "0.994686", "endValue": "3038.3867300143816", "events": [ { "type": "O", "frame": 0, "at": 0.994686 }, { "type": "O", "frame": 1, "at": 0.994686 }, { "type": "O", "frame": 2, "at": 0.994686 }, { "type": "O", "frame": 3, "at": 0.994686 }, { "type": "O", "frame": 4, "at": 0.994686 }, { "type": "O", "frame": 5, "at": 0.994686 }, { "type": "O", "frame": 6, "at": 0.994686 }, { "type": "C", "frame": 6, "at": 864.61229 }, { "type": "C", "frame": 5, "at": 864.61229 }, { "type": "O", "frame": 6, "at": 864.61229 }, { "type": "C", "frame": 6, "at": 865.79786095527652 }, { "type": "O", "frame": 5, "at": 865.797861 }, { "type": "O", "frame": 6, "at": 865.797861 }, { "type": "C", "frame": 6, "at": 3038.3867300143816 }, { "type": "C", "frame": 5, "at": 3038.3867300143816 }, { "type": "C", "frame": 4, "at": 3038.3867300143816 }, { "type": "C", "frame": 3, "at": 3038.3867300143816 }, { "type": "C", "frame": 2, "at": 3038.3867300143816 }, { "type": "C", "frame": 1, "at": 3038.3867300143816 }, { "type": "C", "frame": 0, "at": 3038.3867300143816 }]}] }
\ No newline at end of file