Skip to content

Commit 6d3822c

Browse files
joaocgreisMyles Borins
authored and
Myles Borins
committed
etw: fix descriptors of events 9 and 23
Event 9 must include the string terminator in the last descriptor. Event 23 must be published with no descriptors, in accordance with the manifest. PR-URL: #5742 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent aadf356 commit 6d3822c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/node_win32_etw_provider-inl.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ extern int events_enabled;
9494
dataDescriptors); \
9595
CHECK_EQ(status, ERROR_SUCCESS);
9696

97+
#define ETW_WRITE_EMPTY_EVENT(eventDescriptor) \
98+
DWORD status = event_write(node_provider, \
99+
&eventDescriptor, \
100+
0, \
101+
NULL); \
102+
CHECK_EQ(status, ERROR_SUCCESS);
103+
97104

98105
void NODE_HTTP_SERVER_REQUEST(node_dtrace_http_server_request_t* req,
99106
node_dtrace_connection_t* conn, const char *remote, int port,
@@ -189,10 +196,7 @@ void NODE_V8SYMBOL_MOVE(const void* addr1, const void* addr2) {
189196

190197
void NODE_V8SYMBOL_RESET() {
191198
if (events_enabled > 0) {
192-
int val = 0;
193-
EVENT_DATA_DESCRIPTOR descriptors[1];
194-
ETW_WRITE_INT32_DATA(descriptors, &val);
195-
ETW_WRITE_EVENT(NODE_V8SYMBOL_RESET_EVENT, descriptors);
199+
ETW_WRITE_EMPTY_EVENT(NODE_V8SYMBOL_RESET_EVENT);
196200
}
197201
}
198202

@@ -244,7 +248,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol,
244248
line,
245249
col,
246250
symbuf,
247-
symbol_len * sizeof(symbuf[0]));
251+
(symbol_len + 1) * sizeof(symbuf[0]));
248252
ETW_WRITE_EVENT(MethodLoad, descriptors);
249253
}
250254
}

0 commit comments

Comments
 (0)