Exemple #1
0
        public static Event CreateEvent(LogFileReader reader, EventType type, byte extendedInfo)
        {
            switch (type)
            {
            case EventType.Alloc:
                return(AllocEvent.Read(reader, extendedInfo));

            case EventType.Exception:
                return(ExceptionEvent.Read(reader, extendedInfo));

            case EventType.Gc:
                switch (extendedInfo)
                {
                case TYPE_GC_EVENT:
                    return(GcEvent.Read(reader));

                case TYPE_GC_RESIZE:
                    return(ResizeGcEvent.Read(reader));

                case TYPE_GC_MOVE:
                    return(MoveGcEvent.Read(reader));

                case TYPE_GC_HANDLE_CREATED:
                case TYPE_GC_HANDLE_CREATED_BT:
                    return(HandleCreatedGcEvent.Read(reader, extendedInfo));

                case TYPE_GC_HANDLE_DESTROYED:
                case TYPE_GC_HANDLE_DESTROYED_BT:
                    return(HandleDestroyedGcEvent.Read(reader, extendedInfo));
                }
                throw new InvalidOperationException("unknown gc type:" + extendedInfo);

            case EventType.Heap:
                return(HeapEvent.Read(reader, extendedInfo));

            case EventType.Metadata:
                return(MetadataEvent.Read(reader, extendedInfo));

            case EventType.Method:
                return(MethodEvent.Read(reader, extendedInfo));

            case EventType.Monitor:
                return(MonitiorEvent.Read(reader, extendedInfo));

            case EventType.Sample:
                return(SampleEvent.Read(reader, extendedInfo));

            case EventType.Runtime:
                return(RuntimeEvent.Read(reader, extendedInfo));

            case EventType.Coverage:
                return(CoverageEvent.Read(reader, extendedInfo));
            }
            throw new InvalidOperationException("invalid event type " + type);
        }
		public virtual object Visit (MethodEvent methodEvent)
		{
			return null;
		}
			public override object Visit (MethodEvent methodEvent)
			{
				methodBase += methodEvent.Method;
				TimeBase += methodEvent.TimeDiff;
				switch (methodEvent.Type) {
				case MethodEvent.MethodType.Jit:
					nameDictionary [methodBase] = methodEvent.Name;
					break;
				
				case MethodEvent.MethodType.Enter:
					if (ShouldLog) {
						eventCount++;
						if (!nameDictionary.ContainsKey (methodBase))
							nameDictionary [methodBase] = "[Unknown method]";
						
						currentThread.PushMethod (methodBase, TimeBase);
					}
					break;
				
				case MethodEvent.MethodType.Leave:
					if (ShouldLog) {
						if (!nameDictionary.ContainsKey (methodBase))
							nameDictionary [methodBase] = "[Unknown method]";
						currentThread.PopMethod (methodBase, TimeBase);
					}
					break;
				}
				return null;
			}
Exemple #4
0
 public virtual object Visit(MethodEvent methodEvent)
 {
     return(null);
 }