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; } }
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); }
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); }
public MethodNode(ProfileStore store, Node parent, StackItem allocator, uint count) : base(store, parent) { this.allocator = allocator; this.count = count; }
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); }
public StackNode(ProfileStore store, Node parent, StackItem item) : base(store, parent) { this.item = item; }
internal StackNode(StackItem item, StackNode parent) { this.item = item; this.parent = parent; }
internal StackNode(StackItem item) : this(item, null) { }
StackNode FindItemInList(List<StackNode> nodes, StackItem item) { foreach (StackNode node in nodes) if (node.StackItem == item) return node; return null; }
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; }