From 98ef2f588e271f928fd051e96da526dc1e0f017c Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Mon, 22 Jan 2018 17:04:27 +0100 Subject: [PATCH] include keywords in V3 of EventPipe metadata, fixes #11934 --- src/vm/eventpipeconfiguration.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vm/eventpipeconfiguration.cpp b/src/vm/eventpipeconfiguration.cpp index a74bdbc28f93..4982cb674b8d 100644 --- a/src/vm/eventpipeconfiguration.cpp +++ b/src/vm/eventpipeconfiguration.cpp @@ -432,10 +432,11 @@ EventPipeEventInstance* EventPipeConfiguration::BuildEventMetadataEvent(EventPip const SString &providerName = sourceEvent.GetProvider()->GetProviderName(); unsigned int eventID = sourceEvent.GetEventID(); unsigned int eventVersion = sourceEvent.GetEventVersion(); + INT64 keywords = sourceEvent.GetKeywords(); BYTE *pPayloadData = sourceEvent.GetMetadata(); unsigned int payloadLength = sourceEvent.GetMetadataLength(); unsigned int providerNameLength = (providerName.GetCount() + 1) * sizeof(WCHAR); - unsigned int instancePayloadSize = providerNameLength + sizeof(eventID) + sizeof(eventVersion) + sizeof(payloadLength) + payloadLength; + unsigned int instancePayloadSize = providerNameLength + sizeof(eventID) + sizeof(eventVersion) + sizeof(keywords) + sizeof(payloadLength) + payloadLength; // Allocate the payload. BYTE *pInstancePayload = new BYTE[instancePayloadSize]; @@ -455,6 +456,10 @@ EventPipeEventInstance* EventPipeConfiguration::BuildEventMetadataEvent(EventPip memcpy(currentPtr, &eventVersion, sizeof(eventVersion)); currentPtr += sizeof(eventVersion); + // Write the event keywords. + memcpy(currentPtr, &keywords, sizeof(keywords)); + currentPtr += sizeof(keywords); + // Write the size of the metadata. memcpy(currentPtr, &payloadLength, sizeof(payloadLength)); currentPtr += sizeof(payloadLength);