private static void DumpStack(AddressStack stack, MethodStore methods) { var callstack = stack.Stack; for (int i = 0; i < Math.Min(10, callstack.Count); i++) { Console.WriteLine($" {methods.GetFullName(callstack[i])}"); } }
public void AddStack(int threadID, AddressStack stack) { if (_perThreadLastAllocation.TryGetValue(threadID, out var lastAlloc)) { lastAlloc.AddStack(stack); _perThreadLastAllocation.Remove(threadID); return; } //Console.WriteLine("no last allocation for the stack event"); }
internal void AddStack(AddressStack stack) { var info = GetInfo(stack); if (info == null) { info = new StackInfo(stack); _stacks.Add(info); } info.Count++; }
private StackInfo GetInfo(AddressStack stack) { for (int i = 0; i < _stacks.Count; i++) { var info = _stacks[i]; if (stack.Equals(info.Stack)) { return(info); } } return(null); }
private AddressStack BuildCallStack(ClrStackWalkTraceData data) { var length = data.FrameCount; AddressStack stack = new AddressStack(length); // frame 0 is the last frame of the stack (i.e. last called method) for (int i = 0; i < length; i++) { stack.AddFrame(data.InstructionPointer(i)); } return(stack); }
internal StackInfo(AddressStack stack) { Count = 0; _stack = stack; }