From c5a3f9bc4184f13c74bd9c7d0fef4738aa59fa5a Mon Sep 17 00:00:00 2001 From: xiaosuGW Date: Mon, 23 Aug 2021 11:55:34 -0500 Subject: [PATCH] use completion_timestamp instead of now() to check if the request missed deadline or not --- runtime/include/sandbox_functions.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/include/sandbox_functions.h b/runtime/include/sandbox_functions.h index b3179d2..79cc366 100644 --- a/runtime/include/sandbox_functions.h +++ b/runtime/include/sandbox_functions.h @@ -216,10 +216,12 @@ sandbox_mem_print_perf(struct sandbox *sandbox) uint32_t returned_us = sandbox->returned_duration / runtime_processor_speed_MHz; if (sandbox->module->next_module == NULL) { - uint32_t now = __getcycles(); - bool miss_deadline = now > sandbox->absolute_deadline ? true : false; + uint32_t total_time = (sandbox->completion_timestamp - sandbox->request_arrival_timestamp) / runtime_processor_speed_MHz; + bool miss_deadline = sandbox->completion_timestamp > sandbox->absolute_deadline ? true : false; + uint32_t delayed_us = (sandbox->completion_timestamp - sandbox->absolute_deadline) + / runtime_processor_speed_MHz; if (miss_deadline) { - mem_log("%lu miss deadline\n", sandbox->id); + mem_log("%lu miss deadline, delayed %u us, actual cost %u\n", sandbox->id, delayed_us, total_time); } else { mem_log("%lu meet deadline\n", sandbox->id); }