Skip to content

Commit

Permalink
tasks: move read of system time into halt block
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cbiffle committed Jan 27, 2025
1 parent eec0cd1 commit d4d9e32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/tasks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ pub fn print_tasks(
) -> Result<()> {
let (base, task_count) = hubris.task_table(core)?;
log::debug!("task table: {:#x?}, count: {}", base, task_count);
let ticks = if core.is_net() { None } else { Some(hubris.ticks(core)?) };

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

let ticks =
if core.is_net() { None } else { Some(hubris.ticks(core)?) };

let cur = hubris.current_task(core)?;
let task_dump = hubris.task_dump();

Expand Down

0 comments on commit d4d9e32

Please sign in to comment.