Example #1
0
			public void InstanceAllocated (uint size, StackItem allocator, StackNode stack)
			{
				bytes += size;
				if (allocator != null) {
					if (Allocations.ContainsKey (allocator))
						Allocations [allocator]++;
					else
						Allocations [allocator] = 1;
				}
				if (stack != null) {
					if (AllocationsByStack.ContainsKey (stack))
						AllocationsByStack [stack]++;
					else
						AllocationsByStack [stack] = 1;
				}
			}
Example #2
0
		void AddMethod (MethodInfo method_info)
		{
			if (method_info.Id >= methods.Length) {
				StackItem[] grow = new StackItem [((method_info.Id / 10) + 1) * 10];
				methods.CopyTo (grow, 0);
				methods = grow;
			}
			ClassItem class_item = classes [method_info.ClassId];
			string name = class_item.Name + "." + method_info.Name;
			string provider = class_item.Assembly.BaseName;
			methods [method_info.Id] = new StackItem (name, provider, method_info.IsWrapper);
		}
Example #3
0
		void AddChain (StatInfo chain, StackItem last_hit)
		{
			if (last_hit == null)
				throw new Exception ("Unexpected call chain");

			List<StackItem> items = new List<StackItem> ();
			foreach (StatInfo caller in chain.Chain)
				items.Insert (0, GetStackItem (caller));
			items.Add (last_hit);
			stack.AddTrace (items);
		}
Example #4
0
 public MethodNode(ProfileStore store, Node parent, StackItem allocator, uint count)
     : base(store, parent)
 {
     this.allocator = allocator;
     this.count = count;
 }
Example #5
0
		void AddFunction (uint id, string name, string provider)
		{
			if (id >= functions.Length) {
				StackItem[] grow = new StackItem [((id / 10) + 1) * 10];
				functions.CopyTo (grow, 0);
				functions = grow;
			}
			functions [id] = new StackItem (name, provider);
		}
Example #6
0
 public StackNode(ProfileStore store, Node parent, StackItem item)
     : base(store, parent)
 {
     this.item = item;
 }
Example #7
0
 internal StackNode(StackItem item, StackNode parent)
 {
     this.item = item;
     this.parent = parent;
 }
Example #8
0
 internal StackNode(StackItem item)
     : this(item, null)
 {
 }
Example #9
0
 StackNode FindItemInList(List<StackNode> nodes, StackItem item)
 {
     foreach (StackNode node in nodes)
         if (node.StackItem == item)
             return node;
     return null;
 }
Example #10
0
 public void PopNode(StackItem item, ulong counter)
 {
     StackNode curr = CurrentNode;
     while (curr != null && curr.StackItem != item)
         curr = curr.Parent;
     if (curr == null)
         throw new Exception ("Exiting method " + item.Name + " was not on the stack");
     curr.Cost = counter - curr.start_counter;
     CurrentNode = curr.Parent;
 }