Update EventSource* Tests for EventPipe (#16645)
authorBrian Robbins <brianrob@microsoft.com>
Wed, 28 Feb 2018 22:16:49 +0000 (14:16 -0800)
committerGitHub <noreply@github.com>
Wed, 28 Feb 2018 22:16:49 +0000 (14:16 -0800)
tests/issues.targets
tests/src/dirs.proj
tests/src/tracing/eventsourcesmoke/EventSourceSmoke.cs [deleted file]
tests/src/tracing/eventsourcesmoke/eventsourcesmoke.csproj [deleted file]
tests/src/tracing/eventsourcetrace/EventSourceTrace.cs
tests/src/tracing/eventsourcetrace/eventsourcetrace.csproj

index 49494d2..8c74e72 100644 (file)
         <ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\TypeGeneratorTests\TypeGeneratorTest683\Generated683\*">
             <Issue>6707</Issue>
         </ExcludeList>
-        <ExcludeList Include="$(XunitTestBinBase)\tracing\eventsourcetrace\**">
-            <Issue>15919</Issue>
-        </ExcludeList>
     </ItemGroup>
 
     <!-- The following are x86 failures -->
     <!-- The following are tests that fail on Windows -->
 
     <ItemGroup Condition="'$(XunitTestBinBase)' != '' and '$(TargetsWindows)' == 'true'">
-        <ExcludeList Include="$(XunitTestBinBase)\tracing\eventsource**">
+        <ExcludeList Include="$(XunitTestBinBase)\tracing\eventsourcetrace\eventsourcetrace\eventsourcetrace.cmd">
             <Issue>15494</Issue>
         </ExcludeList>
     </ItemGroup>
index daa39d6..6bb138b 100644 (file)
@@ -31,7 +31,6 @@
       <DisabledProjects Include="Performance\Scenario\JitBench\unofficial_dotnet\JitBench.csproj" /> <!-- no official build support for SDK-style netcoreapp2.0 projects -->
       <DisabledProjects Include="Loader\classloader\generics\regressions\DD117522\Test.csproj" />
       <DisabledProjects Include="Loader\classloader\generics\GenericMethods\VSW491668.csproj" /> <!-- issue 5501 -->
-      <DisabledProjects Include="tracing\eventsource*\**" /> <!-- issue 15924 -->
     </ItemGroup>
     
     <ItemGroup>
diff --git a/tests/src/tracing/eventsourcesmoke/EventSourceSmoke.cs b/tests/src/tracing/eventsourcesmoke/EventSourceSmoke.cs
deleted file mode 100644 (file)
index f0873bc..0000000
+++ /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 (file)
index a617c66..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{8E3244CB-407F-4142-BAAB-E7A55901A5FA}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
-    <CLRTestKind>BuildAndRun</CLRTestKind>
-    <DefineConstants>$(DefineConstants);STATIC</DefineConstants>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <CLRTestPriority>1</CLRTestPriority>
-  </PropertyGroup>
-  <!-- Default configurations to help VS understand the configurations -->
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
-  </PropertyGroup>
-  <ItemGroup>
-    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
-      <Visible>False</Visible>
-    </CodeAnalysisDependentAssemblyPaths>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="EventSourceSmoke.cs" />
-    <ProjectReference Include="../common/common.csproj" />
-  </ItemGroup>
-  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
index 2fbaad1..3c91359 100644 (file)
@@ -4,6 +4,7 @@ using System.Collections.Generic;
 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 @@ namespace Tracing.Tests
 
                 Console.WriteLine("\tStart: Processing events from file.");
                 int msgCount = 0;
-                using (var trace = TraceEventDispatcher.GetDispatcherFromFileName(netPerfFile.Path))
+                using (var trace = new TraceLog(TraceLog.CreateFromEventPipeDataFile(netPerfFile.Path)).Events.GetSource())
                 {
                     var names = new HashSet<string>();
 
index 833146e..0bf6d8f 100644 (file)
@@ -12,7 +12,7 @@
     <CLRTestKind>BuildAndRun</CLRTestKind>
     <DefineConstants>$(DefineConstants);STATIC</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <CLRTestPriority>1</CLRTestPriority>
+    <CLRTestPriority>0</CLRTestPriority>
   </PropertyGroup>
   <!-- Default configurations to help VS understand the configurations -->
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"></PropertyGroup>