// Returns true if the hit must be counted (this is the first chain item) bool HandleCallChain(IStatisticalHitItem caller) { if (eventsArePartOfChain) { bool result; if (lastCallee != null) { lastCallee.CallCounts.AddCaller(caller); caller.CallCounts.AddCallee(lastCallee); } if (lastCalleeNode != null) { lastCalleeNode = lastCalleeNode.AddChild(caller); } else { lastCalleeNode = statisticalItemsByCaller.AddChild(caller); } currentChain [currentChainIndex] = caller; currentChainIndex++; if (remainingCallersInChain > 0) { //Console.WriteLine ("HandleCallChain[{0}] {1} on {2}", remainingCallersInChain, caller.Name, lastCallee.Name); remainingCallersInChain--; result = false; } else { //Console.WriteLine ("HandleCallChain[{0}] {1}", remainingCallersInChain, caller.Name); result = true; StatisticalHitItemTreeNode currentNode = statisticalItemsByCallee; while (currentChainIndex > 0) { currentChainIndex--; currentNode = currentNode.AddChild(currentChain [currentChainIndex]); } eventsArePartOfChain = false; Array.Clear(currentChain, 0, currentChain.Length); } lastCallee = caller; return(result); } else { return(true); } }
public override void StatisticalCallChainStart(uint chainDepth) { lastCallee = null; lastCalleeNode = null; remainingCallersInChain = chainDepth; eventsArePartOfChain = true; currentChainIndex = 0; if (currentChain != null) { Array.Clear(currentChain, 0, currentChain.Length); } else { currentChain = new IStatisticalHitItem [32]; } //Console.WriteLine ("StatisticalCallChainStart ({0})", chainDepth); }
public StatNode(ProfileStore store, Node parent, IStatisticalHitItem item) : base(store, parent) { this.item = item; }
public StatNode (ProfileStore store, Node parent, IStatisticalHitItem item) : base (store, parent) { this.item = item; }