MCPcopy Create free account
hub / github.com/elastic/devfiler / insert_callee_node

Function insert_callee_node

src/ui/tabs/flamegraph.rs:1057–1079  ·  view source on GitHub ↗

Recursively insert a callee node and its descendants

(parent: &mut FlameGraphNode, node: &FlameGraphNode)

Source from the content-addressed store, hash-verified

1055
1056/// Recursively insert a callee node and its descendants
1057fn insert_callee_node(parent: &mut FlameGraphNode, node: &FlameGraphNode) {
1058 // Find or create child with this frame_id
1059 let child = if let Some(existing) = parent.children.iter_mut().find(|x| x.id == node.id) {
1060 existing.weight += node.weight;
1061 existing
1062 } else {
1063 parent.children.push(FlameGraphNode {
1064 weight: node.weight,
1065 fg_color: node.fg_color,
1066 bg_color: node.bg_color,
1067 id: node.id,
1068 text: node.text.clone(),
1069 inline_skip: node.inline_skip,
1070 children: vec![],
1071 });
1072 parent.children.last_mut().unwrap()
1073 };
1074
1075 // Recursively add all descendants
1076 for grandchild in &node.children {
1077 insert_callee_node(child, grandchild);
1078 }
1079}

Callers 1

insert_callee_subtreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected