(
&mut self,
schedule: &CompiledSchedule,
new_heap_data: &mut Option<ProfilerHeapData>,
)
| 115 | |
| 116 | impl ProfilerTx { |
| 117 | pub fn new_schedule( |
| 118 | &mut self, |
| 119 | schedule: &CompiledSchedule, |
| 120 | new_heap_data: &mut Option<ProfilerHeapData>, |
| 121 | ) { |
| 122 | #[cfg(not(feature = "node_profiling"))] |
| 123 | let _ = schedule; |
| 124 | |
| 125 | if let Some(new_heap_data) = new_heap_data.as_mut() { |
| 126 | core::mem::swap(&mut self.heap_data, new_heap_data); |
| 127 | } |
| 128 | |
| 129 | #[cfg(feature = "node_profiling")] |
| 130 | { |
| 131 | self.heap_data.nodes.clear(); |
| 132 | self.heap_data.node_cpu_sums.clear(); |
| 133 | |
| 134 | let graph_in_node_id = schedule.graph_in_node_id(); |
| 135 | |
| 136 | self.heap_data.nodes.extend( |
| 137 | schedule |
| 138 | .iter_node_ids() |
| 139 | // Don't count the graph input node since it is processed separately. |
| 140 | .filter(|node_id| *node_id != graph_in_node_id) |
| 141 | .map(|node_id| NodeProfileData { |
| 142 | node_id, |
| 143 | // TODO: Try to re-use old cpu usage data. |
| 144 | cpu_usage: 0.0, |
| 145 | }), |
| 146 | ); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | pub fn new_process_loop( |
| 151 | &mut self, |
nothing calls this directly
no test coverage detected