Remove OutputPath from EventPipe Collect command and update docs to reflect change...
authorJohn Salem <josalem@microsoft.com>
Tue, 25 Jun 2019 19:39:24 +0000 (12:39 -0700)
committerGitHub <noreply@github.com>
Tue, 25 Jun 2019 19:39:24 +0000 (12:39 -0700)
documentation/design-docs/ipc-protocol.md
src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/SessionConfiguration.cs
src/Microsoft.Diagnostics.Tools.RuntimeClient/Extensions.cs
src/Tools/dotnet-counters/CounterMonitor.cs
src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs

index bf8cdb30231917e217c8a24d2fda6279e827b29d..9d627fd54ad444a78e8ea6700074c77b56d42b05 100644 (file)
@@ -413,7 +413,6 @@ Header: `{ Magic; Size; 0x0202; 0x0000 }`
 
 * `uint circularBufferMB`: The size of the circular buffer used for buffering event data while streaming
 * `uint format`: 0 for the legacy NetPerf format and 1 for the NetTrace format
-* `string outputPath`: currently unused, and should be 0 length
 * `array<provider_config> providers`: The providers to turn on for the streaming session
 
 A `provider_config` is composed of the following data:
@@ -438,7 +437,7 @@ Input:
 Payload
 {
     uint circularBufferMB,
-    string outputPath,
+    uint format,
     array<provider_config> providers
 }
 
index a47e5b25b0fadc050cc1542219e9fadafa6b0a2f..da1ccd0bb4ccb2f5a5ab1e4e9aeb03aa8a3887cf 100644 (file)
@@ -17,7 +17,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
 
     public struct SessionConfiguration
     {
-        public SessionConfiguration(uint circularBufferSizeMB, EventPipeSerializationFormat format, string outputPath, IReadOnlyCollection<Provider> providers)
+        public SessionConfiguration(uint circularBufferSizeMB, EventPipeSerializationFormat format, IReadOnlyCollection<Provider> providers)
         {
             if (circularBufferSizeMB == 0)
                 throw new ArgumentException($"Buffer size cannot be zero.");
@@ -27,25 +27,19 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
                 throw new ArgumentNullException(nameof(providers));
             if (providers.Count() <= 0)
                 throw new ArgumentException($"Specified providers collection is empty.");
-            if (outputPath != null && Directory.Exists(outputPath)) // Make sure the input is not a directory.
-                throw new ArgumentException($"Specified output file name: {outputPath}, refers to a directory.");
 
             CircularBufferSizeInMB = circularBufferSizeMB;
             Format = format;
             string extension = format == EventPipeSerializationFormat.NetPerf ? ".netperf" : ".nettrace";
-            _outputPath = outputPath != null ?
-                new FileInfo(fileName: !outputPath.EndsWith(extension) ? $"{outputPath}{extension}" : outputPath) : null;
             _providers = new List<Provider>(providers);
         }
 
         public uint CircularBufferSizeInMB { get; }
         public EventPipeSerializationFormat Format { get; }
 
-        public string OutputPath => _outputPath?.FullName;
 
         public IReadOnlyCollection<Provider> Providers => _providers.AsReadOnly();
 
-        private readonly FileInfo _outputPath;
         private readonly List<Provider> _providers;
 
         public byte[] Serialize()
@@ -56,7 +50,6 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
             {
                 writer.Write(CircularBufferSizeInMB);
                 writer.Write((uint)Format);
-                writer.WriteString(OutputPath);
 
                 writer.Write(Providers.Count());
                 foreach (var provider in Providers)
index f0ab1ed71db01a1f1ccebbfd7e84e33fc91d7969..7de46bd5b09033f9c03bcc7eb2dd70db26b2c5fe 100644 (file)
@@ -36,7 +36,6 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
             int size = 0;
 
             size += Marshal.SizeOf(@this.CircularBufferSizeInMB.GetType());
-            size += @this.OutputPath.GetByteCount();
             size += Marshal.SizeOf(typeof(int));
 
             foreach (var provider in @this.Providers)
index de64344df6edb8bcd81c8a3a43b706b795da7768..379abc9e16637bc4f60de7d73eed0b7b7a858bb2 100644 (file)
@@ -162,7 +162,6 @@ namespace Microsoft.Diagnostics.Tools.Counters
                     var configuration = new SessionConfiguration(
                         circularBufferSizeMB: 1000,
                         format: EventPipeSerializationFormat.NetTrace,
-                        outputPath: "",
                         providers: Trace.Extensions.ToProviders(providerString));
 
                     var binaryReader = EventPipeClient.CollectTracing(_processId, configuration, out _sessionId);
index b743bc1205318707c7cb905d6f61523122e424f1..be8cfd7fdb51caa8904350e6267355953b83927f 100644 (file)
@@ -90,7 +90,6 @@ namespace Microsoft.Diagnostics.Tools.Trace
                 var configuration = new SessionConfiguration(
                     circularBufferSizeMB: buffersize,
                     format: EventPipeSerializationFormat.NetTrace,
-                    outputPath: null, // Not used on the streaming scenario.
                     providers: providerCollection);
 
                 var shouldExit = new ManualResetEvent(false);