GcEvent(LogFileReader reader) { TimeDiff = reader.ReadULeb128(); //EventType = (GcEventType) reader.ReadULeb128 (); //Generation = reader.ReadULeb128 (); EventType = (GcEventType)reader.ReadByte(); Generation = reader.ReadByte(); }
public CounterValue(LogFileReader reader, ulong index) { Index = index; // Type = (uint)reader.ReadULeb128 (); Type = reader.ReadByte(); switch ((CounterValueType)Type) { case CounterValueType.MONO_COUNTER_STRING: if (reader.ReadULeb128() == 1) { reader.ReadNullTerminatedString(); } break; case CounterValueType.MONO_COUNTER_WORD: case CounterValueType.MONO_COUNTER_INT: case CounterValueType.MONO_COUNTER_LONG: reader.ReadSLeb128(); break; case CounterValueType.MONO_COUNTER_UINT: case CounterValueType.MONO_COUNTER_ULONG: reader.ReadULeb128(); break; case CounterValueType.MONO_COUNTER_DOUBLE: reader.ReadUInt64(); break; default: throw new ArgumentException(String.Format("Unknown Counter Value type {0} [0x{0:x8}], for counter at index {3}, near byte {1} [0x{1:x8}] of {2}.", Type, reader.Position, reader.Length, Index)); } }
ExceptionEvent(LogFileReader reader, byte exinfo) { TimeDiff = reader.ReadULeb128(); byte subtype = (byte)(exinfo & ~TYPE_EXCEPTION_BT); if (subtype == TYPE_CLAUSE) { //ClauseType = reader.ReadULeb128 (); ClauseType = reader.ReadByte(); ClauseNum = reader.ReadULeb128(); Method = reader.ReadSLeb128(); } else if (subtype == TYPE_THROW) { Object = reader.ReadSLeb128(); if ((exinfo & TYPE_EXCEPTION_BT) == TYPE_EXCEPTION_BT) { Backtrace = new Backtrace(reader); } } else { throw new InvalidOperationException("Unknown exception event type:" + (exinfo & ~TYPE_EXCEPTION_BT)); } }
public CounterSection(LogFileReader reader) { Section = reader.ReadULeb128(); if (Section == MONO_COUNTER_PERFCOUNTERS) { SectionName = reader.ReadNullTerminatedString(); } Name = reader.ReadNullTerminatedString(); //Type = reader.ReadULeb128 (); //Unit = reader.ReadULeb128 (); //Variance = reader.ReadULeb128 (); Type = reader.ReadByte(); Unit = reader.ReadByte(); Variance = reader.ReadByte(); Index = reader.ReadULeb128(); }
public static Event Read(LogFileReader reader) { byte info = reader.ReadByte(); EventType type = (EventType)(info & 0xF); byte extendedInfo = (byte)(info & 0xF0); return(CreateEvent(reader, type, extendedInfo)); }
MetaEvent(LogFileReader reader, byte exinfo) { TimeDiff = reader.ReadULeb128(); if (exinfo == TYPE_SYNC_POINT) { MonoProfilerSyncPointType = reader.ReadByte(); } }
public readonly int SysId; // operating system and architecture identifier Header(LogFileReader reader) { Id = reader.ReadInt32(); if (Id != LogHeaderId) { throw new InvalidOperationException("Id doesn't match."); } Major = reader.ReadByte(); Minor = reader.ReadByte(); Format = reader.ReadByte(); PtrSize = reader.ReadByte(); StartupTime = reader.ReadInt64(); TimerOverhead = reader.ReadInt32(); Flags = reader.ReadInt32(); Pid = reader.ReadInt32(); Port = reader.ReadUInt16(); SysId = reader.ReadUInt16(); }
public RuntimeJitHelperEvent(LogFileReader reader) : base(reader) { // Type = reader.ReadULeb128 (); Type = reader.ReadByte(); BufferAddress = reader.ReadSLeb128(); BufferSize = reader.ReadULeb128(); if (Type == (ulong)MonoProfilerCodeBufferType.MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) { Name = reader.ReadNullTerminatedString(); } }
Header(LogFileReader reader) { Console.WriteLine("hoge"); Id = reader.ReadInt32(); if (Id != LogHeaderId) { throw new InvalidOperationException("Id doesn't match."); } Major = reader.ReadByte(); Minor = reader.ReadByte(); Format = reader.ReadByte(); PtrSize = reader.ReadByte(); StartupTime = reader.ReadInt64(); TimerOverhead = reader.ReadInt32(); Flags = reader.ReadInt32(); Pid = reader.ReadInt32(); Port = reader.ReadUInt16(); // SysId = reader.ReadUInt16 (); Args = reader.ReadVarString(); Arch = reader.ReadVarString(); OS = reader.ReadVarString(); }
public readonly long Image; // MonoImage* as a pointer difference from ptr_base MetadataEvent(LogFileReader reader, byte extendedInfo) { TimeDiff = reader.ReadULeb128(); MType = (MetaDataType)reader.ReadByte(); Pointer = reader.ReadSLeb128(); switch (MType) { case MetaDataType.Class: Image = reader.ReadSLeb128(); // Flags = reader.ReadULeb128 (); Name = reader.ReadNullTerminatedString(); break; case MetaDataType.Image: // Flags = reader.ReadULeb128 (); Name = reader.ReadNullTerminatedString(); break; case MetaDataType.Assembly: // Flags = reader.ReadULeb128 (); Name = reader.ReadNullTerminatedString(); break; case MetaDataType.Thread: // Flags = reader.ReadULeb128 (); //if (reader.Header.Format < 11 || (reader.Header.Format > 10 && extendedInfo == 0)) { // Name = reader.ReadNullTerminatedString (); //} if (extendedInfo == 0) { Name = reader.ReadNullTerminatedString(); } break; case MetaDataType.Domain: // Flags = reader.ReadULeb128 (); if (extendedInfo == 0) { Name = reader.ReadNullTerminatedString(); } break; case MetaDataType.Context: // Flags = reader.ReadULeb128 (); Domain = reader.ReadSLeb128(); break; default: throw new ArgumentException("Unknown metadata type: " + MType); } }
HeapEvent(LogFileReader reader, byte exinfo) { if (exinfo == TYPE_HEAP_START) { Type = EventType.Start; TimeDiff = reader.ReadULeb128(); } else if (exinfo == TYPE_HEAP_END) { Type = EventType.End; TimeDiff = reader.ReadULeb128(); } else if (exinfo == TYPE_HEAP_ROOT) { //omanuke TimeDiff = reader.ReadULeb128(); Type = EventType.Root; ulong nroots = reader.ReadULeb128(); reader.ReadULeb128(); // gcs RootRefs = new long [nroots]; RootRefTypes = new RootType [nroots]; RootRefExtraInfos = new ulong [nroots]; for (ulong n = 0; n < nroots; n++) { RootRefs [n] = reader.ReadSLeb128(); // RootRefTypes [n] = (RootType) reader.ReadULeb128 (); RootRefTypes[n] = (RootType)reader.ReadByte(); RootRefExtraInfos[n] = reader.ReadULeb128(); } } else if (exinfo == TYPE_HEAP_OBJECT) { TimeDiff = reader.ReadULeb128(); Type = EventType.Object; Object = reader.ReadSLeb128(); Class = reader.ReadSLeb128(); Size = reader.ReadULeb128(); ulong num = reader.ReadULeb128(); ObjectRefs = new long[num]; RelOffset = new ulong[num]; for (ulong i = 0; i < num; i++) { RelOffset [i] = reader.ReadULeb128(); ObjectRefs [i] = reader.ReadSLeb128(); } } }
public HitSampleEvent(LogFileReader reader) { TimeDiff = reader.ReadULeb128(); // SampleType = (SampleType) reader.ReadULeb128 (); SampleType = (SampleType)reader.ReadByte(); //Timestamp = reader.ReadULeb128 (); Thread = reader.ReadSLeb128(); ulong count = reader.ReadULeb128(); InstructionPointers = new long [count]; for (uint n = 0; n < count; n++) { InstructionPointers [n] = reader.ReadSLeb128(); } //Xamarin.Profiler 0.34 doesn't generate data below? //ulong mcount = reader.ReadULeb128(); //Methods = new long[mcount]; //for (uint n = 0; n < mcount; n++) // Methods[n] = reader.ReadSLeb128(); }
public readonly long Image; // MonoImage* as a pointer difference from ptr_base MetadataEvent(LogFileReader reader) { TimeDiff = reader.ReadULeb128(); MType = (MetaDataType)reader.ReadByte(); Pointer = reader.ReadSLeb128(); switch (MType) { case MetaDataType.Class: Image = reader.ReadSLeb128(); Flags = reader.ReadULeb128(); Name = reader.ReadNullTerminatedString(); break; case MetaDataType.Image: Flags = reader.ReadULeb128(); Name = reader.ReadNullTerminatedString(); break; case MetaDataType.Thread: Flags = reader.ReadULeb128(); Name = reader.ReadNullTerminatedString(); break; } }