From 98dc145b11ce2cd81f756f81661fdf9289ff507f Mon Sep 17 00:00:00 2001 From: Jimmy Thomson Date: Wed, 22 Nov 2017 10:10:40 -0800 Subject: [PATCH 1/3] Tweaking ETW manifest for easier auto-generation of LTTng bindings By placing structs at the end, it is simpler to generate the LTTng bindings There was also a redundant ETW event parameter which was confusing the generator. --- lib/Jsrt/JsrtSourceHolder.cpp | 4 +-- lib/Runtime/Base/ScriptContext.cpp | 4 +-- ...osoft-Scripting-Chakra-Instrumentation.man | 29 ++++++++----------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/lib/Jsrt/JsrtSourceHolder.cpp b/lib/Jsrt/JsrtSourceHolder.cpp index d60cac3df00..21aef9c7200 100644 --- a/lib/Jsrt/JsrtSourceHolder.cpp +++ b/lib/Jsrt/JsrtSourceHolder.cpp @@ -113,7 +113,7 @@ namespace Js #if ENABLE_DEBUG_CONFIG_OPTIONS AssertMsg(reasonString != nullptr, "Reason string for why we are mapping the source was not provided."); - JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING((uint32)wcslen(reasonString), reasonString, (ushort)requestedFor)); + JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING(reasonString, (ushort)requestedFor)); #endif } @@ -285,7 +285,7 @@ namespace Js #if ENABLE_DEBUG_CONFIG_OPTIONS AssertMsg(reasonString != nullptr, "Reason string for why we are mapping the source was not provided."); - JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING((uint32)wcslen(reasonString), reasonString, (ushort)requestedFor)); + JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING(reasonString, (ushort)requestedFor)); #endif } diff --git a/lib/Runtime/Base/ScriptContext.cpp b/lib/Runtime/Base/ScriptContext.cpp index 152bd4e7dd1..cdaa41dab86 100644 --- a/lib/Runtime/Base/ScriptContext.cpp +++ b/lib/Runtime/Base/ScriptContext.cpp @@ -6159,11 +6159,11 @@ void ScriptContext::RegisterPrototypeChainEnsuredToHaveOnlyWritableDataPropertie if (emitV2AsyncStackEvent) { - JS_ETW(EventWriteJSCRIPT_ASYNCCAUSALITY_STACKTRACE_V2(operationID, frameCount, nameBufferLength, sizeof(StackFrameInfo), &stackFrames.Item(0), nameBufferString)); + JS_ETW(EventWriteJSCRIPT_ASYNCCAUSALITY_STACKTRACE_V2(operationID, frameCount, nameBufferLength, nameBufferString, sizeof(StackFrameInfo), &stackFrames.Item(0))); } else { - JS_ETW(EventWriteJSCRIPT_STACKTRACE(operationID, frameCount, nameBufferLength, sizeof(StackFrameInfo), &stackFrames.Item(0), nameBufferString)); + JS_ETW(EventWriteJSCRIPT_STACKTRACE(operationID, frameCount, nameBufferLength, nameBufferString, sizeof(StackFrameInfo), &stackFrames.Item(0))); } } } diff --git a/manifests/Microsoft-Scripting-Chakra-Instrumentation.man b/manifests/Microsoft-Scripting-Chakra-Instrumentation.man index 1dede1bec40..1255d4ef791 100644 --- a/manifests/Microsoft-Scripting-Chakra-Instrumentation.man +++ b/manifests/Microsoft-Scripting-Chakra-Instrumentation.man @@ -1614,6 +1614,11 @@ inType="win:UInt16" name="NameBufferCount" /> + -