| 560 | } |
| 561 | |
| 562 | void AggregatedRuntimeProfile::UpdateAggregatedFromInstancesRecursive( |
| 563 | const TRuntimeProfileTree& src, int* node_idx, int start_idx, |
| 564 | bool add_default_counters) { |
| 565 | DCHECK_LT(*node_idx, src.nodes.size()); |
| 566 | const TRuntimeProfileNode& node = src.nodes[*node_idx]; |
| 567 | DCHECK(node.__isset.aggregated); |
| 568 | |
| 569 | UpdateFromInstances(node, start_idx, pool_); |
| 570 | |
| 571 | ++*node_idx; |
| 572 | { |
| 573 | lock_guard<SpinLock> l(children_lock_); |
| 574 | ChildVector::iterator insert_pos = children_.begin(); |
| 575 | // Update children with matching names; create new ones if they don't match. |
| 576 | for (int i = 0; i < node.num_children; ++i) { |
| 577 | const TRuntimeProfileNode& tchild = src.nodes[*node_idx]; |
| 578 | bool is_timed = add_default_counters && !UntimedProfileNode(tchild.name); |
| 579 | AggregatedRuntimeProfile* child = |
| 580 | dynamic_cast<AggregatedRuntimeProfile*>(AddOrCreateChild( |
| 581 | tchild.name, &insert_pos, |
| 582 | [this, tchild, is_timed]() { |
| 583 | AggregatedRuntimeProfile* child2 = Create( |
| 584 | pool_, tchild.name, num_input_profiles_, /*is_root=*/false, is_timed); |
| 585 | child2->metadata_ = tchild.node_metadata; |
| 586 | return child2; |
| 587 | }, |
| 588 | tchild.indent)); |
| 589 | DCHECK(child != nullptr); |
| 590 | child->UpdateAggregatedFromInstancesRecursive(src, node_idx, start_idx, is_timed); |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | void AggregatedRuntimeProfile::UpdateFromInstances( |
| 596 | const TRuntimeProfileNode& node, int start_idx, ObjectPool* pool) { |
nothing calls this directly
no test coverage detected