Home | History | Annotate | Download | only in profiling

Lines Matching defs:Node

113 //  Each node shows the absolute percentage, among all the samples,
115 // The percentages are *NOT* relative to the parent node. In addition
117 // the remainder of samples under the parent node that didn't fall into
158 struct Node {
159 std::vector<Node*> children;
162 Node() : label(nullptr), weight(0) {}
163 ~Node() {
170 static bool CompareNodes(Node* n1, Node* n2) {
174 Node root_;
176 void PrintNode(const Node* node, int level) const {
181 printf("%.2f%% %s\n", 100.0f * node->weight / root_.weight, node->label);
183 for (auto child : node->children) {
188 static void AddStackToNode(const ProfilingStack& stack, Node* node,
190 node->weight++;
194 Node* child_to_add_to = nullptr;
195 for (auto child : node->children) {
202 child_to_add_to = new Node;
204 node->children.push_back(child_to_add_to);
214 void AddOtherChildrenToNode(Node* node) {
216 for (auto c : node->children) {
221 Node* other_child = new Node;
223 node == &root_ ? "other (outside of any label)" : "other";
224 other_child->weight = node->weight - top_level_children_weight;
225 node->children.push_back(other_child);
231 void SortNode(Node* node) {
232 std::sort(node->children.begin(), node->children.end(), CompareNodes);
233 for (auto child : node->children) {