| 148 | } |
| 149 | |
| 150 | pub fn new_process_loop( |
| 151 | &mut self, |
| 152 | proc_start_instant: Instant, |
| 153 | total_cpu_seconds_recip: f64, |
| 154 | flags: &FirewheelBitFlags, |
| 155 | ) { |
| 156 | self.proc_start_instant = proc_start_instant; |
| 157 | self.total_cpu_seconds_recip = total_cpu_seconds_recip; |
| 158 | |
| 159 | self.bookkeeping_cpu_usage_sum = 0.0; |
| 160 | self.bookkeeping_start_instant = proc_start_instant; |
| 161 | |
| 162 | let new_is_profiling_bookkeeping = |
| 163 | flags.contains(FirewheelBitFlags::PROFILE_ENGINE_BOOKKEEPING); |
| 164 | if new_is_profiling_bookkeeping && !self.is_profiling_bookkeeping { |
| 165 | self.bookkeeping_cpu_usage = 0.0; |
| 166 | } |
| 167 | self.is_profiling_bookkeeping = new_is_profiling_bookkeeping; |
| 168 | |
| 169 | #[cfg(feature = "node_profiling")] |
| 170 | { |
| 171 | let new_is_profiling_nodes = flags.contains(FirewheelBitFlags::PROFILE_NODES); |
| 172 | |
| 173 | if new_is_profiling_nodes && !self.is_profiling_nodes { |
| 174 | for node in self.heap_data.nodes.iter_mut() { |
| 175 | node.cpu_usage = 0.0; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | self.is_profiling_nodes = new_is_profiling_nodes; |
| 180 | |
| 181 | if self.is_profiling_nodes { |
| 182 | self.heap_data.node_cpu_sums.clear(); |
| 183 | self.heap_data |
| 184 | .node_cpu_sums |
| 185 | .resize(self.heap_data.nodes.len(), 0.0); |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | pub fn begin_new_bookkeeping_part(&mut self) { |
| 191 | if self.is_profiling_bookkeeping |