From: John Salem Date: Tue, 25 Jun 2019 19:39:24 +0000 (-0700) Subject: Remove OutputPath from EventPipe Collect command and update docs to reflect change... X-Git-Tag: submit/tizen/20190813.035844~4^2^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e57a6c48d1d5aa9b4e158cec628e105e6f1bdfe2;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Remove OutputPath from EventPipe Collect command and update docs to reflect change (#362) --- diff --git a/documentation/design-docs/ipc-protocol.md b/documentation/design-docs/ipc-protocol.md index bf8cdb302..9d627fd54 100644 --- a/documentation/design-docs/ipc-protocol.md +++ b/documentation/design-docs/ipc-protocol.md @@ -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 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 providers } diff --git a/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/SessionConfiguration.cs b/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/SessionConfiguration.cs index a47e5b25b..da1ccd0bb 100644 --- a/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/SessionConfiguration.cs +++ b/src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/SessionConfiguration.cs @@ -17,7 +17,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient public struct SessionConfiguration { - public SessionConfiguration(uint circularBufferSizeMB, EventPipeSerializationFormat format, string outputPath, IReadOnlyCollection providers) + public SessionConfiguration(uint circularBufferSizeMB, EventPipeSerializationFormat format, IReadOnlyCollection 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(providers); } public uint CircularBufferSizeInMB { get; } public EventPipeSerializationFormat Format { get; } - public string OutputPath => _outputPath?.FullName; public IReadOnlyCollection Providers => _providers.AsReadOnly(); - private readonly FileInfo _outputPath; private readonly List _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) diff --git a/src/Microsoft.Diagnostics.Tools.RuntimeClient/Extensions.cs b/src/Microsoft.Diagnostics.Tools.RuntimeClient/Extensions.cs index f0ab1ed71..7de46bd5b 100644 --- a/src/Microsoft.Diagnostics.Tools.RuntimeClient/Extensions.cs +++ b/src/Microsoft.Diagnostics.Tools.RuntimeClient/Extensions.cs @@ -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) diff --git a/src/Tools/dotnet-counters/CounterMonitor.cs b/src/Tools/dotnet-counters/CounterMonitor.cs index de64344df..379abc9e1 100644 --- a/src/Tools/dotnet-counters/CounterMonitor.cs +++ b/src/Tools/dotnet-counters/CounterMonitor.cs @@ -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); diff --git a/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs b/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs index b743bc120..be8cfd7fd 100644 --- a/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs +++ b/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs @@ -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);