Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adapter/thread_metric/tests/tm_basic_process_test.checker
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// TOTAL-TIMEOUT: 10
// TOTAL-TIMEOUT: 20
// ASSERT-SUCC: Relative Time: 8
// ASSERT-FAIL: ERROR
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// TOTAL-TIMEOUT: 10
// TOTAL-TIMEOUT: 20
// ASSERT-SUCC: Relative Time: 8
// ASSERT-FAIL: ERROR
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// TOTAL-TIMEOUT: 10
// TOTAL-TIMEOUT: 20
// ASSERT-SUCC: Relative Time: 8
// ASSERT-FAIL: ERROR
4 changes: 2 additions & 2 deletions kernel/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ impl Mutex {
#[cfg(debugging_scheduler)]
crate::trace!(
"Trying to get read lock of mutex {:?}, estimated R {}, W {}",
mutex.deref() as *const _,
mutex as *const _,
mutex.pending.reader_count(),
mutex.pending.writer_count(),
);
let read = mutex.pending.irqsave_read();
#[cfg(debugging_scheduler)]
crate::trace!("Got the read lock of mutex {:?}", mutex.deref() as *const _);
crate::trace!("Got the read lock of mutex {:?}", mutex as *const _);
let Some(front) = read.front() else {
continue;
};
Expand Down
14 changes: 12 additions & 2 deletions kernel/src/time/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,17 @@ mod tests {
let hz = ClockImpl::hz();
let l = 99;
let r = 1_01;
assert!(diff >= l * hz / 1_00);
assert!(diff <= r * hz / 1_00);
assert!(
diff >= l * hz / 1_00,
"Timer fired too early: diff = {}, expected at least {}",
diff,
l * hz / 1_00
);
assert!(
diff <= r * hz / 1_00,
"Timer fired too late: diff = {}, expected at most {}",
diff,
r * hz / 1_00
);
}
}