Преглед изворни кода

Moving custom ETW event firing out of windows specifc code

Since LTTng support replaces ETW backing functions, the code supporting
the JS-accessible custom ETW event works cross platform, if LTTng support
is compiled in. There is no need for the additional platform specific code.
Jimmy Thomson пре 8 година
родитељ
комит
41d2de91b2

+ 1 - 2
lib/Runtime/Library/GlobalObject.cpp

@@ -1621,8 +1621,7 @@ LHexError:
             return function->GetScriptContext()->GetLibrary()->GetUndefined();
         }
 
-        Js::JavascriptString* jsString = Js::JavascriptConversion::ToString(args[1], function->GetScriptContext());
-        PlatformAgnostic::EventTrace::FireGenericEventTrace(jsString->GetSz());
+        JS_ETW(EventWriteJSCRIPT_INTERNAL_GENERIC_EVENT(Js::JavascriptConversion::ToString(args[1], function->GetScriptContext())->GetSz()));
         return function->GetScriptContext()->GetLibrary()->GetUndefined();
     }
 #endif

+ 0 - 2
lib/Runtime/PlatformAgnostic/Chakra.Runtime.PlatformAgnostic.vcxproj

@@ -55,7 +55,6 @@
     <ClCompile Include="$(MSBuildThisFileDirectory)Platform\Windows\SystemInfo.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)Platform\Windows\Thread.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)Platform\Common\UnicodeText.Common.cpp" />
-    <ClCompile Include="$(MSBuildThisFileDirectory)Platform\Windows\EventTrace.cpp" />
     <ClCompile Include="$(MSBuildThisFileDirectory)Platform\Windows\PerfTrace.cpp" />
   </ItemGroup>
   <ItemGroup Condition="'$(IntlICU)'=='true'">
@@ -63,7 +62,6 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="ChakraPlatform.h" />
-    <ClInclude Include="EventTrace.h" />
     <ClInclude Include="PerfTrace.h" />
     <ClInclude Include="RuntimePlatformAgnosticPch.h" />
     <ClInclude Include="UnicodeText.h" />

+ 2 - 8
lib/Runtime/PlatformAgnostic/Chakra.Runtime.PlatformAgnostic.vcxproj.filters

@@ -1,12 +1,9 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <ClCompile Include="Platform\Windows\UnicodeText.cpp">
       <Filter>Platform\Windows</Filter>
     </ClCompile>
-    <ClCompile Include="Platform\Windows\EventTrace.cpp">
-      <Filter>Platform\Windows</Filter>
-    </ClCompile>
     <ClCompile Include="Platform\Windows\DaylightHelper.cpp">
       <Filter>Platform\Windows</Filter>
     </ClCompile>
@@ -51,9 +48,6 @@
     </ClInclude>
     <ClInclude Include="ChakraPlatform.h" />
     <ClInclude Include="RuntimePlatformAgnosticPch.h" />
-    <ClInclude Include="EventTrace.h">
-      <Filter>Interfaces</Filter>
-    </ClInclude>
     <ClInclude Include="PerfTrace.h">
       <Filter>Interfaces</Filter>
     </ClInclude>
@@ -61,4 +55,4 @@
       <Filter>Interfaces</Filter>
     </ClInclude>
   </ItemGroup>
-</Project>
+</Project>

+ 0 - 1
lib/Runtime/PlatformAgnostic/ChakraPlatform.h

@@ -5,7 +5,6 @@
 #pragma once
 
 #include "UnicodeText.h"
-#include "EventTrace.h"
 
 // Configure whether we configure a signal handler
 // to produce perf-<pid>.map files

+ 0 - 15
lib/Runtime/PlatformAgnostic/EventTrace.h

@@ -1,15 +0,0 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-#pragma once
-
-#include "Core/CommonTypedefs.h"
-
-namespace PlatformAgnostic
-{
-    namespace EventTrace
-    {
-        void FireGenericEventTrace(const void* traceData);
-    }
-}

+ 0 - 1
lib/Runtime/PlatformAgnostic/Platform/CMakeLists.txt

@@ -4,7 +4,6 @@ set(PL_SOURCE_FILES
   Common/UnicodeText.Common.cpp
   Common/HiResTimer.cpp
   Common/DateTime.cpp
-  Linux/EventTrace.cpp
   Linux/UnicodeText.ICU.cpp
   Linux/NumbersUtility.cpp
   Linux/Thread.cpp

+ 0 - 18
lib/Runtime/PlatformAgnostic/Platform/Linux/EventTrace.cpp

@@ -1,18 +0,0 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-#include "RuntimePlatformAgnosticPch.h"
-#include "CommonPal.h"
-
-namespace PlatformAgnostic
-{
-    namespace EventTrace
-    {
-        void FireGenericEventTrace(const void* /*traceData*/)
-        {
-            // TODO: Implement this on Linux
-        }
-    } // namespace EventTrace
-} // namespace PlatformAgnostic

+ 0 - 19
lib/Runtime/PlatformAgnostic/Platform/Windows/EventTrace.cpp

@@ -1,19 +0,0 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-#include "RuntimePlatformAgnosticPch.h"
-#include "Common.h"
-#include "ChakraPlatform.h"
-
-namespace PlatformAgnostic
-{
-    namespace EventTrace
-    {
-        void FireGenericEventTrace(const void* traceData)
-        {
-            JS_ETW(EventWriteJSCRIPT_INTERNAL_GENERIC_EVENT(static_cast<const char16*>(traceData)));
-        }
-    }
-}