Skip to content

Commit 98dc145

Browse files
committed
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.
1 parent 24256fb commit 98dc145

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

lib/Jsrt/JsrtSourceHolder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace Js
113113

114114
#if ENABLE_DEBUG_CONFIG_OPTIONS
115115
AssertMsg(reasonString != nullptr, "Reason string for why we are mapping the source was not provided.");
116-
JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING((uint32)wcslen(reasonString), reasonString, (ushort)requestedFor));
116+
JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING(reasonString, (ushort)requestedFor));
117117
#endif
118118
}
119119

@@ -285,7 +285,7 @@ namespace Js
285285

286286
#if ENABLE_DEBUG_CONFIG_OPTIONS
287287
AssertMsg(reasonString != nullptr, "Reason string for why we are mapping the source was not provided.");
288-
JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING((uint32)wcslen(reasonString), reasonString, (ushort)requestedFor));
288+
JS_ETW(EventWriteJSCRIPT_SOURCEMAPPING(reasonString, (ushort)requestedFor));
289289
#endif
290290
}
291291

lib/Runtime/Base/ScriptContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6159,11 +6159,11 @@ void ScriptContext::RegisterPrototypeChainEnsuredToHaveOnlyWritableDataPropertie
61596159

61606160
if (emitV2AsyncStackEvent)
61616161
{
6162-
JS_ETW(EventWriteJSCRIPT_ASYNCCAUSALITY_STACKTRACE_V2(operationID, frameCount, nameBufferLength, sizeof(StackFrameInfo), &stackFrames.Item(0), nameBufferString));
6162+
JS_ETW(EventWriteJSCRIPT_ASYNCCAUSALITY_STACKTRACE_V2(operationID, frameCount, nameBufferLength, nameBufferString, sizeof(StackFrameInfo), &stackFrames.Item(0)));
61636163
}
61646164
else
61656165
{
6166-
JS_ETW(EventWriteJSCRIPT_STACKTRACE(operationID, frameCount, nameBufferLength, sizeof(StackFrameInfo), &stackFrames.Item(0), nameBufferString));
6166+
JS_ETW(EventWriteJSCRIPT_STACKTRACE(operationID, frameCount, nameBufferLength, nameBufferString, sizeof(StackFrameInfo), &stackFrames.Item(0)));
61676167
}
61686168
}
61696169
}

manifests/Microsoft-Scripting-Chakra-Instrumentation.man

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,11 @@
16141614
inType="win:UInt16"
16151615
name="NameBufferCount"
16161616
/>
1617+
<data
1618+
inType="win:UnicodeString"
1619+
length="NameBufferCount"
1620+
name="NameBuffer"
1621+
/>
16171622
<struct
16181623
count="FrameCount"
16191624
name="Frames"
@@ -1635,11 +1640,6 @@
16351640
name="NameIndex"
16361641
/>
16371642
</struct>
1638-
<data
1639-
inType="win:UnicodeString"
1640-
length="NameBufferCount"
1641-
name="NameBuffer"
1642-
/>
16431643
</template>
16441644
<template tid="Element_Zero">
16451645
<data
@@ -1836,7 +1836,12 @@
18361836
inType="win:UInt32"
18371837
name="FrameNameBufferCount"
18381838
/>
1839-
<struct
1839+
<data
1840+
inType="win:UnicodeString"
1841+
length="FrameNameBufferCount"
1842+
name="FrameNameBuffer"
1843+
/>
1844+
<struct
18401845
count="FrameCount"
18411846
name="Frames"
18421847
>
@@ -1862,11 +1867,6 @@
18621867
name="IsFrameNameIndex"
18631868
/>
18641869
</struct>
1865-
<data
1866-
inType="win:UnicodeString"
1867-
length="FrameNameBufferCount"
1868-
name="FrameNameBuffer"
1869-
/>
18701870
</template>
18711871
<template tid="JscriptHostNativeModuleLoad">
18721872
<data
@@ -1912,13 +1912,8 @@
19121912
/>
19131913
</template>
19141914
<template tid="JScriptSourceMappingInfo">
1915-
<data
1916-
inType="win:UInt32"
1917-
name="ReasonBufferCount"
1918-
/>
19191915
<data
19201916
inType="win:UnicodeString"
1921-
length="ReasonBufferCount"
19221917
name="ReasonBuffer"
19231918
/>
19241919
<data
@@ -4092,4 +4087,4 @@
40924087
</stringTable>
40934088
</resources>
40944089
</localization>
4095-
</instrumentationManifest>
4090+
</instrumentationManifest>

0 commit comments

Comments
 (0)