|
|
|
@ -139,7 +139,17 @@ current_sandbox_build_and_send_client_response(void)
|
|
|
|
|
done:
|
|
|
|
|
assert(sndsz == curr->request_response_data_length);
|
|
|
|
|
// Get End Timestamp
|
|
|
|
|
curr->total_time = __getcycles() - curr->start_time;
|
|
|
|
|
u64 end_time = __getcycles();
|
|
|
|
|
curr->total_time = end_time - curr->start_time;
|
|
|
|
|
// TODO: Refactor to log file
|
|
|
|
|
printf("Function returned in %lu cycles\n", curr->total_time);
|
|
|
|
|
if (end_time < curr->absolute_deadline) {
|
|
|
|
|
printf("Deadline Met with %f us to spare\n",
|
|
|
|
|
(curr->absolute_deadline - end_time) / runtime_processor_speed_MHz);
|
|
|
|
|
} else {
|
|
|
|
|
printf("Deadline NOT MET! Overran by %f us\n",
|
|
|
|
|
(end_time - curr->absolute_deadline) / runtime_processor_speed_MHz);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef USE_HTTP_UVIO
|
|
|
|
|
int r = send(curr->client_socket_descriptor, curr->request_response_data, sndsz, 0);
|
|
|
|
@ -296,7 +306,7 @@ sandbox_allocate_memory(struct module *module)
|
|
|
|
|
|
|
|
|
|
struct sandbox *
|
|
|
|
|
sandbox_allocate(struct module *module, char *arguments, int socket_descriptor, const struct sockaddr *socket_address,
|
|
|
|
|
u64 start_time)
|
|
|
|
|
u64 start_time, u64 absolute_deadline)
|
|
|
|
|
{
|
|
|
|
|
if (!module_is_valid(module)) return NULL;
|
|
|
|
|
|
|
|
|
@ -307,6 +317,7 @@ sandbox_allocate(struct module *module, char *arguments, int socket_descriptor,
|
|
|
|
|
|
|
|
|
|
// Assign the start time from the request
|
|
|
|
|
sandbox->start_time = start_time;
|
|
|
|
|
sandbox->absolute_deadline = absolute_deadline;
|
|
|
|
|
|
|
|
|
|
// actual module instantiation!
|
|
|
|
|
sandbox->arguments = (void *)arguments;
|
|
|
|
|