public void Parse <T>(EventRecordReader reader, T writer, EventMetadata[] metadataArray, RuntimeEventMetadata runtimeMetadata) where T : IEtwWriter { writer.WriteEventBegin(EventMetadata, runtimeMetadata); int pointerSize = (runtimeMetadata.Flags & Etw.EVENT_HEADER_FLAG_32_BIT_HEADER) != 0 ? 4 : 8; int numberOfStacks = (runtimeMetadata.UserDataLength - 16) / pointerSize; writer.WritePropertyBegin(EventTimeStampMetadata); writer.WriteUInt64(reader.ReadUInt64()); writer.WritePropertyEnd(); writer.WritePropertyBegin(StackProcessMetadata); writer.WriteUInt32(reader.ReadUInt32()); writer.WritePropertyEnd(); writer.WritePropertyBegin(StackThreadMetadata); writer.WriteUInt32(reader.ReadUInt32()); writer.WritePropertyBegin(StacksPropertyMetadata); writer.WriteArrayBegin(); for (int i = 0; i < numberOfStacks; ++i) { writer.WritePointer(reader.ReadPointer()); } writer.WriteArrayEnd(); writer.WritePropertyEnd(); writer.WriteEventEnd(); }
public void Parse <T>(EventRecordReader reader, T writer, EventMetadata[] metadataArray, RuntimeEventMetadata runtimeMetadata) where T : IEtwWriter { writer.WriteEventBegin(EventMetadata, runtimeMetadata); writer.WritePropertyBegin(ImageBase); writer.WriteUInt64(reader.ReadUInt64()); writer.WritePropertyEnd(); writer.WritePropertyBegin(ProcessId); writer.WriteUInt32(reader.ReadUInt32()); writer.WritePropertyEnd(); writer.WritePropertyBegin(GuidSig); writer.WriteGuid(reader.ReadGuid()); writer.WritePropertyEnd(); writer.WritePropertyBegin(Age); writer.WriteUInt32(reader.ReadUInt32()); writer.WritePropertyEnd(); writer.WritePropertyBegin(PdbFileName); writer.WriteAnsiString(reader.ReadAnsiString()); writer.WritePropertyEnd(); writer.WriteEventEnd(); }