Exemplo n.º 1
0
        private void MapThread(Messages.MapThread mapThread)
        {
            ThreadContext threadInfo = null;

            if (!m_threads.ContainsKey(mapThread.ThreadId))
            {
                threadInfo = new ThreadContext(mapThread.ThreadId, mapThread.Name, mapThread.IsAlive);
                m_threads.Add(threadInfo.ThreadId, threadInfo);
            }
            else
            {
                threadInfo       = m_threads[mapThread.ThreadId];
                threadInfo.Name  = mapThread.Name;
                threadInfo.Alive = mapThread.IsAlive;
            }

            m_data.UpdateThread(threadInfo.ThreadId, threadInfo.Alive, threadInfo.Name);
        }
Exemplo n.º 2
0
        private void ParseSample(Messages.Sample sample)
        {
            if (!m_threads.ContainsKey(sample.ThreadId))
            {
                ThreadContext info = new ThreadContext(sample.ThreadId, "", true);
                m_threads.Add(sample.ThreadId, info);
                RequestThreadMapping(sample.ThreadId);
            }

            foreach (var id in sample.Functions)
            {
                if (!m_functions.ContainsKey(id))
                {
                    RequestFunctionMapping(id);
                }
            }

            m_data.ParseSample(sample);
        }
Exemplo n.º 3
0
        private void UpdateThread(int threadId, bool alive, string name)
        {
            ThreadContext info;

            if (!m_threads.ContainsKey(threadId))
            {
                info = new ThreadContext(threadId, name != null ? name : string.Empty, alive);
                m_threads.Add(threadId, info);
            }
            else
            {
                info = m_threads[threadId];
                if (name != null)
                {
                    info.Name = name;
                }
                info.Alive = alive;
            }

            m_data.UpdateThread(threadId, alive, info.Name);
        }
Exemplo n.º 4
0
		private void UpdateThread(int threadId, bool alive, string name)
		{
			ThreadContext info;
			if(!m_threads.ContainsKey(threadId))
			{
				info = new ThreadContext(threadId, name != null ? name : string.Empty, alive);
				m_threads.Add(threadId, info);
			}
			else
			{
				info = m_threads[threadId];
				if(name != null)
					info.Name = name;
				info.Alive = alive;
			}

			m_data.UpdateThread(threadId, alive, info.Name);
		}
Exemplo n.º 5
0
		private void ParseSample(Messages.Sample sample)
		{
			if(!m_threads.ContainsKey(sample.ThreadId))
			{
				ThreadContext info = new ThreadContext(sample.ThreadId, "", true);
				m_threads.Add(sample.ThreadId, info);
				RequestThreadMapping(sample.ThreadId);
			}

			foreach(var id in sample.Functions)
			{
				if(!m_functions.ContainsKey(id))
				{
					RequestFunctionMapping(id);
				}
			}

			m_data.ParseSample(sample);
		}
Exemplo n.º 6
0
		private void FunctionEvent(MessageId id, Messages.FunctionEvent funcEvent)
		{
			ThreadContext info;
			if(!m_threads.ContainsKey(funcEvent.ThreadId))
			{
				info = new ThreadContext(funcEvent.ThreadId, "", true);
				m_threads.Add(funcEvent.ThreadId, info);
				RequestThreadMapping(funcEvent.ThreadId);
			}
			else
			{
				info = m_threads[funcEvent.ThreadId];
			}

			if(id == MessageId.MID_EnterFunction)
			{
				info.ShadowStack.Push(new Pair<int, long>(funcEvent.FunctionId, funcEvent.TimeStamp));
			}
			else if(info.ShadowStack.Count > 0)
			{
				Debug.Assert(info.ShadowStack.Peek().First == funcEvent.FunctionId);
				Pair<int, long> funcStart = info.ShadowStack.Pop();
				m_data.FunctionTiming(funcEvent.FunctionId, funcEvent.TimeStamp - funcStart.Second);
			}
		}
Exemplo n.º 7
0
		private void MapThread(Messages.MapThread mapThread)
		{
			ThreadContext threadInfo = null;
			if(!m_threads.ContainsKey(mapThread.ThreadId))
			{
				threadInfo = new ThreadContext(mapThread.ThreadId, mapThread.Name, mapThread.IsAlive);
				m_threads.Add(threadInfo.ThreadId, threadInfo);
			}
			else
			{
				threadInfo = m_threads[mapThread.ThreadId];
				threadInfo.Name = mapThread.Name;
				threadInfo.Alive = mapThread.IsAlive;
			}

			m_data.UpdateThread(threadInfo.ThreadId, threadInfo.Alive, threadInfo.Name);
		}