Skip to content

Commit d4d9e32

Browse files
committed
tasks: move read of system time into halt block
This ensures that the system time shown is consistent with the one that was visible to the tasks at the time the snapshot was taken.
1 parent eec0cd1 commit d4d9e32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/tasks/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ pub fn print_tasks(
219219
) -> Result<()> {
220220
let (base, task_count) = hubris.task_table(core)?;
221221
log::debug!("task table: {:#x?}, count: {}", base, task_count);
222-
let ticks = if core.is_net() { None } else { Some(hubris.ticks(core)?) };
223222

224223
let task_t = hubris.lookup_struct_byname("Task")?;
225224
let save = task_t.lookup_member("save")?.offset;
@@ -237,6 +236,9 @@ pub fn print_tasks(
237236
loop {
238237
core.halt()?;
239238

239+
let ticks =
240+
if core.is_net() { None } else { Some(hubris.ticks(core)?) };
241+
240242
let cur = hubris.current_task(core)?;
241243
let task_dump = hubris.task_dump();
242244

0 commit comments

Comments
 (0)