/** * Refreshes the callers and callees. * * @param callerNames The caller names * @param calleeNames The callee names * @param frameRootNodes The frame root nodes * @param method The method */ private void refreshCallersCallees( List<String> callerNames, List<String> calleeNames, List<CallTreeNode> frameRootNodes, String method) { for (CallTreeNode frameNode : frameRootNodes) { String parentFrameName = frameNode.getParent().getName(); String frameName = frameNode.getName(); if (parentFrameName.equals(method)) { calleeNames.add(frameName); } if (frameName.equals(method)) { callerNames.add(parentFrameName); } refreshCallersCallees(callerNames, calleeNames, frameNode.getChildren(), method); } }
/** * Adds the focused hot spot nodes. * * @param frame The frame node */ private void addFocusedHotSpotNodes(ICallTreeNode frame) { String methodName = frame.getName(); MethodNode node = new MethodNode(this, methodName, null); node.incrementCount(frame.getInvocationCount()); node.incrementTime(frame.getSelfTime()); focusedHotSpotRoots.put(methodName, node); for (CallTreeNode child : ((CallTreeNode) frame).getChildren()) { methodName = child.getName(); if (focusedHotSpotRoots.containsKey(methodName)) { node = focusedHotSpotRoots.get(methodName); node.incrementCount(child.getInvocationCount()); node.incrementTime(child.getSelfTime()); } else { node = new MethodNode(this, methodName, null); node.incrementCount(child.getInvocationCount()); node.incrementTime(child.getSelfTime()); focusedHotSpotRoots.put(methodName, node); } addFocusedHotSpotNodes(child); } }