From 16c7b54543bf5953a960a04d6e15cc9659db27fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Fri, 22 Sep 2017 20:10:52 +0100 Subject: [PATCH 1/2] src,etw: fix event 9 on 64 bit Windows The event manifest specifies the MethodID field as a 32 bit integer. The 32 bit node executable publishes this correctly, but the 64 bit executable publishes a 64 bit integer, making the event undecodable. --- src/node_win32_etw_provider-inl.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h index 9e3f088ff485db..e841a485fb64dc 100644 --- a/src/node_win32_etw_provider-inl.h +++ b/src/node_win32_etw_provider-inl.h @@ -27,12 +27,6 @@ #include "node_win32_etw_provider.h" #include "node_etw_provider.h" -#if defined(_WIN64) -# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT64_DATA -#else -# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT32_DATA -#endif - namespace node { // From node_win32_etw_provider.cc @@ -100,7 +94,7 @@ extern int events_enabled; ETW_WRITE_ADDRESS_DATA(descriptors, &context); \ ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \ ETW_WRITE_INT64_DATA(descriptors + 2, &size); \ - ETW_WRITE_INTPTR_DATA(descriptors + 3, &id); \ + ETW_WRITE_INT32_DATA(descriptors + 3, &id); \ ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \ ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \ ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \ @@ -253,7 +247,11 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol, } void* context = nullptr; INT64 size = (INT64)len; - INT_PTR id = (INT_PTR)addr1; +#if defined(_WIN64) + INT32 id = 0; +#else + INT32 id = (INT32)addr1; +#endif INT16 flags = 0; INT16 rangeid = 1; INT32 col = 1; From 4b29fffb85b41b3e7806a594b37ec1a6a0c74ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Tue, 26 Sep 2017 23:51:32 +0100 Subject: [PATCH 2/2] fixup! always use addr1 --- src/node_win32_etw_provider-inl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h index e841a485fb64dc..3c90bee67d26f3 100644 --- a/src/node_win32_etw_provider-inl.h +++ b/src/node_win32_etw_provider-inl.h @@ -247,11 +247,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol, } void* context = nullptr; INT64 size = (INT64)len; -#if defined(_WIN64) - INT32 id = 0; -#else INT32 id = (INT32)addr1; -#endif INT16 flags = 0; INT16 rangeid = 1; INT32 col = 1;