Example #1
0
 private void AlloccationDiff2Window()
 {
     clearTableStyle();
     createTableStyle();
     strFilter          = "prevIncl >= 0";
     strtypeFilter      = "prevExcl >= 0";
     rdbDetail0.Checked = true;
     InitDataGridBinding();
     diffcallTreeForm         = new DiffCallTreeForm(_allocDiff.Root, _allocDiff);
     diffcallTreeForm.Visible = true;
 }
Example #2
0
		private void AlloccationDiff2Window()
		{
			clearTableStyle();
			createTableStyle();
			strFilter = "prevIncl >= 0"; 
			strtypeFilter = "prevExcl >= 0"; 
			rdbDetail0.Checked = true;
			InitDataGridBinding();
			diffcallTreeForm = new DiffCallTreeForm(_allocDiff.Root, _allocDiff);
			diffcallTreeForm.Visible = true;
			
		}
Example #3
0
		private void ViewCallTrace(string name, int prevIncl, int currIncl, int diffIncl)
		{
			if(name == "<root>")
			{
				diffcallTreeForm = new DiffCallTreeForm(_allocDiff.Root, _allocDiff);
				return;
			}
						
			DiffDataNode root = new DiffDataNode(name);
			DiffDataNode tmproot = new DiffDataNode(name);
			tmproot.mapname = name;
			root.mapname = name;
			root.prevIncl = prevIncl;
			root.currIncl = currIncl;
			root.diffIncl = diffIncl;

			root.currFunId = -1;
			root.prevFunId = -1;
			string diffkey = null;
			string filter = null;
			DataRow[] rRoot = null;
			
			if(_allocDiff._currcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash.ContainsKey(name))
			{
				root.currFunId = _allocDiff._currcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash[name];
			}
			if(_allocDiff._prevcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash.ContainsKey(name))
			{
				root.prevFunId = _allocDiff._prevcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash[name];
			}
			if(!(root.prevFunId == -1 && root.currFunId == -1))
			{
				filter = "(prevIncl = " + prevIncl + ") and (currIncl = " + currIncl + ") and (prevFunId = " + root.prevFunId + ") and (currFunId = " + root.currFunId + ")";
				rRoot = _allocDiff.summaryTracetbl.Select(filter, "depth asc");
				
				if(rRoot.Length ==0 )
				{
					filter = "(prevFunId = " + root.prevFunId + ") or (currFunId = " + root.currFunId + ")";
					rRoot = _allocDiff.summaryTracetbl.Select(filter, "depth asc");
					
					if(rRoot.Length == 0)
					{
						filter = "(currFunId = " + root.currFunId + ") and (prevFunId = -1)";
						rRoot = _allocDiff.summaryTracetbl.Select(filter, "depth asc");
						
						if(rRoot.Length == 0)
						{
							filter = "(prevFunId = " + root.prevFunId + ") and (currFunId = -1)";
							rRoot = _allocDiff.summaryTracetbl.Select(filter, "depth asc");
							if(rRoot.Length == 0)
							{
								filter = null;
							}
						}
					}
				}
			}
		
			if(filter != null)
			{
				if(rRoot.Length == 1)
				{
					tmproot = _allocDiff.Row2Node(rRoot[0]);
					diffkey = tmproot.mapname + tmproot.prevIncl + tmproot.currIncl + tmproot.diffIncl + tmproot.prevFunId + tmproot.currFunId;
					root = _allocDiff.diffCallTreeNodes[diffkey] as DiffDataNode;
				}
				else if(rRoot.Length > 1 )
				{
					long sum = 0;
					string depth = null;
					long diffincl = 0;
					Hashtable depLst = new Hashtable();
					Hashtable depSum = new Hashtable();
					for(int i = 0; i < rRoot.Length; i++)
					{
						depth = rRoot[i][idx_depth].ToString();
						diffincl= long.Parse(rRoot[i][idx_diffIncl].ToString());
						sum += diffincl;
						if(depLst.Contains(depth))
						{
							ArrayList alst = (ArrayList)depLst[depth];
							alst.Add(rRoot[i]);
							depLst[depth] = alst;
							diffincl += (long)depSum[depth];
						}
						else
						{
							ArrayList alst = new ArrayList();
							alst.Add(rRoot[i]);							
							depLst.Add(depth, alst);
							depSum.Add(depth, diffincl);
						}
						if(diffincl == root.diffIncl)
							break;
					}
					
					if(sum != root.diffIncl && diffincl == root.diffIncl )
					{
						if(depLst.ContainsKey(depth))
						{
							ArrayList lst = (ArrayList)depLst[depth];
							for(int i = 0; i < lst.Count; i++)
							{
								DataRow r = (DataRow)lst[i];
								tmproot = _allocDiff.Row2Node(r);
								diffkey = tmproot.mapname + tmproot.prevIncl + tmproot.currIncl + tmproot.diffIncl + tmproot.prevFunId + tmproot.currFunId;
								DiffDataNode subRoot =  _allocDiff.diffCallTreeNodes[diffkey] as DiffDataNode;
								root.allkids.Add(subRoot);
							}
						}
					}
					else
					{

						for(int i = 0; i < rRoot.Length; i++)
						{
							tmproot = _allocDiff.Row2Node(rRoot[i]);
							if(tmproot.depth > 0)
							{
								diffkey = tmproot.mapname + tmproot.prevIncl + tmproot.currIncl + tmproot.diffIncl + tmproot.prevFunId + tmproot.currFunId;
								DiffDataNode subRoot =  _allocDiff.diffCallTreeNodes[diffkey] as DiffDataNode;
								root.allkids.Add(subRoot);
							}
						}
					}
					root.HasKids = true;
					root.depth = 0;

				}
				diffcallTreeForm.Close();
				diffcallTreeForm = new DiffCallTreeForm(root, _allocDiff);
			}
			
		}
