From a82144473b1acf3de706d08f4b1ac05e7743d6ba Mon Sep 17 00:00:00 2001 From: Brian Robbins Date: Tue, 27 Feb 2018 16:59:09 -0800 Subject: [PATCH 1/6] Enable EventSourceTrace test. --- tests/issues.targets | 3 --- tests/src/dirs.proj | 1 - 2 files changed, 4 deletions(-) diff --git a/tests/issues.targets b/tests/issues.targets index 49494d21bd52..95ebea0c5854 100644 --- a/tests/issues.targets +++ b/tests/issues.targets @@ -187,9 +187,6 @@ 6707 - - 15919 - diff --git a/tests/src/dirs.proj b/tests/src/dirs.proj index daa39d658f65..6bb138b70624 100644 --- a/tests/src/dirs.proj +++ b/tests/src/dirs.proj @@ -31,7 +31,6 @@ - From 16469bcb66db5ccd4edd3cd4a41705e4a16869f4 Mon Sep 17 00:00:00 2001 From: Brian Robbins Date: Tue, 27 Feb 2018 17:00:05 -0800 Subject: [PATCH 2/6] Delete EventSourceSmoke test. --- .../eventsourcesmoke/EventSourceSmoke.cs | 80 ------------------- .../eventsourcesmoke/eventsourcesmoke.csproj | 32 -------- 2 files changed, 112 deletions(-) delete mode 100644 tests/src/tracing/eventsourcesmoke/EventSourceSmoke.cs delete mode 100644 tests/src/tracing/eventsourcesmoke/eventsourcesmoke.csproj diff --git a/tests/src/tracing/eventsourcesmoke/EventSourceSmoke.cs b/tests/src/tracing/eventsourcesmoke/EventSourceSmoke.cs deleted file mode 100644 index f0873bcc37d0..000000000000 --- a/tests/src/tracing/eventsourcesmoke/EventSourceSmoke.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.IO; -using System.Diagnostics.Tracing; -using Tracing.Tests.Common; - -namespace Tracing.Tests -{ - [EventSource(Name = "SimpleEventSource")] - class SimpleEventSource : EventSource - { - public SimpleEventSource() : base(true) { } - - [Event(1)] - internal void MathResult(int x, int y, int z, string formula) { this.WriteEvent(1, x, y, z, formula); } - } - - class EventPipeSmoke - { - private static int messageIterations = 10000; - private static int trivialSize = 0x100000; - - public static TraceConfiguration GetConfig(EventSource eventSource, string outputFile="default.netperf") - { - // Setup the configuration values. - uint circularBufferMB = 1024; // 1 GB - uint level = 5;//(uint)EventLevel.Informational; - TimeSpan profSampleDelay = TimeSpan.FromMilliseconds(1); - - // Create a new instance of EventPipeConfiguration. - TraceConfiguration config = new TraceConfiguration(outputFile, circularBufferMB); - // Setup the provider values. - // Public provider. - string providerName = eventSource.Name; - UInt64 keywords = 0xffffffffffffffff; - - // Enable the provider. - config.EnableProvider(providerName, keywords, level); - - // Set the sampling rate. - config.SetSamplingRate(profSampleDelay); - - return config; - } - - static int Main(string[] args) - { - using (var netPerfFile = NetPerfFile.Create(args)) - { - SimpleEventSource eventSource = new SimpleEventSource(); - - Console.WriteLine("\tStart: Enable tracing."); - TraceControl.Enable(GetConfig(eventSource, netPerfFile.Path)); - Console.WriteLine("\tEnd: Enable tracing.\n"); - - Console.WriteLine("\tStart: Messaging."); - // Send messages - // Use random numbers and addition as a simple, human readble checksum - Random generator = new Random(); - for (int i = 0; i < messageIterations; i++) - { - int x = generator.Next(1, 1000); - int y = generator.Next(1, 1000); - string formula = String.Format("{0} + {1} = {2}", x, y, x + y); - - eventSource.MathResult(x, y, x + y, formula); - } - Console.WriteLine("\tEnd: Messaging.\n"); - - Console.WriteLine("\tStart: Disable tracing."); - TraceControl.Disable(); - Console.WriteLine("\tEnd: Disable tracing.\n"); - - FileInfo outputMeta = new FileInfo(netPerfFile.Path); - Console.WriteLine("\tCreated {0} bytes of data", outputMeta.Length); - - return outputMeta.Length > trivialSize ? 100 : -1; - } - } - } -} diff --git a/tests/src/tracing/eventsourcesmoke/eventsourcesmoke.csproj b/tests/src/tracing/eventsourcesmoke/eventsourcesmoke.csproj deleted file mode 100644 index a617c6657a19..000000000000 --- a/tests/src/tracing/eventsourcesmoke/eventsourcesmoke.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - {8E3244CB-407F-4142-BAAB-E7A55901A5FA} - Exe - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ..\..\ - BuildAndRun - $(DefineConstants);STATIC - true - 1 - - - - - - - - - False - - - - - - - - From 4d4d3f1b0857e148e06f05c7b3bc666a6f02b5d0 Mon Sep 17 00:00:00 2001 From: Brian Robbins Date: Tue, 27 Feb 2018 17:01:26 -0800 Subject: [PATCH 3/6] Mark EventSourceTrace test as priority 0. --- tests/src/tracing/eventsourcetrace/eventsourcetrace.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/tracing/eventsourcetrace/eventsourcetrace.csproj b/tests/src/tracing/eventsourcetrace/eventsourcetrace.csproj index 833146ec6437..0bf6d8fd3939 100644 --- a/tests/src/tracing/eventsourcetrace/eventsourcetrace.csproj +++ b/tests/src/tracing/eventsourcetrace/eventsourcetrace.csproj @@ -12,7 +12,7 @@ BuildAndRun $(DefineConstants);STATIC true - 1 + 0 From 678e9e37b1d5c50b84aff319d815ffe5e8f5fab0 Mon Sep 17 00:00:00 2001 From: Brian Robbins Date: Tue, 27 Feb 2018 20:41:50 -0800 Subject: [PATCH 4/6] Disable eventsourcetrace on Windows. --- tests/issues.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/issues.targets b/tests/issues.targets index 95ebea0c5854..8c74e72a035a 100644 --- a/tests/issues.targets +++ b/tests/issues.targets @@ -1725,7 +1725,7 @@ - + 15494 From 50d71f5dacf011e8c5b28da5e688b4b25589d61d Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Wed, 28 Feb 2018 08:12:19 +0100 Subject: [PATCH 5/6] test fix --- tests/src/tracing/eventsourcetrace/EventSourceTrace.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs b/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs index 2fbaad15bcea..cec803f9f357 100644 --- a/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs +++ b/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs @@ -4,6 +4,7 @@ using Tracing.Tests.Common; using System.Diagnostics.Tracing; using Microsoft.Diagnostics.Tracing; +using Microsoft.Diagnostics.Tracing.Etlx; using Microsoft.Diagnostics.Tracing.Parsers; using Microsoft.Diagnostics.Tracing.Parsers.Clr; @@ -77,7 +78,7 @@ static int Main(string[] args) Console.WriteLine("\tStart: Processing events from file."); int msgCount = 0; - using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(netPerfFile.Path)) + using (var trace = new TraceLog(TraceLog.CreateFromEventPipeDataFile(eventPipeFilePath)).Events.GetSource()) { var names = new HashSet(); From f7da6a2664cd2c719f9934945a4e20c408cb8714 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Wed, 28 Feb 2018 08:14:19 +0100 Subject: [PATCH 6/6] I forgot to change the path --- tests/src/tracing/eventsourcetrace/EventSourceTrace.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs b/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs index cec803f9f357..3c9135927c41 100644 --- a/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs +++ b/tests/src/tracing/eventsourcetrace/EventSourceTrace.cs @@ -78,7 +78,7 @@ static int Main(string[] args) Console.WriteLine("\tStart: Processing events from file."); int msgCount = 0; - using (var trace = new TraceLog(TraceLog.CreateFromEventPipeDataFile(eventPipeFilePath)).Events.GetSource()) + using (var trace = new TraceLog(TraceLog.CreateFromEventPipeDataFile(netPerfFile.Path)).Events.GetSource()) { var names = new HashSet();