예제 #1
0
        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));
            }
        }
예제 #2
0
 AllocEvent(LogFileReader reader, byte extendedInfo)
 {
     TimeDiff = reader.ReadULeb128();
     Ptr      = reader.ReadSLeb128();
     Obj      = reader.ReadSLeb128();
     Size     = reader.ReadULeb128();
     if ((extendedInfo & TYPE_ALLOC_BT) != 0)
     {
         Backtrace = new Backtrace(reader);
     }
 }
예제 #3
0
        public readonly string Name;         // full method name

        MethodEvent(LogFileReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128();
            Method   = reader.ReadSLeb128();
            Type     = (MethodType)exinfo;
            if (Type == MethodType.Jit)
            {
                CodeAddress = reader.ReadSLeb128();
                CodeSize    = reader.ReadULeb128();
                Name        = reader.ReadNullTerminatedString();
            }
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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();
                }
            }
        }
예제 #6
0
        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));
            }
        }
예제 #7
0
        public readonly long ObjAddr;         // object pointer differences from obj_base

        HandleCreatedGcEvent(LogFileReader reader)
        {
            TimeDiff   = reader.ReadULeb128();
            HandleType = reader.ReadULeb128();
            Handle     = reader.ReadULeb128();
            ObjAddr    = reader.ReadSLeb128();
        }
예제 #8
0
 public UBinSampleEvent(LogFileReader reader)
 {
     TimeDiff = reader.ReadULeb128();
     Address  = reader.ReadSLeb128();
     Offset   = reader.ReadULeb128();
     Size     = reader.ReadULeb128();
     Name     = reader.ReadNullTerminatedString();
 }
예제 #9
0
 public RuntimeJitHelperEvent(LogFileReader reader) : base(reader)
 {
     Type          = reader.ReadULeb128();
     BufferAddress = reader.ReadSLeb128();
     BufferSize    = reader.ReadULeb128();
     if (Type == (ulong)MonoProfilerCodeBufferType.MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE)
     {
         Name = reader.ReadNullTerminatedString();
     }
 }
예제 #10
0
        ExceptionEvent(LogFileReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128();
            byte subtype = (byte)(exinfo & 0x70);

            if (subtype == TYPE_CLAUSE)
            {
                ClauseType = reader.ReadULeb128();
                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);
                }
            }
        }
예제 #11
0
        MonitiorEvent(LogFileReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128();
            Object   = reader.ReadSLeb128();
            byte ev = (byte)((exinfo >> 4) & 0x3);

            if (ev == MONO_PROFILER_MONITOR_CONTENTION && (exinfo & TYPE_MONITOR_BT) == TYPE_MONITOR_BT)
            {
                Backtrace = new Backtrace(reader);
            }
        }
예제 #12
0
        public Backtrace(LogFileReader reader)
        {
//			Flags = reader.ReadULeb128 ();
            ulong num = reader.ReadULeb128();

            Frame = new long[num];
            for (ulong i = 0; i < num; i++)
            {
                Frame [i] = reader.ReadSLeb128();
            }
        }
예제 #13
0
        public readonly long ObjAddr;         // object pointer differences from obj_base

        HandleCreatedGcEvent(LogFileReader reader, byte exinfo)
        {
            TimeDiff   = reader.ReadULeb128();
            HandleType = reader.ReadULeb128();
            Handle     = reader.ReadULeb128();
            ObjAddr    = reader.ReadSLeb128();
            if (exinfo == TYPE_GC_HANDLE_CREATED_BT)
            {
                new Backtrace(reader);
            }
        }
예제 #14
0
        public readonly long[] ObjAddr;         //  num_objects object pointer differences from obj_base

        MoveGcEvent(LogFileReader reader)
        {
            TimeDiff = reader.ReadULeb128();
            ulong num = reader.ReadULeb128();

            ObjAddr = new long[num];
            for (ulong i = 0; i < num; i++)
            {
                ObjAddr [i] = reader.ReadSLeb128();
            }
        }
예제 #15
0
        public HitSampleEvent(LogFileReader reader)
        {
            SampleType = (SampleType)reader.ReadULeb128();
            Timestamp  = reader.ReadULeb128();
            ulong count = reader.ReadULeb128();

            InstructionPointers = new long [count];
            for (uint n = 0; n < count; n++)
            {
                InstructionPointers [n] = reader.ReadSLeb128();
            }
        }
예제 #16
0
        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();
        }
예제 #17
0
        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;
            }
        }
예제 #18
0
        public readonly long Object; // object pointer differences from obj_base

        HandleFinalizeObjectEvent(LogFileReader reader, byte exinfo)
        {
            TimeDiff = reader.ReadULeb128();
            Object   = reader.ReadSLeb128();
        }
예제 #19
0
 public USymSampleEvent(LogFileReader reader)
 {
     Address = reader.ReadSLeb128();
     Size    = reader.ReadULeb128();
     Name    = reader.ReadNullTerminatedString();
 }