MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / new_schedule

Method new_schedule

crates/firewheel-graph/src/processor/profiling.rs:117–148  ·  view source on GitHub ↗
(
        &mut self,
        schedule: &CompiledSchedule,
        new_heap_data: &mut Option<ProfilerHeapData>,
    )

Source from the content-addressed store, hash-verified

115
116impl 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,

Callers

nothing calls this directly

Calls 3

as_mutMethod · 0.80
iter_node_idsMethod · 0.80
graph_in_node_idMethod · 0.45

Tested by

no test coverage detected