Пример #1
0
		private void BuildBaseData(GraphBase gb, CallTreeForm tmpcallTree,  Hashtable htbl, Hashtable FuncExcl, Hashtable TypeExcl)
		{
			Vertex selectedVertex;
			int selectedVertexCount = gb.SelectedVertexCount(out selectedVertex);
			int id = 1;
			
			string nameAndSignature = null;
			datanode n = new datanode();


			try
			{
				foreach (Vertex v in gb.basegraph.vertices.Values)
				{
					if( !v.name.StartsWith("????"))
					{
						if (v.selected || (selectedVertexCount == 0) )
						{
							nameAndSignature  = v.name;
							if(v.signature != null)
								nameAndSignature += ' ' + v.signature;
							n.name = nameAndSignature;
							n.incl = FormatSize((int)v.weight);
							n.caller = v.incomingEdges;
							n.callee = v.outgoingEdges;
							n.level = v.level;
							n.excl = 0;
							n.timesBeenCalled= n.timesMakeCalls = 0;
							FillCallAlloc(ref n, v);
							if(tmpcallTree.LogResult.allocatedHistogram.readNewLog.funcSignatureIdHash.ContainsKey(nameAndSignature))
							{
								n.category = 1;	// func
								id = tmpcallTree.LogResult.callstackHistogram.readNewLog.funcSignatureIdHash[nameAndSignature];
								if(FuncExcl.ContainsKey(nameAndSignature))
								{
									n.excl =  FormatSize((int)FuncExcl[nameAndSignature]);
								}
								if( id > 0 && id <tmpcallTree.CallStats.Length)
								{

									n.timesBeenCalled = (int)tmpcallTree.CallStats[id].timesCalled;
									n.timesMakeCalls = (int)tmpcallTree.CallStats[id].totalFunctionsCalled;
								}
								if( !htbl.ContainsKey(nameAndSignature))
								{
									htbl.Add(nameAndSignature, n);
								}
							}
							else if(tmpcallTree.LogResult.allocatedHistogram.readNewLog.typeSignatureIdHash.ContainsKey(nameAndSignature))
							{
								n.category = 2;	// type
								id = tmpcallTree.LogResult.allocatedHistogram.readNewLog.typeSignatureIdHash[nameAndSignature];
								if(TypeExcl.ContainsKey(nameAndSignature))
								{
									n.excl =  FormatSize((int)TypeExcl[nameAndSignature]);
								}
								if( id > 0 && id <tmpcallTree.AllocStats.Length)
								{
									n.timesBeenCalled = (int)tmpcallTree.AllocStats[id].timesAllocated;
								}
								if( !htbl.ContainsKey(nameAndSignature))
								{
									typemaxIncl = (typemaxIncl > v.weight) ? typemaxIncl : v.weight;
									htbl.Add(nameAndSignature, n);
								}
							}
							else
							{
								if( !htbl.ContainsKey(nameAndSignature))
								{
									maxIncl = v.weight;
									htbl.Add(nameAndSignature, n);
								}
							}

						}
			
					}
				}
			}
			catch
			{
				throw new Exception("Faild on build base data structure \n");
			}
			// max for caculate function/type 9 details 
			if( prevFilter.max == 0)
			{
				prevFilter.max = maxIncl;
				prevTypedeFilter.max = typemaxIncl;
			}
			else
			{
				currFilter.max = maxIncl;
				currTypedeFilter.max = typemaxIncl;
			}
			maxIncl = 0;
			typemaxIncl = 0;
		}
Пример #2
0
		public AllocationDiff()
		{
			_prevLog = new LogBase();
			_currLog = new LogBase();
			_prevG = new GraphBase();
			_currG = new GraphBase();

			ds = new DataSet();
			_prevbasedata = new Hashtable();
			_currbasedata = new Hashtable();
			

			basedataId = new Hashtable();
			Idbasedata = new Hashtable();
			basedatatable = new DataTable("basedatatbl");
			callertbl = new DataTable("caller");
			calleetbl = new DataTable("callee");
			typeAllocdataId = new Hashtable();
			ContriTocallertbl = new DataTable("ContriTocallertbl");
			ContriTocalleetbl = new DataTable("ContriTocalleetbl");
			MakeBaseDataTable(basedatatable);
			MakeCallTables(callertbl, true);
			MakeCallTables(calleetbl, false);
			MakeBaseDataTable(ContriTocallertbl);
			MakeBaseDataTable(ContriTocalleetbl);
			prevFilter = new DetailFilter();
			currFilter = new DetailFilter();
			prevTypedeFilter = new DetailFilter();
			currTypedeFilter = new DetailFilter();
		}