Example #4
0
        private void ViewCallTrace([NotNull] string name, int prevIncl, int currIncl, int diffIncl)
        {
            if (name == "<root>")
            {
                diffcallTreeForm = new DiffCallTreeForm(_allocDiff.Root, _allocDiff);
                return;
            }

            var root = new DiffDataNode(name);

            root.mapname   = name;
            root.prevIncl  = prevIncl;
            root.currIncl  = currIncl;
            root.diffIncl  = diffIncl;
            root.currFunId = -1;
            root.prevFunId = -1;

            var tmproot = new DiffDataNode(name);

            tmproot.mapname = name;
            string filter = null;

            DataRow[] rRoot = null;

            if (_allocDiff._currcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash.ContainsKey(name))
            {
                root.currFunId = _allocDiff._currcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash[name];
            }
            if (_allocDiff._prevcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash.ContainsKey(name))
            {
                root.prevFunId = _allocDiff._prevcallTrace.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash[name];
            }
            if (!(root.prevFunId == -1 && root.currFunId == -1))
            {
                filter = "(prevIncl = " + prevIncl + ") and (currIncl = " + currIncl + ") and (prevFunId = " + root.prevFunId + ") and (currFunId = " + root.currFunId + ")";
                rRoot  = _allocDiff.summaryTracetbl.Select(filter, "depth asc");

                if (rRoot.Length == 0)
                {
                    filter = "(prevFunId = " + root.prevFunId + ") or (currFunId = " + root.currFunId + ")";
                    rRoot  = _allocDiff.summaryTracetbl.Select(filter, "depth asc");

                    if (rRoot.Length == 0)
                    {
                        filter = "(currFunId = " + root.currFunId + ") and (prevFunId = -1)";
                        rRoot  = _allocDiff.summaryTracetbl.Select(filter, "depth asc");

                        if (rRoot.Length == 0)
                        {
                            filter = "(prevFunId = " + root.prevFunId + ") and (currFunId = -1)";
                            rRoot  = _allocDiff.summaryTracetbl.Select(filter, "depth asc");
                            if (rRoot.Length == 0)
                            {
                                filter = null;
                            }
                        }
                    }
                }
            }

            if (filter != null)
            {
                string diffkey;
                if (rRoot.Length == 1)
                {
                    tmproot = _allocDiff.Row2Node(rRoot[0]);
                    diffkey = tmproot.mapname + tmproot.prevIncl + tmproot.currIncl + tmproot.diffIncl + tmproot.prevFunId + tmproot.currFunId;
                    root    = _allocDiff.diffCallTreeNodes[diffkey] as DiffDataNode;
                }
                else if (rRoot.Length > 1)
                {
                    long   sum      = 0;
                    string depth    = null;
                    long   diffincl = 0;
                    var    depLst   = new Hashtable();
                    var    depSum   = new Hashtable();
                    for (int i = 0; i < rRoot.Length; i++)
                    {
                        depth    = rRoot[i][idx_depth].ToString();
                        diffincl = long.Parse(rRoot[i][idx_diffIncl].ToString());
                        sum     += diffincl;
                        if (depLst.Contains(depth))
                        {
                            var alst = (List <DataRow>)depLst[depth];
                            alst.Add(rRoot[i]);
                            depLst[depth] = alst;
                            diffincl     += (long)depSum[depth];
                        }
                        else
                        {
                            var alst = new List <DataRow>();
                            alst.Add(rRoot[i]);
                            depLst.Add(depth, alst);
                            depSum.Add(depth, diffincl);
                        }
                        if (diffincl == root.diffIncl)
                        {
                            break;
                        }
                    }

                    Debug.Assert(root.allkids != null);
                    if (sum != root.diffIncl && diffincl == root.diffIncl)
                    {
                        Debug.Assert(depth != null);
                        if (depLst.ContainsKey(depth))
                        {
                            var lst = (List <DataRow>)depLst[depth];
                            for (int i = 0; i < lst.Count; i++)
                            {
                                var r = lst[i];
                                tmproot = _allocDiff.Row2Node(r);
                                diffkey = tmproot.mapname + tmproot.prevIncl + tmproot.currIncl + tmproot.diffIncl + tmproot.prevFunId + tmproot.currFunId;
                                var subRoot = (DiffDataNode)_allocDiff.diffCallTreeNodes[diffkey];
                                root.allkids.Add(subRoot);
                            }
                        }
                    }
                    else
                    {
                        for (int i = 0; i < rRoot.Length; i++)
                        {
                            tmproot = _allocDiff.Row2Node(rRoot[i]);
                            if (tmproot.depth > 0)
                            {
                                diffkey = tmproot.mapname + tmproot.prevIncl + tmproot.currIncl + tmproot.diffIncl + tmproot.prevFunId + tmproot.currFunId;
                                var subRoot = (DiffDataNode)_allocDiff.diffCallTreeNodes[diffkey];
                                root.allkids.Add(subRoot);
                            }
                        }
                    }
                    root.HasKids = true;
                    root.depth   = 0;
                }
                diffcallTreeForm.Close();
                diffcallTreeForm = new DiffCallTreeForm(root, _allocDiff);
            }
        }